# Solve the differential equation  (D^2+2D+5)y=xe^x  ?

Jul 11, 2017

$y = A {e}^{- x} \cos 2 x + B {e}^{- x} \sin 2 x + \frac{x {e}^{x}}{8} - {e}^{x} / 16$

#### Explanation:

We have:

$\left({D}^{2} + 2 D + 5\right) y = x {e}^{x}$

Where $D$ is the linear differential operator $\frac{d}{\mathrm{dx}}$. Thus we can write the equation as:

$\frac{{d}^{2} y}{{\mathrm{dx}}^{2}} + 2 \frac{\mathrm{dy}}{\mathrm{dx}} + 5 y = x {e}^{x}$ ..... [A]

This is a second order linear non-Homogeneous Differentiation Equation with constant coefficients. The standard approach is to find a solution, ${y}_{c}$ of the homogeneous equation by looking at the Auxiliary Equation, which is the quadratic equation with the coefficients of the derivatives, and then finding an independent particular solution, ${y}_{p}$ of the non-homogeneous equation.

Complimentary Function

The homogeneous equation associated with [A] is

$\frac{{d}^{2} y}{{\mathrm{dx}}^{2}} + 2 \frac{\mathrm{dy}}{\mathrm{dx}} + 5 y = 0$

And it's associated Auxiliary equation is:

${m}^{2} + 2 m + 5 = 0$

Which has two complex solutions $m = - 1 \pm 2 i$

Thus the solution of the homogeneous equation is:

${y}_{c} = {e}^{- 1 x} \left(A \cos 2 x + B \sin 2 x\right)$
$\setminus \setminus \setminus = A {e}^{- x} \cos 2 x + B {e}^{- x} \sin 2 x$

Particular Solution

In order to find a particular solution of the non-homogeneous equation we would look for a solution of the form:

$y = \left(a x + b\right) {e}^{x}$

Where the constants $a$ and $b$ are to be determined by direct substitution and comparison:

Differentiating wrt $x$ (using the product rule) we get:

$\frac{\mathrm{dy}}{\mathrm{dx}} = \left(a x + b\right) {e}^{x} + \left(a\right) {e}^{x}$
$\text{ } = \left(a x + a + b\right) {e}^{x}$

Differentiating again wrt $x$ (using the product rule) we get:

$\frac{{d}^{2} y}{{\mathrm{dx}}^{2}} = \left(a x + a + b\right) {e}^{x} + \left(a\right) {e}^{x}$
$\text{ } = \left(a x + 2 a + b\right) {e}^{x}$

Substituting into the DE [A] we get:

$\left(a x + 2 a + b\right) {e}^{x} + 2 \left(a x + a + b\right) {e}^{x} + 5 \left(a x + b\right) {e}^{x} = x {e}^{x}$

$\therefore \left(a x + 2 a + b\right) + 2 \left(a x + a + b\right) + 5 \left(a x + b\right) = x$

Equating coefficients of $x$ and constants we get

${x}^{1} : \left(2 a + b\right) + 2 \left(a + b\right) + 5 \left(b\right) = 0 \implies 4 a + 8 b = 0$
${x}^{0} : \left(a\right) + 2 \left(a\right) + 5 \left(a\right) = 1 \setminus \setminus \setminus \setminus \setminus \setminus \setminus \setminus \setminus \setminus \setminus \setminus \setminus \setminus \setminus \implies 8 a = 1$

Solving simultaneously, we have:

$a = \frac{1}{8}$
$\frac{1}{2} + 8 b = 0 \implies b = - \frac{1}{16}$

And so we form the Particular solution:

${y}_{p} = \left(\frac{1}{8} x - \frac{1}{6}\right) {e}^{x}$
$\setminus \setminus \setminus = \frac{x {e}^{x}}{8} - {e}^{x} / 16$

Which then leads to the GS of [A}

$y \left(x\right) = {y}_{c} + {y}_{p}$
$\setminus \setminus \setminus \setminus \setminus \setminus \setminus = A {e}^{- x} \cos 2 x + B {e}^{- x} \sin 2 x + \frac{x {e}^{x}}{8} - {e}^{x} / 16$