Differential equation\higher order I need help solving this task, if anyone had a similar problem it would help me.
The task is: Find the general solution of the differential equation
$$ y''-y' - 2y=e^{2x} \cos^2 x$$
For homogeneous I get:
$$y_H=c_1e^{2x}+c_2e^{-x}$$
I have a problem with the particular, I tried:
$$y=(A\sin^2x+B\cos^2x)e^{2x}\\y'=(2A\sin x \cos x + 2B \sin x \cos x) e^{2x} +(A\sin^2 x + B \cos ^2 x) 2e^{2x}\\y''=2e^{2x}(2A \sin x  \cos x - 2B \sin x \cos x + A\sin^2 x +B \cos^2 x)$$
I have no idea if this is correct?
I don't know what's next from here ..
Thanks in advance !
 A: Your homogeneous solution is correct.
Note that $\cos^2(x)=\frac{1}{2}(1+\cos(2x))$, so the particular solution should be of the form $$y_{p}(x)=Axe^{2x}+Be^{2x}\cos(2x)+Ce^{2x}\sin(2x).$$
Substituting we find that $A=\frac{1}{6}$, $B=-\frac{1}{26}$ and $C=\frac{3}{52}$.

$$y'_p=2C\mathrm{e}^{2x}\sin\left(2x\right)-2B\mathrm{e}^{2x}\sin\left(2x\right)+2C\mathrm{e}^{2x}\cos\left(2x\right)+2B\mathrm{e}^{2x}\cos\left(2x\right)+2Ax\mathrm{e}^{2x}+A\mathrm{e}^{2x}$$
and $$y''_p=\mathrm{e}^{2x}\left(-2\left(2C+2B\right)\sin\left(2x\right)+2\left(2C-2B\right)\cos\left(2x\right)+2A\right)$$
$$+2\mathrm{e}^{2x}\left(\left(2C-2B\right)\sin\left(2x\right)+\left(2C+2B\right)\cos\left(2x\right)+2Ax+A\right)$$
So we have $$y''_p-y'_p-2y_p$$
$$=e^{2x}\big[\cos(2x)(4C-4B+4C+4B-2C-2B-2B)+\sin(2x)(-4C-4B+4C-4B-2C+2B-2C)+2A+4Ax+2A-2Ax-A-2Ax\big]$$
$$=e^{2x}\big[\cos(2x)(6C-4B)+\sin(2x)(-4C-6B)+3A\big]$$
$$=\frac{e^{2x}}{2}(1+\cos(2x)).$$
So we have $3A=\frac{1}{2}\implies A=\frac{1}{6}$, $6C-4B=\frac{1}{2}$ and $-4C-6B=0$ which give $C=\frac{3}{52}$ and $B=-\frac{1}{26}$.
A: We need to solve $$\text{ODE:}\quad \boxed{y''-y'-2y=e^{2x}\cos^{2}(x)}$$
The general solution will be the sum of complementary solution and particular solution, it's $$\text{solution general=solution complementary+particular solution}$$It's $$y(x)=y_{c}(x)+y_{p}(x)$$
Complementary solution: We need to solve $$y''-y'-2y=0$$Let $y=e^{rx}$, so we have $$(r^{2}-r-2)e^{rx}=0 \implies (r-2)(r-1)=0 \implies r=-1 \quad  \vee \quad r=2$$. So, we have the fundamental set solution $\{e^{-x},e^{2x}\}$. Therefore $$\boxed{y_{c}(x)=c_{1}e^{-x}+c_{2}e^{2x}}$$ where $c_{1},c_{2}$ are constants.
Particular solution: Using method of undetermined coefficients, so we have $$y''-y'-2y=e^{2x}\cos^{2}(x) \iff y''-y'-2y=\frac{e^{2x}}{2}+\frac{1}{2}e^{2x}\cos(2x)$$
The particular solution will be the sum of the particular solutions to $$y''-y'-2y=\frac{e^{2x}}{2}$$ and $$y''-y'-2y=\frac{1}{2}e^{2x}\cos(2x)$$
Now, the particular solution to $y''-y'-2y=\frac{e^{2x}}{2}$ is of the form $y_{p_{1}}(x)=x(a_{1}e^{2x})$ where $a_{1}e^{2x}$ was multiplied by $x$ to account for $e^{2x}$ in the complementary solution.
And, the particular solution to $y''-y'-2y=\frac{1}{2}e^{2x}\cos(2x)$ is of the form $y_{p_{2}}(x)=a_{2}e^{2x}\cos(2x)+a_{3}e^{2x}\sin(2x)$.
Now, sum $y_{p_{1}}$ and $y_{p_{2}}$ to obtain $y_{p}$, it's to say $$y_{p}(x)=a_{1}xe^{2x}+a_{2}e^{2x}\cos(2x)+a_{3}e^{2x}\sin(2x)$$
Solve for the unknown constants $a_{1},a_{2}$ and $a_{3}$ we have $$a_{1}=\frac{1}{6}, \quad a_{2}=-\frac{1}{26} \quad \text{and} \quad a_{3}=\frac{3}{52}$$
So, we have $$\boxed{y_{p}(x)=\frac{1}{6}xe^{2x}-\frac{1}{26}e^{2x}\cos(2x)+\frac{3}{52}
e^{2x}\sin(2x)}$$
Finally $$\color{blue}{\boxed{y(x)=c_{1}e^{-x}+c_{2}e^{2x}+\frac{1}{6}xe^{2x}-\frac{1}{26}e^{2x}\cos(2x)+\frac{3}{52}
e^{2x}\sin(2x)}}$$where $c_{1}$ and $c_{2}$ are constants.
A: Hint:
For the particular solution of $\;y''-y'-2y=\mathrm e^{2x}\cos^2x$, I would first linearise $\cos^2x$:
$$\mathrm e^{2x}\cos^2x=\frac12\mathrm e^{2x}(1+\cos 2x), $$
then apply the superposition principle, namely determine a particular solution for

*

*$y''-y'-2y=\mathrm e^{2x}$: as $2$ is a simple root of the characteristic equation, a particular  solution can be found in the form
$$y_0(x)=c_0x\mathrm e^{2x}$$
for  a suitable $c_0$.

*$y''-y'-2y=\mathrm e^{2x}\cos 2x=\operatorname{Re}\bigl(\mathrm e^{2(1+i)x}\bigr)$,
which is the real part of a particular solution when the r.h.s. is $\mathrm e^{2(1+i)x}$. As $2(1+i)$ is not a solution of the characteristic equation, this particular solution will have the form
$$y_1(x)=c_1\mathrm e^{2(1+i)x} $$
Note that a priori $c_1$ will be a complex number, so that you'll have to determine  the real part of $\:c_1\mathrm e^{2(1+i)x}$.

You'll easily find $c_0$ and $c_1$ by identification and deduce a particular solution for the original equation as
$$\frac12(y_0(x)+\operatorname{Re}\bigl(y_1(x)\bigr).$$
A: $$y''-y' - 2y=e^{2x} \cos^2 x$$
$$y''e^{-2x}-2y'e^{-2x} +y'e^{-2x}- 2ye^{-2x}=\cos^2 x$$
$$(y'e^{-2x})' +(ye^{-2x})'=\cos^2 x$$
$$(e^{-2x}(ye^{x})')'=\cos^2 x$$
$$(e^{-2x}(ye^{x})')'=\dfrac 12(\cos(2 x)+1)$$
Integrate both sides.
A: $$y''-y' - 2y=e^{2x} \cos^2 (x)$$ Since $r^2-r-2=(r+1)(r-2)$, let $y=e^{2x}\,z$ to make
$$z''+3z'=\cos^2 (x)=\frac 12+\frac 12 \cos(2 x)$$ Reduction of order $p=z'$ to obtain
$$p'+3p=\frac 12+\frac 12 \cos(2 x)$$ Make $p=q+\frac 16$
$$q'+3q=\frac 12 \cos(2 x)\implies q=c_1 e^{-3 x}+\frac{1}{26} (2 \sin (2 x)+3 \cos (2 x))$$
$$p=z'=\frac 16+c_1 e^{-3 x}+\frac{1}{26} (2 \sin (2 x)+3 \cos (2 x))$$
$$z=\frac 16 x +c_2 e^{-3 x}+\frac{1}{52} (3 \sin (2 x)-2 \cos (2 x))+c_3$$
$$y=e^{2x}\,z=\frac 16 xe^{2x}+c_2 e^{- x}+\frac{1}{52} (3 \sin (2 x)-2 \cos (2 x))e^{2x}+c_3e^{2x}$$ Make it simpler by factorization.
