[Math] Solving the differential equation $y” + y = 8\cos(x) \cos(2x)$

ordinary differential equations

I'm solving the differential equation $y'' + y = 8\cos(x) \cos(2x)$

I started to find the homogeneous solution:

We search the zeros of the associated polynomial:

$$r^2 + 1 = 0$$

This yields $r = i$ or $r = -i$

Hence, the homogeneous solution is:

$$y_h = e^0(c_1\cos(x) + c_2\sin(x)) + e^0(c_3\cos(-x) + c_4\sin(-x))$$

And by rewriting this, we find:

$$y_h = c_1\cos(x) + c_2\sin(x)$$

I have trouble making a suggestion for the particular solution. I would suggest something like:

$$y_p = (A\cos(x) + B\sin(x))(C\cos(2x) + D\sin(2x))$$

but the answer my book gives is :

$$y = x_1\cos(x) + (c_2 + 2x)\sin(x) – 1/2\cos(3x)$$

Where does the $\cos(3x)$ come from? This makes me wonder my suggestion won't work.

Any help will be appreciated.

Best Answer

I see that you were trying to approach this using the method of undetermined coefficients, therefore I decided to write an answer on this too:


Using one of the Prosthaphaeresis formulas: $$\cos{a}\cos{b}\equiv \frac{\cos(a-b)+\cos(a+b)}{2}$$ Letting $a=x$ and $b=2x$, we have: $$\begin{align}\cos(x)\cos(2x)&\equiv \frac{\cos(x-2x)+\cos(x+2x)}{2} \\ &\equiv \frac{\cos(-x)+\cos(3x)}{2} \\ &\equiv \frac{\cos{x}+\cos(3x)}{2} \end{align}$$ Hence, our differential equation can be written as: $$y''+y=4\cos{x}+4\cos(3x) \tag{1}$$


This is of help, because the particular solution will be the sum of the particular solution to $y''+y=4\cos{x}$, and $y''+y=4\cos(3x)$. For the first one, use the ansatz: $$y_{p_1}(x)=x(A\cos{x}+B\sin{x})$$ Note that it was multiplied by $x$ because $\cos{x}$ and $\sin{x}$ are already in the complementary solution. For the second one, use the ansatz: $$y_{p_2}(x)=C\cos(3x)+D\sin(3x)$$ Therefore giving: $$y_p(x)=y_{p_1}(x)+y_{p_2}(x)=Ax\cos{x}+Bx\sin{x}+C\cos(3x)+D\sin(3x) \tag{2}$$ You can evaluate $A,B,C$ and $D$ by substituting $y_p(x)$ into the differential equation and then equating coefficients.

Related Question