To solve ${d^2y \over dx^2} =f(x)$, $0
Then we get a system of linear equations which can be written as $\left(\begin{array}{ccccc} -1 & 1/2 & 0 &0 &0 \\ 1/2 & -1 & 1/2 &0 &0\\ 0 & 1/2 & -1 &1/2&0\\ 0 & 0 & 1/2&-1 &1/2\\ 0 & 0 & 0 &1/2 &-1\end{array} \right) \cdot \left(\begin{array}{c} y_1 \\ y_2 \\ y_3 \\ y_4 \\ y_5 \end{array} \right) = \left(\begin{array}{c} \frac{h^2}{2}f_1 -\frac{\alpha}{2}\\ \frac{h^2}{2}f_2 \\ \frac{h^2}{2}f_3 \\ \frac{h^2}{2}f_4 \\ \frac{h^2}{2}f_5 -\frac{\beta}{2} \end{array} \right)$
which we can solve by gaussian elimination.
I got the idea from http://www2.imperial.ac.uk/~pavl/finite_dff.pdf
I understand the above, but how do I calculate/find/write out $f_2$, $f_3$, $f_4$ etc.? What if my DE is$-{d^2y\over dx^2} + {dy\over dx} =x \Leftrightarrow {d^2y\over dx^2}={dy\over dx}-x $ with $u(0)=\alpha, u(1) = \beta$?
Edit: I rearranged the equation and got
$f_{j+1}(1-\frac{h}{2})+y_{j-1}(1+\frac{h}{2})+y_j(-2)=h^2f_j$.
$j=1 \Rightarrow f_{2}(1-\frac{h}{2})+y_{0}(1+\frac{h}{2})+y_1(-2)=h^2f_1$.
So does $h^2f_1 = \frac{1}{36}\cdot(-\frac{1}{6})?$ And does $h^2f_2 = \frac{1}{36}\cdot(-\frac{2}{6})$?