Solve $y’’ – 4y’ + 5y = 4e^{2x}\sin(x)$ using $\mathcal D$ operator Hello – I am working through the following question and get stuck at step 6. Could someone please advise in simple terms which I can hopefully understand. Thanks
$$y'' – 4y' + 5y = 4e^{2x}\sin(x)$$
Step one – Order equation so that differential operator is in front of the RHS of the equation
$\newcommand{\D}{\mathcal D}$
$$1 = \frac 1 {\D^2 – 4\D + 5}  \cdot 4e^{2x}\sin(x)$$
Step two – move constant and exponential in front of the $\D$ operator
$$1 = 4e^{2x}\cdot \frac 1 {\D^2 – 4\D + 5}\cdot \sin(x)$$
Step three – calculate $a$
Because of $e^{2x}$, $a = 2$, and because of $\sin(x)$, $a = 2 + i$.
Step four – insert $a$ into the $\D$ operator and then calculate to see if it equals zero
\begin{align}
1 &= 4e^{2x}\cdot \frac 1 {(2+i)^2 – 4(2+i) + 5}\cdot \sin(x)
\\
&= 4e^{2x}\cdot \frac 1 {(4+4i+4-8-4i+5)}\cdot\sin(x)
\\
&= 4e^{2x}\cdot \frac 1 {(0)}\cdot \sin(x)
\end{align}
Step 5 – because there is a zero, note $a = 2$ therefore make it $\D+2$
\begin{align}
1 &= 4e^{2x}\cdot \frac 1 {(\D + 2)^2 – 4(\D + 2) + 5}\cdot \sin(x)
\\
&= 4e^{2x}\cdot\frac 1 {\D^2 + 1}\cdot\sin(x)
\end{align}
What do I do for step 6? Please explain in simply terms and assume my calculus knowledge is low.
 A: $e^{ix}=\cos(x)+i\sin(x)$
$\sin(x)= Im(e^{ix})$
$$
{1 \over D^2 + 1} \ \sin x = {1 \over D^2 + 1} \ \ Im(e^{ix})=Im{1 \over D^2 + 1} \ \ e^{ix}=Im{1 \over 2D} \ \ xe^{ix} =x Im{1 \over 2i} \ \ e^{ix}=x Im{1 \over 2i} \ \ (\cos(x)+i\sin(x))=\frac{x}{2} Im\ \ (-i\cos(x)+\sin(x))
= \left[ -{x \over 2} \cos x \right]
$$
A: For simplicity, we denote the particular solution as $y_p(t)$.
Then
$$
y_p(t) = {1 \over D^2 - 4 D + 5} \left( 4 e^{2 x} \sin x \right) =
4 {1 \over D^2 - 4 D + 5} \left( e^{2 x} \sin x \right) 
$$
Thus, we have
$$
y_p(t) = 4 e^{2 x} {1 \over (D + 2)^2 - 4 (D + 2) + 5} \ \sin x
= 4 e^{2 x} {1 \over (D^2 + 4 D + 4) - (4 D + 8) + 5} \ \sin x
$$
Simplifying, we get
$$
y_p(t) = 4 e^{2 x} {1 \over D^2 + 1} \ \sin x = 
4 e^{2 x} \left[ -{x \over 2} \cos x \right]
$$
(Using the standard formulas)
Hence,
$$
\boxed{y_p(t) = - 2 x e^{2 x} \ \cos x}
$$
Finally, I have added a reference for the general formula
$$
y_p(t) = - {x \over 2 a} \ \cos(a x)
$$
for a particular integral of $(D^2 + a^2) y = \sin(a x)$.
Proof for the Particular Integral of $(D^2 + a^2) y = \sin(a x)$ 
A: Your step 2 is wrong. You correct this error in the following steps, but do not seem to see the connection. If $p(D)$ is some polynomial or rational expression you get from $D(e^{ax}u(x))=e^{ax}(au(x)+Du(x)$ that
$$
p(D)(e^{ax}u(x))=e^{ax}p(D+a)u(x).
$$
So already in switching the exponential to the outside you get
$$
\frac{1}{D^2-4D+5}e^{2x}\sin x
=e^{2x}\frac{1}{(D+2)^2-4(D+2)+5}\sin x
=e^{2x}\frac{1}{D^2+1}\sin x.
$$

To continue you could replace $\sin x$ with $\sin ax$ and then compute the limit for $a\to 1$,
$$
\frac{1}{D^2+1}\sin(ax)=\frac1{1-a^2}\sin(ax)+\text{ homogeneous solution}
$$
To make a finite limit possible, use a compensating sine term and apply the mean value theorem
$$
\frac{\sin(ax)-a\sin(x)}{1-a^2}=\frac{x\cos(a_1x)-\sin(x)}{-2a_1}\xrightarrow{1<a_1<a\to 1}
\frac{-x\cos(x)+\sin(x)}{2}
$$

As the second term is again part of the homogeneous solution, the particular solution of the equation can be taken as $y_p(x)=-2x\cos(x)$.
A: I don't think this should be much of a problem. So we want to solve the Differential equation,
$$ y'' - 4y' + 5 y = 4e^{2x} \sin x $$
Note that the Complimentary function is,
$$ C.F = e^{2x} [ c_1 \cos x + c_2 \sin x] $$
The particular integral is,
$$ P.I = 4 \frac{1}{D^2 -4D + 5} \ [e^{2x} \sin x ] $$
Now using the complex definition of sine function and a bit of simplification we have,
$$ P.I = \frac{2x}{i} \left [ \frac{1}{2D-4} e^{(2+i)x}  - \frac{1}{2D-4} e^{(2-i)x}  \right ] $$
Further simplification leads to,
$$ C.F = -2 x e^{2x} \cos x $$
Combining these two we have,
$$ \boxed{\boxed{y =e^{2x} [ c_1 \cos x + c_2 \sin x] -2 x e^{2x} \cos x  }} $$
A: If you note that $4e^{2x} \sin x$ is a solution of the homogeneous equation, you see that the original equation
$$
((D-2)^2+1) y = 4 e^{2x} \sin x
$$
can be "multiplied" by the operator $(D-2)^2+1$, yielding the homogeneous equation
$$
((D-2)^2+1)^2 y = 0,
$$
whose general solution is given by
$$
y = e^{2x}\left[(a_1 x+b_1)\cos x + (a_2 x + b_2)\sin x  \right]
$$
If you separate the general solution of the original homogeneous equation,
$$
y = e^{2x}\left[b_1 \cos x + b_2 \sin x \right] + x e^{2x}[a_1 \cos x + a_2 \sin x]
$$
This way you see the the constants $a_1, a_2$ must be computed so that $x e^{2x}[a_1 \cos x + a_2 \sin x]$ is a particular solution of the original equation, which gives $2a_2 = 0$ and $-2a_1 = 4$.
