Solve the equation $(D^2+4)y=x\sin^2 x$. It is given that $D=\frac {d}{dx}$ Solve the equation $(D^2+4)y=x\sin^2 x$. It is given that $D=\frac {d}{dx}$
My Attempt:
The given equation is 
$$(D^2+4)y=x\sin^2 x$$
It's auxiliary equation is
$$m^2+4=0$$
$$m^2=-4$$
$$m=\pm 2i$$
$$\textrm {Complementary Function (C.F)}=c_1 \cos (2x) + c_2 \sin (2x)$$
Now, the particular integral is given by
$$\textrm {P.I.}=\frac {x\sin^2 x}{D^2+4}$$
$$=\frac {x}{D^2+4}\cdot \frac {1-\cos (2x)}{2}$$
$$=\frac {x}{2(D^2+4)} - \frac {x\cdot \cos (2x)}{2(D^2+4)}$$
$$=\frac {1}{2} \cdot \frac {1}{4} \cdot (1+\frac {D^2}{4})^{-1} \cdot x - \frac {1}{2}(x\cdot \frac {\cos (2x)}{D^2+4} - \frac {2D \cos (2x)}{(D^2+4)^2})$$
$$=\frac {x}{8} - \frac {1}{2} (x\cdot \frac {x \cos (2x)}{2D} - \frac {2D \cos (2x)}{(D^2+4)^2} )$$
How do I solve further?
 A: Starting from here:
$$y_p=\frac {x\sin^2 x}{D^2+4}$$
$$2y_p=\frac {x(1-\cos (2 x))}{D^2+4}$$
$$2y_p=\frac {x }{D^2+4}-\frac {x\cos (2 x)}{D^2+4}$$
$$2y_p=\dfrac x 4-(x-\dfrac {2D}{D^2+4})\frac {\cos(2 x)}{D^2+4}$$
More simply:
$$2y_p=\dfrac x 4-x\frac {\cos(2 x)}{D^2+4}$$
$$2y_p=\dfrac x 4-\Re \{x\frac {e^{2 ix}}{D^2+4}\}$$
$$2y_p=\dfrac x 4-\Re \{xe^{2 ix}\frac {1}{D(D+4i)}\}$$
$$2y_p=\dfrac x 4-\Re \{ \dfrac {xe^{2 ix}}{4i}({\frac 1D -\dfrac 1{D+4i}})\}$$
$$2y_p=\dfrac x 4-\Re \{\dfrac {xe^{2 ix}}{4i}({x -\dfrac 1{4i}})\}$$
Now apply Euler's formula to get the final result:
$$\boxed {y_p=\dfrac x 8-\frac {x^2}{16}\sin (2x)-\dfrac {x}{32} \cos(2x)}$$
A: Starting from the 3rd step
$$P.I =\frac {x}{2(D^2+4)} - \frac {x\cdot \cos (2x)}{2(D^2+4)}
$$
$$=\frac{x}{4} -\frac {x\cdot \cos (2x)}{2(D^2+4)}...(1)$$
First we evaluate
$$\frac{cos {2x}}{D^2+4} $$
$$=\frac{1}{D^2+4}\frac{e^{2ix}+e^{-2ix}}{2}$$
$\text{   You can do the easy calculation. it will give. }$
$$=\frac{x\sin {2x}}{4}$$
Similarly
 $$\frac{\sin {2x}}{D^2+4} =\frac{x\cos {2x}}{-4}$$
Now let $$V=\frac {x\cdot \cos (2x)}{(D^2+4)}$$
$$=[x\cdot \frac {\cos (2x)}{D^2+4} - \frac {2D \cos (2x)}{(D^2+4)^2}]$$
$$=\frac{1}{4}x^2\sin {2x} -\frac{1}{2}\frac{1}{D^2+4}D(x\sin {2x})$$
$$=\frac{1}{4}x^2\sin {2x} -\frac{1}{2}\frac{1}{D^2+4}(\sin {2x}+2x\cos {2x}$$
$$=\frac{1}{4}x^2\sin {2x} -\frac{1}{2}\frac{1}{D^2+4}\sin {2x}--\frac{1}{D^2+4}x\cos {2x}$$
$$V=\frac{1}{4}x^2\sin {2x} -\frac{1}{2}(\frac{x \cos {2x}}{-4})-V$$
This gives
$$ V=\frac {x^2 sin 2x}{4}+\frac{ x cos 2x}{16}$$
Thus from $(1)$
$$P.I=\frac{x}{8} -\frac{1}{2}(\frac {x^2 sin 2x}{8}+\frac{ x cos 2x}{16})$$
