solving second order non-homogeneous differential equation 2 I have a problem on solving this differential equation.
$
y=c_{1}+c_{2}e^{-2x}-cos2x-1/2(sin2x-cos2x)
$ 
I reached :
$
y''+2y'=4sin2x
$
as answer but I'm not sure.
my step by step solution is :
$
y_{h}=c_{1}+c_{2}e^{-2x}
$
$
w(1,e^{-2x})=-2e^{-2x}
$
$
u_{1}=\int([-e^{2x}*4sin2x]/-2e^{-2x})=> u_{1}=-cos2x
$
$
u_{2}=\int(4sin2x/-2e^{-2x})=> u_{2}=-1/2e^{2x}(sin2x-cos2x)
$
$
y_{p}=-cos2x-1/2e^{2x}(sin2x-cos2x)
$
$
y=c_{1}+c_{2}e^{-2x}-cos2x-1/2e^{2x}(sin2x-cos2x)
$
 A: your solution must be $$y \left( x \right) =-1/2\,\sin \left( 2\,x \right) -1/2\,\cos \left( 2
\,x \right) -1/2\,{{\rm e}^{-2\,x}}{\it \_C1}+{\it \_C2}
$$
the nonhomogeneous part must have the form $$A\sin(2x)+B\cos(2x)$$
A: Taking a quick look at the right hand side of the equation, you can tell that the method to be used is that of Undetermined Coefficients.
The first steps in solving a differential equation of this type follows other methods we have solved so far, that is start by solving for the roots of the characteristic equation of the associated homogeneous solution. This goes as follows:
$$m^2 + 2m = 0$$
$$m(m+2) = 0$$
meaning that you have 2 distinct real roots.
$m_1 = 0$
$m_2 = -2$
$\implies y_h = c_1e^{0x} +c_2e^{-2x} =  c_1 + c_2e^{-2x} $
The second step is using the method of undetermined coefficient. By looking at the LHS of the equation, we can conjecture that the particular solution is of the form:
$y_p = A\sin(2x) + B\cos(2x)$
There are no duplicates in the homogeneous solution so no multiplicity, which means we can carry on.
$\implies$
$y_p' =2Acos(2x) -2Bsin(2x) $
$\implies$
$y_p'' =-4Asin(2x) -4Bcos(2x) $
Plug this in the equation to find A and B.
$$-4Asin(2x) -4Bcos(2x) +4Acos(2x) -4Bsin(2x) = 4sin(2x)$$
$$(-4A - 4B)sin(2x) + (-4B +4A)cos(2x) = 4 sin(2x)$$
This means that
\begin{cases} -4A -4B = 4 \\ -4B +4A = 0 \end{cases}
Thus $A = B = -\frac{1}{2}$
Finally since $y= y_p + y_h$ we get:
$$y = c_1 + c_2e^{-2x} -\frac{1}{2}[sin(2x) + cos(2x)]$$
A: i think it is easier to solve the equation for $y'.$ so let $u = y'.$ then $u$ satisfies $$u' + 2u = 4\sin 2x\tag 1$$ the homogeneous solution is $$u_h = -2ce^{-2x} $$ trying a particular solution of the form $$u = a\cos 2x + b \sin 2x, u' = -2a\sin 2x + 2b \cos 2x  \tag 2$$  subbing $(2)$ in $(1),$  we have $$(-2a+2b)\sin 2x + (2b +2a)\cos 2x=4 \sin 2x $$ so that we can set $$-2a + 2b = 4, 2a + 2b = 0\to b = 1, a = -1 $$ giving $$u_p = \sin 2x - \cos 2x $$
the general solution is $$ u = y' = -2ce^{-2x} + \sin 2x - \cos 2x \tag 3 $$
integrating $(3)$ gives $$y = ce^{-2x}-\frac12 \cos 2x -\frac12\sin 2x + d $$ where $c,d$  are arbitrary constants.
