1.3.3.7 \(y^{\prime \prime }+y=\sin \left ( x\right ) \) with three IC \(y\left ( 0\right ) =0,y\left ( 1\right ) =0,y\left ( 2\right ) =5\)
Since we have second order ode with three IC, this is overdetermined system and we
expect no solution to exist in general. The general solution is as before
\[ y=c_{1}\cos x+c_{2}\sin x+\frac {\sin x}{2}-x\frac {\cos x}{2}\]
We now set up one equation for each IC. This gives
\begin{align*} y\left ( 0\right ) & =c_{1}\cos \left ( 0\right ) +c_{2}\sin \left ( 0\right ) +\frac {\sin \left ( 0\right ) }{2}-\left ( 0\right ) \frac {\cos \left ( 0\right ) }{2}\\ 0 & =c_{1}\end{align*}
And
\begin{align*} y\left ( 1\right ) & =c_{1}\cos \left ( 1\right ) +c_{2}\sin \left ( 1\right ) +\frac {\sin \left ( 1\right ) }{2}-\frac {\cos \left ( 1\right ) }{2}\\ 0 & =c_{1}\cos \left ( 1\right ) +c_{2}\sin \left ( 1\right ) +\frac {\sin \left ( 1\right ) }{2}-\frac {\cos \left ( 1\right ) }{2}\end{align*}
And
\begin{align*} y\left ( 2\right ) & =c_{1}\cos \left ( 2\right ) +c_{2}\sin \left ( 2\right ) +\frac {\sin \left ( 2\right ) }{2}-2\frac {\cos \left ( 2\right ) }{2}\\ 5 & =c_{1}\cos \left ( 2\right ) +c_{2}\sin \left ( 2\right ) +\frac {\sin \left ( 2\right ) }{2}-\cos \left ( 2\right ) \end{align*}
From the first equation we have \(c_{1}=0\). Hence we end up with two equations now
\begin{align*} 0 & =\left ( 0\right ) \cos \left ( 1\right ) +c_{2}\sin \left ( 1\right ) +\frac {\sin \left ( 1\right ) }{2}-\frac {\cos \left ( 1\right ) }{2}\\ 5 & =\left ( 0\right ) \cos \left ( 2\right ) +c_{2}\sin \left ( 2\right ) +\frac {\sin \left ( 2\right ) }{2}-\cos \left ( 2\right ) \end{align*}
Or
\begin{align*} 0 & =c_{2}\sin \left ( 1\right ) +\frac {\sin \left ( 1\right ) }{2}-\frac {\cos \left ( 1\right ) }{2}\\ 5 & =c_{2}\sin \left ( 2\right ) +\frac {\sin \left ( 2\right ) }{2}-\cos \left ( 2\right ) \end{align*}
There is no one \(c_{2}\) which will satisfy both of these two equations. Hence no solution
exist.
The above examples illustrate the general approach to use for solving for IC/BC for all
possible cases. This can be applied to any ode order and for any type of IC, either for pure
IVP, or mixed IC or pure boundary conditions.