Find the general solution of the differential equation $y^{''}-4y^{'}+5y=4e^{2x}\cos x$ I need help with differential equation $$y^{''}-4y^{'}+5y=4e^{2x}\cos{x}$$
I calculated homogeneous solution which I got $$y_{h} = C_{1}e^{2x}\cos{x}+C_{2}e^{2x}\sin{x}$$
I do not know how to set the particular solution.
Any help?
 A: You correctly obtained the homogeneous solution
$$y_{h}(x)=C_{1}e^{2x}\cos(x)+C_{2}e^{2x}\sin(x).$$
Since $4e^{2x}\cos x$ has the form $P_{n}(x)e^{\alpha x}\cos\beta x$ we try to find a particular solution of the form  $$x^{s}\left((A_{0}x^{n}+A_{1}x^{n-1}+\cdots+A_{0})e^{\alpha t}\cos\beta x)+(B_{0}x^{n}+B_{1}x^{n-1}+\cdots+B_{n})e^{\alpha x}\sin\beta x \right),$$ for $s\in \{0,1,2\}$ such that we ensure that no term in the particular solution is a solution of the corresponding homogeneous solution.
In particular we try with $$y_{p}(x)=x^{s}(Ae^{2x}\cos x+Be^{2x}\sin x).$$

*

*We can not take $s=0$, because that give $y_{p}(x)=Ae^{2x}\cos x+Be^{2x}\sin x$ and we already have these solutions (look at the homogeneous solution found).

*We try with $s=1$, so we have $y_{p}(x)=x(Ae^{2x}\cos x+Be^{2x}\sin x)$, this should work. We will see that it does indeed work.

$$y_{p}=Axe^{2x}\cos x+Bxe^{2x}\sin x$$
$$y_{p}'=Ae^{2x}\cos x+2Ae^{2x}x\cos x-Ae^{2x}x\sin x+Be^{2x}x\cos x+Be^{2x}\sin x+2Be^{2x}x\sin x$$
$$y_{p}''=-Ae^{2x}x\cos x+A\cos x(4e^{2x}+4e^{2x}x)-2A(e^{2x}+2e^{2x}x)\sin x+2B\cos x(e^{2x}+2e^{2x}x)-Be^{2x}x\sin x+B(4e^{2x}+4e^{2x}x)\sin x$$
Substitution in $y_{p}''-4y_{p}'+5y_{p}=4e^{2x}\cos x$ and symplify we get $$A=0,\quad B=2$$
So, the particular solution is given by
$$y_{p}(x)=2e^{2x}x\sin x$$
Therefore, general solution is given by
$$y(x)=y_{h}+y_{p}$$
$$\boxed{y(x)=C_{1}e^{2x}cos x+C_{2}e^{2x}\sin x+2e^{2x}x\sin x}$$
A: In general, for ODE of the form:
$$y^{(n)} + \sum\limits_{k=1}^{n} a_k y^{(n-k)} = A e^{\alpha x}$$
If $\alpha$ is a root of $\displaystyle\;t^n + \sum\limits_{k=1}^{n} a_k t^{n-k} = 0\;$ with multiplicity $m$, then the particular solutions can be chosen to have the form
$A' e^{\alpha x} x^m$ (or more generally, $e^{\alpha x} \times$ polynomial in $x$ with degree $m$).
For your case, $2\pm i$ are simple roots of $t^2-4t+5 = 0$, you can look for particular solutions among those of the form
$$x(B e^{(2+i)x} + B' e^{(2-i)x}) = x e^{2x}(C \cos x + C' \sin x)
$$
where $B,B',C,C'$ are constants.
By brute force, you can verify $2x e^{2x}\sin x$ is a particular solution you seek.
A: Assume that $C_1=C_1(x)$. Then plugging in your solutions, gives
$$
e^{2x} \left[ (C_1''+2C_2')\cos x +(C_2''-2C_1')\sin x  \right] 
=4 e^{2x} \cos(x)
$$
Now you have the system
$$
\begin{cases}
C_2''-2C_1'=0\\
C_1''+2C_2'=4
\end{cases}
$$
yielding $\frac12 C_2'''+2 C_2'=4$ i.e., $u''+4u=8$  where $u(x)=C_2'(x)$.
Hence we can find that $u(x)=A \cos(2x)+B\sin(2x)+2$,
$$
C_1=\cos(2x)+c',\ C_2=\sin(2x)+2x+c''
$$
where $c',c''$ are arbitrary constants.
A: $$y''-4y'+5y=4e^{2x}\cos x$$
$$(y''-4y'+4y)+y=4e^{2x}\cos x$$
$$(ye^{-2x})''+ye^{-2x}=4\cos x$$
$$v''+v=4\cos x$$
For the particular solution try:
$$v_p=Ax\sin x$$
