(My specific question is at the end of the problem)
Examine the boundary problem with a nonlinear right hand side $1+u^2(x)$ $$-u''(x) = 1+u^2(x) \quad \text{on} \quad 0 < x < 1 \quad \text{with} \quad u(0) = u(1) = 0$$ use 4 internal points $x_1$, $x_2$, $x_3$, $x_4$. With $u_i = u(x_i)$ we use the finite difference approximation $$u''(x_i) \approx \frac{-u(x_{i-1}) + 2u(x_i) - u(x_{i+1})}{h^2} = \frac{-u_{i-1} + 2u_i - u_{i+1}}{h^2}$$ where $h = \frac{1}{5} = 0.2$ and $u(x_0) = u_0 = u(x_5) = u_5 = 0$. Thus we obtain a non-linear system of equations. $$ \frac{1}{0.4^2} \begin{bmatrix} +2 & -1 & 0 & 0 \\ -1 & +2 & -1 & 0 \\ 0 & -1 & +2 & -1 \\ 0 & 0 & -1 & +2 \\ \end{bmatrix} \begin{pmatrix} u_1 \\ u_2 \\ u_3 \\ u_4 \end{pmatrix} = \begin{pmatrix} 1 + u_1^2 \\ 1 + u_2^2 \\ 1 + u_3^2 \\ 1 + u_4^2 \end{pmatrix} $$ To solve this non-linear system use methods from non linear problems, e.g. Newton's method: Use the Taylor approximation $(u+\phi)^2\approx u^2+2u\phi$. Start with an initial vector $\vec{u}_0$, e.g.$\vec{u}_0=0$. Then use the iteration\newline \begin{align} \textbf{A}\cdot (\vec{u}_k + \vec{\phi})&=1+\vec{u}_k^2+2\vec{u}_k\cdot\vec{\phi}\\ \textbf{A}\cdot (\vec{u}_k + \vec{\phi}) - 2\vec{u}_k\cdot\vec{\phi}&= 1+\vec{u}_k^2\\ \textbf{A} \cdot (\vec{u}_k + \vec{\phi}) - \text{diag}(2\vec{u}_k)\cdot \phi &= 1 + \vec{u}_k^2\\ \textbf{A}\cdot\phi + \textbf{A}\cdot\vec{u}_k- \text{diag}(2\vec{u}_k)\cdot\phi &= 1 + \vec{u}_k^2\\ \textbf{A}\cdot\phi - \text{diag}(2\vec{u}_k)\cdot\phi &= 1 + \vec{u}_k^2-\textbf{A}\cdot\vec{u}_k\\ (\textbf{A} - \text{diag}(2\vec{u}_k))\cdot \phi &= 1 + \vec{u}_k^2-\textbf{A}\cdot\vec{u}_k\tag{1}\\ \vec{u}_{k+1} &=\vec{u}_k+\vec{\phi}\tag{2} \end{align}
My question is: how do we get from (1) to (2)?