I need help with the solution of this particular equation:
$$\frac{d^2y}{dx^2} + y = \sin{x}$$
Due to me having to go to work, I cannot display all my work in mathjax, my shift starts in 5 min...but my solution is: $$y= \frac{-x}{2} + \frac{(\cos{2x}\sin{x})}{4} + C_1\cos{x} + C_2\sin{x}$$
Whereas my book's solution is: $$y= \frac{-x}{2} +C_1\cos{x} + C_2\sin{x}$$
I have used the method of variation of prameters, cramer's rule and basic antidifferentiation to solve resulting system.
Thank you all!
With characteristic equation $\lambda^2+1=0$ we know that the general solution is of the form $y_g=C_1\sin x+C_2\cos x$. Since the right side of the equation is $\sin$, one of the general answer, then the particular solution is of the the form $y_p=Ax\sin x+Bx\cos x$, after substitution we have $A=0$ and $B=-\dfrac12$, therefore solution is $$y_g=C_1\sin x+C_2\cos x-\dfrac12x\cos x$$