I might be a little late adding this but hopefully someone will be able to help me out before our quiz tomorrow. I tried my hand at it and I was wondering if this was the right way to go about this problem.
So the equation starts off with $u''=-\sin(\pi x^2)$ with initial conditions $u(0) = u(1) = 0$. We know that for a second order differential equation, the approximations can be calculated with $u(x) = \frac{u_{i+1}-2u_1+u_{i-1}}{h^2}$. This is what I did and these are the answers I got and I'd just like to verify if I did it right or if I didn't, how I'd go about solving it:
$h = \frac{1}{4}$ from the number line given to us, $u_0 = 0$, $u_1 = 0$, $x_0 = 0$, $x_1 = 1$
$$\frac{u_0 - 2u_{\frac{1}{4}} + u_{\frac{2}{4}}}{\frac{1}{16}} = - \sin[(\frac{1}{4})^2\pi]$$
$$16({u_0 - 2u_{\frac{1}{4}} + u_{\frac{2}{4}}}) = - \sin(\frac{\pi}{16})$$
$$16{u_0 - 32u_{\frac{1}{4}} + 16u_{\frac{2}{4}}} = - \sin(\frac{\pi}{16})$$
The rest of the equations are as follows then:
$$16{u_{\frac{1}{4}} - 32u_{\frac{2}{4}} + 16u_{\frac{3}{4}}} = - \sin(\frac{\pi}{4})$$
$$16{u_{\frac{2}{4}} - 32u_{\frac{3}{4}} + 16u_1} = - \sin(\frac{9\pi}{16})$$
Since we know $u_0$ and $u_1$, we can substitute values in for those and I think the three equations simplify down to the following:
$$-32{u_{\frac{1}{4}} + 16u_{\frac{2}{4}}} = - \sin(\frac{\pi}{16})$$
$$16{u_{\frac{1}{4}} - 32u_{\frac{2}{4}} + 16u_{\frac{3}{4}}} = - \sin(\frac{\pi}{4})$$
$$16{u_{\frac{2}{4}} - 32u_{\frac{3}{4}}} = - \sin(\frac{9\pi}{16})$$
Can anyone else verify this? Thank you!
--Qurat