[Math] Find the general solution of $y” − 2y’ + 5y = e^x \cos(2x)$

ordinary differential equations

I've racked my head against this for hours. Finding the complementary solution (homogenous solution) is fairly simple and I got $y_c = e^x[ C_1\sin(2x)+ C_2\cos(2x) ].$

But I am stuck on finding the particular solution to complete the general solution.

I tried the undetermined coefficient approach but everything would keep cancelling out and I would get a 0 on one side.

Best Answer

$$y'' − 2y' + 5y = e^x \cos(2x)\implies (D^2-2D+5)y=e^x \cos(2x)\qquad \text{where}\quad D\equiv \frac{d}{dx}$$

For particular integral (P.I.),

P.I.$~=\frac{1}{D^2-2D+5}~e^x \cos(2x)$

$~~~~~~~= ~e^x~\frac{1}{(D+1)^2-2(D+1)+5}~\cos(2x)$

$~~~~~~~= ~e^x~\frac{1}{D^2+4}~\cos(2x)$

$~~~~~~~=~\frac{x}{4}~e^x~\sin(2x)$

So the general solution is $$y(x)= e^x[ C_1\sin(2x)+ C_2\cos(2x) ]~+~\frac{x}{4}~e^x~\sin(2x)\qquad \text{where}\quad C_1,~C_2~\text{are constants.}$$


Note$~ 1:$

For the Particular Integral (i.e., P.I.) there are some general rules

$1.$ $\frac{1}{D + a} \phi (x) = e^{-ax}\int e^{ax}\phi(x)$

$2.$ $\frac{1}{f(D)} e^{ax} \phi(x) = e^{ax}\frac{1}{f(D+a)} \phi(x)$

$3.$ $\frac{1}{f(D)} x^{n} \sin ax = $Imaginary part of $e^{iax}\frac{1}{f(D+ia)} x^n$

$4.$ $\frac{1}{f(D)} x^{n} \cos ax = $Real part of $e^{iax}\frac{1}{f(D+ia)} x^n$

$5.$ $\frac{1}{f(D)} x^{n} (\cos ax + i\sin ax) = \frac{1}{f(D)} x^n e^{iax}=e^{iax}\frac{1}{f(D+ia)} x^n$

Note$~ 2:$ For the Particular Integral (i.e., P.I.) of trigonometric functions you have to follow the following rules:

If $f(D)$ can be expressed as $\phi(D^2)$ and $\phi(-a^2)\neq 0$, then

$1.$ $\frac{1}{f(D)} \sin ax=\frac{1}{\phi(D^2)} \sin ax = \frac{1}{\phi(-a^2)} \sin ax$

$2.$ $\frac{1}{f(D)} \cos ax=\frac{1}{\phi(D^2)} \cos ax = \frac{1}{\phi(-a^2)} \cos ax$

Note: If $f(D)$ can be expressed as $\phi(D^2)=D^2+a^2$, then $\phi(-a^2)= 0$.

$1.$ $\frac{1}{f(D)} \sin ax =\frac{1}{\phi(D^2)} \sin ax=x\frac{1}{\phi'(D^2)} \sin ax= x \frac{1}{2D} \sin ax= -\frac{x}{2a} \cos ax$.

$2.$ $\frac{1}{f(D)} \cos ax =\frac{1}{\phi(D^2)} \cos ax=x\frac{1}{\phi'(D^2)} \cos ax= x \frac{1}{2D} \cos ax= \frac{x}{2a} \sin ax$.

where $\phi'(D^2)\equiv\frac{d}{dD}\phi(D^2)$