How to solve the $u'' + u + \sin (x) = 0$ Could someone help me to obtain the general solution to this differential equation? 
I need to solve the DE: $$u'' + u + \sin (x) = 0$$

Note: "I got as far as the general solution for $\;u''+u=0,$ but it was the $\;\sin(x)$ term that confused me."
 A: You are looking at the 2nd order ODE with constant coefficients, which is linear. Hence, general solution comes from solving the homogeneous ODE $$u''+u=0$$ which you can do by substituting $u = e^{rx}$, which yields the equation $r^2+1=0$. You get $r = \pm i$ and hence
$$
u_h(x) = \alpha e^{ix} + \beta e^{-ix} = a \sin x + b \cos x
$$
is the general solution. To pick the particular solution for your free term, let
$$
u_p(x) = Ax \sin x + B x \cos x
$$
and note that 
$$
\begin{split}
u_p'(x) &= A\sin x + Ax \cos x + B \cos x - Bx \sin x \\
        &= (A-Bx) \sin x + (Ax+B) \cos x.
\end{split}
$$
Similarly,
$$
\begin{split}
u_p''(x) &= -B\sin x + (A-Bx) \cos x + A \cos x - (Ax+B) \sin x \\
         &= (-Ax-2B) \sin x + (2A-Bx) \cos x.
\end{split}
$$
Hence
$$
\begin{split}
0 = u_p(x) + u_p''(x) + \sin x = (1-2B) \sin x + 2A \cos x.
\end{split}
$$
which implies $B = 1/2$ and $A = 0$, so $u_p(x) = x \cos (x) /2$ and hence the general solution would be
$$
u(x) = u_p(x) + u_h(x) = a \sin x + \left(b + \frac{x}{2} \right) \cos x
$$
