Particular solution to $y'' - 3y' + 2y = 2e^x$

Im trying to find the particular solution to: $$y'' - 3y' + 2y = 2e^x$$

I already have the homogenous solution so this is not my problem.

Assuming that $y_p = Ae^x \to {y'}_p = Ae^x \to {y''}_p = Ae^x$ we have:

$$Ae^x - 3Ae^x + 2Ae^x = 2e^x$$ $$0 \cdot Ae^x = 2e^x$$ $$0 = 2$$

Which is very bad. What am I doing wrong here?

-
$Ae^x$ is a solution to the homogenous equation, so it cannot be a particular solution. Try $Axe^x$... – N. S. Dec 21 '11 at 4:24
When should I use $Ae^x$ and when should I use $Axe^x$ for the particular solution? – Dimme Dec 21 '11 at 4:25
Usually, if you think a solution is logical, but you get 0, add an extra $x$. The idea is that when you differentiate this product, you get two terms each time: Whenever you don't differentiate $x$ you get exactly the previous relation, thus 0; whenever you differentiate $x$ you get new expressions involving only your guess function... If you still get $0$, add an extra $x$ (meaning $x^2$), same argument tells you that whatever contains $x,x^2$ should vanish.... – N. S. Dec 21 '11 at 4:35
Thanks that was very helpful. – Dimme Dec 21 '11 at 4:39
You might find these notes useful: math.ubc.ca/~israel/m215/undcoef/undcoef.html – Robert Israel Dec 21 '11 at 5:15

This is too long for a comment, so I posted it as an answer. First solve for the homogeneous equation $y'' - 3y' + 2y =0$ by setting the right hand side to be zero. The auxiliary equation is $m^2-3m+2=0$, which has roots $m=2,1$. Therefore the solution for this homogeneous equation is $e^x$ and $e^{2x}$. Now we want to find a particular solution $y'' - 3y' + 2y = 2e^x$. Normally we set the particular solution to be $Ae^{x}$. However, it duplicates with the solution of the homogeneous solution, therefore, we multiple it with $x$ until no duplication occurs. Therefore, the particular solution is given by $Axe^{x}$.

Let me do another example: to solve $y'' - 2y' + y = 2e^x$. First solve the homogenous equation $y'' - 2y' + y = 0$. The auxiliary equation is $m^2-2m+1=0$ which has double roots $m=1$. Therefore, the solution for this homogeneous equation is $e^x$ and $xe^{x}$. Now if we want to find a particular solution $y'' - 2y' + y = 2e^x$. Normally we set the particular solution to be $Ae^{x}$. However, it duplicates with the solution of the homogeneous solution, therefore, we multiple it with $x$ and it becomes $Axe^x$, but it still duplicates with $xe^{x}$. Therefore, we mupltiply it by $x^2$, and the particular solution is given by $Ax^2e^{x}$.

-

$y^{\prime \prime}−3y^{\prime}+2y= 2e^x$. Use operator D:

Let $D = d/dx$. So, $(D^2 - 3D + 2)y_p = 2e^x \quad \Rightarrow \quad (D-1)(D-2)y_p = 2e^x \quad \Rightarrow$

$y_p = \dfrac{1}{(D-1)(D-2)}\cdot 2e^x = 2e^x\dfrac{1}{(D+1-1)(D+1-2)}\cdot 1 = 2e^x\dfrac{1}{D(D-1)}\cdot 1 \quad \Rightarrow$

$y_p = 2e^x\dfrac{1}{D(0-1)\cdot 1} = -2e^x\dfrac{1}{D}\cdot 1 = -2xe^x$

-

The simplest thing in your case is probably to use this (easily justified) trick:

If $p(x)$ is a one variable polynomial with complex coefficients and $c$ a complex number, then the ODE $$p\left(\frac{d}{dx}\right)y=e^{cx}$$ has a solution of the form $e^{cx}\,q(x)$ where $q(x)$ is a polynomial whose degree is the number of roots of $p(x)$ equal to $c$.

In you case, $p(x)=(x-1)(x-2)$, $c=1$, so the trick tells you to look for a solution of the form $$(ax+b)\ e^x,$$ and you can clearly assume $b=0$.

-