I have differential equation $u''(x)+9u(x) = \cos(2x), \; x \in [0, π/2]$ the boundary conditions are $u(0)=1$, $u(\pi / 2) = -1$, with $h = 0.2$
Now I replaced $u''(x)$ with centered difference and I got:
$$\frac{u(x+h)-2u(x)+u(x-h)}{h^2 }+9u(x)= \cos(2x)$$
$$u(x+h)-2u(x)+u(x-h)+9u(x)*h^2=\cos(2x)*h^2$$
$$u(x+h)+u(x)(-2+9*h^2)+u(x-h)= \cos(2x)*h^2$$
$$u(x+h)+u(x)(-2+9*0.2^2)+u(x-h)=\cos(2x)*0.2^2$$
$$u(x+h)+u(x)(-1.64)+u(x-h)=\cos(2x)*0.2^2$$
Would anyone be able to point me in the right direction from here?