# Particular solution of this second order differential equation

I am a bit stuck on the following second order differential equation, using the method of undertermined coefficients. $$y'' + 3y' + 2y = xe^{-x}$$

The homogenous solution is easy to find, but I run into some issues with the particular solution. $$y = Axe^{-x}$$ doesn't seem to be a good enough guess, but I am not sure why? Since it doesn't appear in the homogenous solution I thought it would be independent from it. What is a better particular solution to get started with this?

Using the substitution $$u=y'+2y$$, so $$u'=y''+2y'$$, the equation becomes $$u'+u=x\mathrm{e}^{-x}$$ Using the integrating factor method this becomes $$u'\mathrm{e}^x+u\mathrm{e}^x=\frac{\mathrm{d}}{\mathrm{d}x}\left(u\mathrm{e}^x\right)=x\\u\mathrm{e}^x=\frac12x^2+A\\u=y'+2y=\left(\frac12x^2+A\right)\mathrm{e}^{-x}$$Using the integrating factor method again this becomes $$y'\mathrm{e}^{2x}+2y\mathrm{e}^{2x}=\frac{\mathrm{d}}{\mathrm{d}x}\left(y\mathrm{e}^{2x}\right)=\left(\frac12x^2+A\right)\mathrm{e}^{x}\\y\mathrm{e}^{2x}=\left(\frac12x^2-x+B\right)\mathrm{e}^x+C\\\boxed{y= \left(\frac12x^2-x+B\right)\mathrm{e}^{-x}+C\mathrm{e}^{-2x}}$$Note that $$x^2\mathrm{e}^{-x}$$ is used as well as $$x\mathrm{e}^{-x}$$.

The idea is $$e^{-x}$$ is a homogeneous solution of the ODE. So if you purely let $$y=Axe^{-x}$$, then you can see the function with top degree of $$y''+3y'+2y$$ will vanish itself because the top degree term is just simply keep differentiating $$e^{-x}$$ (by product rule) (Top degree here means terms with $$xe^{-x}$$)

So you should increase the degree of your guess by one to prevent this, i.e. $$y=Ax^2e^{-x}+Bxe^{-x}$$. This is generally true for any $$x^me^{-x}$$, as long as $$e^{-x}$$ is a homogeneous solution on any order of ODE.

• Because $Ax^2e^{-x}$ will give terms with $ke^{-x}$ on its second derivative, but no one in $y$ and $y'$ can eliminate this guy, so we need some help, from the lower degree one. Apr 22 at 16:32

This 2nd order ODE equation $$y'' + 3y' + 2y = xe^{-x}$$ can be rewritten as

$$(D^2+3D+2)y_p=(D+1)(D+2)y_p=xe^{-x}$$ which can be solved by

\begin{align} y_p&=\frac{1}{(D+1)(D+2)}xe^{-x}\\ &=\left(\frac{1}{D+1}-\frac{1}{D+2}\right)xe^{-x}\\ &=e^{-x}D^{-1}x-e^{-x}(1-\color{red}{D})x\\ &=e^{-x}\left(\frac{x^2}{2}-x+1\right) \end{align} where $$D^{-1}$$ stands for integration. Note that the last term $$e^{-x}Dx=e^{-x}$$ is actually redundant as a particular solution since it is already included in the homogeneous solution $$y_h=c_1e^{-x}+c_2e^{-2x}$$, but the operator produced one by-product through integration (actually convolution).

For the operator approach to solve a general inhomogenous ODE in any order, the answer (2nd order example) to this post might be useful General Solution of $y''+4y=\frac{3}{\sin(2t)}$.

$$y'' + 3y' + 2y = xe^{-x}$$

$$y=z\,e^{-x} \quad \implies \quad z''+z'=x$$

Reduction of order makes now things simple.