Solving $y''+4y=\sin(2x)$.

The homogenous equation is $y''+ 4y = 0$ has the characteristic equation $r^2+4=0$ which gives the roots $r_{1,2}=\pm2i.$ Thus, all the homogenous solutions are thus given by $y_h=C_1\cos(2x)+C_2\sin(2x)$

(Question.1) What would be the best way to proceed in order to find the particular solution $y_p?$ I know one could use the help-equation $$u'' + 4u = e^{i2x},$$

and finding a particular solution to it by setting $u(x)=z(x)e^{i2x},$ obtaining another differential equation in terms of $z(x),$ namely $z''+4z=1$ with particular solution $z_p=\frac{x}{4i}.$ This gives that $$u_p=\frac{e^{i2x}}{4i}=-i\frac{x}{4}(\cos2x+i\sin2x).$$

(Question.2) The book explains how to use $\text{Im}(u_p)$ in order to find $y_p$ but I don't understand why that method work. Can someone explain why one has to compare the real/imaginary component of $u_p?$

• To avoid of complex number topics, you can try with particular solution $Ax\sin2x+Bx\cos2x$. – Nosrati Nov 18 '17 at 10:58

for the second question:

when you are saying helping equation you need to understand what the helping equation is: $$u'' + 4u = e^{i2x}=\cos(2x)+i\sin(2x)\implies\Im(u'' + 4u) = \Im(e^{i2x})=\Im(\cos(2x)+i\sin(2x))=\sin(2x)=y''+4y$$

*the notation $\Im(z)$ is $\text{Im}(z)$

so from that it is clear that $\Im(u_p)=y_p$

for the first question the best way(in my opinion) to find $y_p$ is without using helping equation but like the following:

for $y_p$ let's assume that $y=a_1\sin(2x)+a_2\cos(2x)$, this is the form of the homogeneous ODE so we will multiply the assumption by $x$ and we will get $y=a_1x\sin(2x)+a_2x\cos(2x)$

now we get the equation $$y''+4y=\dfrac{d^2}{dx^2}\left(a_1x\sin(2x)+a_2x\cos(2x)\right)+4\left(a_1x\sin(2x)+a_2x\cos(2x)\right)=\sin(2x)$$ i will let you to simplify it but after you do you will get $$4a_1\cos(2x)-4a_2\sin(2x)=\sin(2x)\\\implies a_1=0,\,-4a_2=1\implies a_2=-\frac14\\\therefore y_p=-\frac14\cos(2x)$$

so the only thing left to do is to add $y_h$ and $y_p$

both my way and the way with the helping equation will give the same result. one last note: you said $u_p=\frac{e^{i2x}}{4i}=-i\frac{\color{RED}x}{4}(\cos2x+i\sin2x)$ and not $u_p=\frac{e^{i2x}}{4i}=-i\frac{1}{4}(\cos2x+i\sin2x).$

• Nice answer, thank you. But the form of the homogeneous ODE is $a_1\sin(2x)$, where $a_1=1$. Furthermore, you multiplied by $x$ because the coefficient for $y'=0$, right? – Parseval Nov 18 '17 at 13:09
• @Parseval the homogeneous ODE is $y''+ 4y = 0$ right? you solved this and you got $y_h=C_1\cos(2x)+C_2\sin(2x)$. now for $y''+ 4y =\sin(2x)$, the form is $ay''+by'+cy=g(x)$, for now $a,b,c$ doesnt matter. look at $g(x)$, when $g(x)=\sin(dx)$ your guess will be $a_1\sin(dx)+a_2\cos(dx)$ always! after taking that guess you go back and look at $y_h$, you see that the guess and $y_h$ are the same? if so i know that the guess i took will be equal to $0$ so i need to take a new guess, the new guess is the old guess times $x$ – ℋolo Nov 18 '17 at 13:22

In $$u''(t)+4u(t)=e^{i2t}$$ the imaginary part of the equation for $u(t)=x(t)+iy(t)$ completely separates $x$ and $y$ so that $$y''+4y=\sin(2t).$$ Now with $u(t)=z(t)e^{i2t}$ you get $u'=(z'+2iu)e^{i2t}$ and $u''=(z''+4iz'-4z)e^{i2t}$ thus $$u''+4u=(z''+4iz')e^{i2t}\implies z''+4iz'=1\implies z'+4iz=t+c$$ I do not see where your equation and then solution for $z$ comes from.

Here's another way to solve the equation.

The equation can be written $(D+2i)(D-2i)y = \sin(2x)$ where $D$ is differentiation. To keep the following calculations cleaner we set $u=(D-2i)y$ so the equation reads $$(D+2i)u = \sin(2x).$$

After multiplication with the integrating factor $e^{2ix}$ we can write the equation as $$D(e^{2ix}u) = e^{2ix}\sin(2x) = e^{2ix} \, \frac{e^{2ix}-e^{-2ix}}{2i} = \frac{e^{4ix}-1}{2i}.$$

Thus, $$e^{2ix} u = \frac{\frac{1}{4i} e^{4ix} -x}{2i} + A,$$ where $A$ is some constant.

Now we multiply with $e^{-2ix}$ and get $$u = \frac{\frac{1}{4i} e^{2ix} -x e^{-2ix}}{2i} + A e^{-2ix}.$$

Reversing the substitution gives $$(D-2i)y = \frac{\frac{1}{4i} e^{2ix} -x e^{-2ix}}{2i} + A e^{-2ix}$$ which after multiplication with $e^{-2ix}$ can be written $$D(e^{-2ix} y) = \frac{\frac{1}{4i} -x e^{-4ix}}{2i} + A e^{-4ix} = -\frac18 - \frac{1}{2i}xe^{-4ix} + A e^{-4ix}.$$

Taking the antiderivative results in $$e^{-2ix}y = -\frac18 x - \frac{1}{2i} \left( -\frac{1}{4i} x e^{-4ix} - \frac{1}{(-4i)^2} e^{-4ix} \right) + \frac{1}{-4i} A e^{-4ix} + B$$ so $$y = -\frac18 x e^{2ix} - \frac{1}{2i} \left( -\frac{1}{4i} x e^{-2ix} - \frac{1}{(-4i)^2} e^{-2ix} \right) + \frac{1}{-4i} A e^{-2ix} + B e^{2ix} \\ = -\frac18 x (e^{2ix} + e^{-2ix}) + B e^{2ix} + C e^{-2ix} \\ = -\frac14 x \cos(2x) + B e^{2ix} + C e^{-2ix},$$ where $C = -\frac{1}{4i}A - \frac{1}{32i}.$