1. Variation of parameters

Use the method of variation of parameters to find a particular solution of the given differential equation.

$\displaystyle y''+4y=\sin^2 x$

My attempt:

$\displaystyle y_c(x)=c_1\cos 2x+c_2\sin 2x$

$\displaystyle y_1=\cos 2x,\ y_2=\sin 2x$

$\displaystyle y_1'=-2\sin 2x,\ y_2'=2\cos 2x$

$\displaystyle u_1'\cos 2x+u_2'\sin 2x=0$

$\displaystyle u_1'*-2\sin 2x+u_2'*2\cos 2x=\sin^2 x$

$\displaystyle 2u_1'\sin 2x\cos 2x+2u_2'\sin^2 2x=0$

$\displaystyle -2u_1'\sin 2x\cos 2x+2u_2'\cos^2 2x=\sin^2x\cos 2x$

$\displaystyle 2u_2'=\sin^2x\cos 2x$

$\displaystyle u_2'=\frac{1}{2}\sin^2x\cos 2x$

$\displaystyle u_1'=-\frac{1}{2}\sin^2x\sin 2x$

$\displaystyle =-\sin^3 x\cos x$

$\displaystyle u_1=-\frac{1}{4}\sin^4 x$

$\displaystyle u_2'=\frac{1}{4}(1-\cos 2x)\cos 2x$

$\displaystyle =\frac{1}{4}(\cos 2x-\cos^2 2x)$

$\displaystyle =\frac{1}{4}\cos 2x-\frac{1}{8}(1+\cos 4x)$

$\displaystyle =\frac{1}{8}(2\cos 2x-\cos 4x-1)$

$\displaystyle u_2=\frac{1}{8}\left(\sin 2x-\frac{1}{4}\sin 4x-x\right)$

$\displaystyle y_p(x)=-\frac{1}{4}\sin^4 x\cos 2x+\frac{1}{8}\left(\sin 2x-\frac{1}{4}\sin 4x-x\right)\sin 2x$

$\displaystyle =-\frac{1}{4}\sin^4 x\cos 2x+\frac{1}{8}\sin^2 2x-\frac{1}{32}\sin 4x\sin 2x-\frac{1}{8}x\sin 2x$

----------------------------------------------------------------------------------------------------------------

However, the answer given in the book is

$\displaystyle y_p(x)=\frac{1}{8}(1-x\sin 2x)$

Where have I gone wrong?

2. Re: Variation of parameters

$\displaystyle -\frac{1}{4} \left(\frac{1 - \cos 2x}{2}\right)^2 \cos 2x + \frac{1 - \cos ^2 2x}{8} - \frac{1}{16}\left(1 -\cos ^2 2x\right)\cos 2x - \frac{ x \sin 2x}{8}$
$\displaystyle - \frac{\cos 2x}{8} + \dfrac{1}{8} - \frac{ x \sin 2x}{8}$.