# Find the general solution of y''-2y'+2y=xe^x cosx

Find the general solution of $y{}^{″}-2{y}^{\prime }+2y=x{e}^{x}\mathrm{cos}x$
You can still ask an expert for help

• Questions are typically answered in as fast as 30 minutes

Solve your problem for the price of one coffee

• Math expert for every subject
• Pay only if we can solve it

Aniqa O'Neill
$y{}^{″}-2{y}^{\prime }+2y=x{e}^{x}\mathrm{cos}\left(x\right).$
Let $s=\mathrm{sin}\left(x\right),c=\mathrm{cos}\left(x\right)$, s'=c, c'=-s, then:
$y{}^{″}-2{y}^{\prime }+2y=x{e}^{x}c$.
First solve the homogeneous equation: $y{}^{″}-2{y}^{\prime }+2y=0.$
The characteristic equation is ${r}^{2}-2r+2=0=\left(r-1+i\right)\left(r-1-i\right).$
So $y=A{e}^{\left(1+i\right)x}+B{e}^{\left(1-i\right)x}$, which can be written:
$y={e}^{x}\left(A{e}^{ix}+B{e}^{-ix}\right),$ where A and B are constants.
Use Euler’s expansion:
$y={e}^{x}\left(A\mathrm{cos}\left(x\right)+Ai\mathrm{sin}\left(x\right)+B\mathrm{cos}\left(x\right)-Bi\mathrm{sin}\left(x\right)\right),$
$y={e}^{x}\left(\left(A+B\right)\mathrm{cos}\left(x\right)+i\left(A-B\right)\mathrm{sin}\left(x\right)\right).$
Let C=A+B and D=A-B, then:
$y={e}^{x}\left(C\mathrm{cos}\left(x\right)+D\mathrm{sin}\left(x\right)\right).$
Call this general solution ${y}_{1}={e}^{x}\left(C\mathrm{cos}\left(x\right)+D\mathrm{sin}\left(x\right)\right)={e}^{x}\left(Cc+Ds\right)$
Now we have to deal with xeˣc, the particular solution, which will give us y₂, such that the entire solution is $y={y}_{1}+{y}_{2}$.
We guess the solution, where P, Q, R and S are constants:
Let $u=\left(Px+Q\right)s+\left(Rx+S\right)c$ and apply the tentative solution ${y}_{2}=x{e}^{x}u$:
${u}^{\prime }=\left(Px+Q\right)c+Ps-\left(Rx+S\right)s+Rc,$
$u{}^{″}=-\left(Px+Q\right)s+2Pc-\left(Rx+S\right)c-2Rs,$
${y}_{2}^{\prime }=x{e}^{x}{u}^{\prime }+u{e}^{x}\left(x+1\right),$