Respuesta :

Take the homogeneous part and find the roots to the characteristic equation:

[tex]y''+4y=0\implies r^2+4=0\implies r=\pm2i[/tex]

This means the characteristic solution is [tex]y_c=C_1\cos2x+C_2\sin2x[/tex].

Since the characteristic solution already contains both functions on the RHS of the ODE, you could try finding a solution via the method of undetermined coefficients of the form [tex]y_p=ax\cos2x+bx\sin2x[/tex]. Finding the second derivative involves quite a few applications of the product rule, so I'll resort to a different method via variation of parameters.

With [tex]y_1=\cos2x[/tex] and [tex]y_2=\sin2x[/tex], you're looking for a particular solution of the form [tex]y_p=u_1y_1+u_2y_2[/tex]. The functions [tex]u_i[/tex] satisfy

[tex]u_1=\displaystyle-\int\frac{y_2(\cos2x+\sin2x)}{W(y_1,y_2)}\,\mathrm dx[/tex]
[tex]u_2=\displaystyle\int\frac{y_1(\cos2x+\sin2x)}{W(y_1,y_2)}\,\mathrm dx[/tex]

where [tex]W(y_1,y_2)[/tex] is the Wronskian determinant of the two characteristic solutions.

[tex]W(\cos2x,\sin2x)=\begin{bmatrix}\cos2x&\sin2x\\-2\cos2x&2\sin2x\end{vmatrix}=2[/tex]

So you have

[tex]u_1=\displaystyle-\frac12\int(\sin2x(\cos2x+\sin2x))\,\mathrm dx[/tex]
[tex]u_1=-\dfrac x4+\dfrac18\cos^22x+\dfrac1{16}\sin4x[/tex]

[tex]u_2=\displaystyle\frac12\int(\cos2x(\cos2x+\sin2x))\,\mathrm dx[/tex]
[tex]u_2=\dfrac x4-\dfrac18\cos^22x+\dfrac1{16}\sin4x[/tex]

So you end up with a solution

[tex]u_1y_1+u_2y_2=\dfrac18\cos2x-\dfrac14x\cos2x+\dfrac14x\sin2x[/tex]

but since [tex]\cos2x[/tex] is already accounted for in the characteristic solution, the particular solution is then

[tex]y_p=-\dfrac14x\cos2x+\dfrac14x\sin2x[/tex]

so that the general solution is

[tex]y=C_1\cos2x+C_2\sin2x-\dfrac14x\cos2x+\dfrac14x\sin2x[/tex]