# Solution of the following second order ODE

Solve the following diff. eqn.

$$y''(x)+My(x)=f(x)$$

SOLUTION

I found the solution as follows by Cramer's Rule:

\begin{align} y(x) &= c_2 \sin \left(\sqrt{M} x\right)+c_1 \cos \left(\sqrt{M} x\right) \\ &+ \sin \left(\sqrt{M} x\right) \int_1^x \frac{ f(\zeta)\cos \left( \sqrt{M}\zeta\right)}{\sqrt{M}} \, d\zeta - \cos \left(\sqrt{M} x\right) \int_1^x \frac{f (\xi ) \sin \left(\sqrt{M} \xi \right)}{\sqrt{M}} \, d\xi \end{align}

Is it equal to following? If so, how?

$$y(x)=c_2 \sin \left(\sqrt{M} x\right)+c_1 \cos \left(\sqrt{M} x\right)+\int_0^x \frac{\sin \left(\sqrt{M} (x-\phi) \right)}{\sqrt{M}}f( \phi) \, d\phi$$

$$\sin(\sqrt{M}x)\cos(\sqrt{M}\phi) - \cos(\sqrt{M}x)\sin(\sqrt{M}\phi) = \sin \big(\sqrt{M}(x-\phi)\big)$$
where integration is performed w.r.t $\phi$. The lower limit is arbitrary.