# solving Second order non - homogeneous Differential Equation

#### ssh

##### New member
How to solve $$(x+1) y'' - (2x+5) y' + 2y = (x+1) e^x$$

can we assume $$y_1 = (Ax+B) e^x$$,
then $$y_2= vy_1​$$ Is this right? then solve for A and B
Finally $$y = c_1 y_1 + c_2 y_2$$

#### tkhunny

##### Well-known member
MHB Math Helper
Are you sure you don't want to include x^2 or x^3?

#### chisigma

##### Well-known member
How to solve $$(x+1) y'' - (2x+5) y' + 2y = (x+1) e^x$$

can we assume $$y_1 = (Ax+B) e^x$$,
then $$y_2= vy_1​$$ Is this right? then solve for A and B
Finally $$y = c_1 y_1 + c_2 y_2$$
The solving procedure is the same used in...

http://www.mathhelpboards.com/f17/h...econd-order-linear-variable-coefficient-2089/

First You have to find the general solution of the incomplete equation...

$\displaystyle (x+1)\ y^{\ ''} - (2\ x + 5)\ y^{\ '} +2\ y=0$ (1)

... which has the form...

$\displaystyle y(x)= c_{1}\ u(x) + c_{2}\ v(x)$ (2)

If $u(x)$ and $v(x)$ are solutions of (1) then...

$\displaystyle (x+1)\ u^{\ ''} - (2\ x + 5)\ u^{\ '} +2\ u=0$

$\displaystyle (x+1)\ v^{\ ''} - (2\ x + 5)\ v^{\ '} +2\ v=0$ (3)

Multiplying the first of (3) by v and the second by u and do the difference we obtain...

$\displaystyle (x+1)\ (v\ u^{\ ''}-u\ v^{\ ''}) - (2\ x + 5)\ (v\ u^{\ '} -u\ v^{\ '})=0$ (4)

Now we set $\displaystyle z= v\ u^{\ '} -u\ v^{\ '}$ so that (4) becomes...

$\displaystyle z^{\ '}= \frac{2\ x+5}{x+1}$ (5)

The (5) is a first order ODE one solution of which is...

$\displaystyle z= 2\ x + 3\ \ln (x+1)$ (6)

... so that is...

$\displaystyle \frac{d}{d x} (\frac{u}{v})= \frac{z}{v^{2}} = \frac{2\ x + 3\ \ln (x+1) + c_{2}}{v^{2}} \implies u= v\ \int \frac{2\ x + 3\ \ln (x+1) }{v^{2}}\ dx$ (7)

Now it is easy enough to see that $\displaystyle v= x+ \frac{5}{2}$ is solution of (1) so that from (7) we derive that...

$\displaystyle u= \ln (2\ x +5) + 2\ (x+1)\ \ln (x+1) + (2\ x+5)\ \ln (2\ x +5)$ (8)

... and the general solution of (1) is...

$\displaystyle y(x)= c_{1}\ (2\ x+5) + c_{2}\ \{(x+1)\ \ln (x+1) + (x+3)\ \ln (2\ x +5)\}$ (9)

... and the first part is completed. Now You have to search a particular solution of the complete equation...

$\displaystyle (x+1)\ y^{\ ''} - (2\ x + 5)\ y^{\ '} +2\ y= (x+1)\ e^{x}$ (10)

Kind regards

$\chi$ $\sigma$

Last edited: