= Solution
{c}
The <homogeneous linear differential equation> $y''+y=0$ has <general solution> $C_1\cos x+C_2\sin x$. For a <particular solution>, use <variation of parameters> with $y_1=\cos x$, $y_2=\sin x$ and <Wronskian> one:
$$
y_p=-\cos x\int x\sin^2x\,dx+\sin x\int x\sin x\cos x\,dx.
$$
The <double-angle formulas> and <integration by parts> give
$$
\int x\sin^2x\,dx=\frac{x^2}{4}-\frac{x\sin2x}{4}-\frac{\cos2x}{8},\qquad
\int x\sin x\cos x\,dx=-\frac{x\cos2x}{4}+\frac{\sin2x}{8}.
$$
Substitution simplifies to $-x^2\cos x/4+x\sin x/4+\cos x/8$. Absorb the last term into the <homogeneous linear differential equation> solution. Therefore
$$
\boxed{y(x)=C_1\cos x+C_2\sin x+\frac{x\sin x-x^2\cos x}{4}.}
$$
Indeed, applying $d^2/dx^2+1$ to $x\sin x$ gives $2\cos x$, and applying it to $x^2\cos x$ gives $2\cos x-4x\sin x$; their difference divided by four is the required $x\sin x$.
Back to article page