# Another second order non homogeneous ODE...

#### chisigma

##### Well-known member
Four days ago on mathhelpforum.com the user ssh [I don’t know if he the same as in MHB…] has proposed the following second order complete linear ODE…

$\displaystyle y^{\ ''} – \frac{2+x}{x}\ y^{\ ’}\ + \frac{2+x}{x^{2}}\ y = x\ e^{x}$ (1)

… and till now no satisfactory solution has been supplied. Well!... now we have the opportunity to test the procedure described in…

http://www.mathhelpboards.com/f17/h...-linear-variable-coefficient-2089/index2.html

The first step is to find the general solution of the incomplete ODE...

$\displaystyle y^{\ ''} – \frac{2+x}{x}\ y^{\ ’}\ + \frac{2+x}{x^{2}}\ y = 0$ (2)

If u and v are two independent solution of (2) then we arrive to write...

$\displaystyle (v\ u^{\ ''} - u\ v^{\ ''}) = \frac{2+x}{x}\ (v\ u^{\ '} - u\ v^{\ '})$ (3)

... and setting $z= v\ u^{\ '} - u\ v^{\ '}$ we obtain the first order ODE...

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

... one solution of which is $\displaystyle z=x^{2}\ e^{x}$, so that is...

$\displaystyle \frac{z}{v^{2}} = \frac{d}{d x} (\frac{u}{v}) = \frac{x^{2}\ e^{x}}{v^{2}} \implies u= v\ \int \frac{x^{2}\ e^{x}}{v^{2}}\ dx$ (5)

It is easy enough to see that $v=x$ is solution of (2) so that…

$\displaystyle u= x\ \int e^{x}\ dx = x\ e^{x}$ (6)

Now that we have u and v we have to find the particular solution of (1) in the form...

$\displaystyle Y= C_{1}(x)\ u + C_{2} (x)\ v$ (7)

... where...

$\displaystyle C_{1}(x) = - \int \frac{ v\ \varphi(x)}{W_{u,v}(x)}\ dx$

$\displaystyle C_{2}(x) = \int \frac{ u\ \varphi(x)}{W_{u,v}(x)}\ dx$ (8)

The Wronskian is computed as $\displaystyle W_{u,v} (x)= u\ v^{\ '}-v\ u^{\ '} = - x^{2}\ e^{x}$ and is $\displaystyle \varphi(x)= x\ e^{x}$ so that we obtain...

$\displaystyle C_{1}(x)= \int dx = x$

$\displaystyle C_{2}(x)= - \int \frac{d x}{x}= \ln \frac{1}{|x|}$ (9)

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

$\displaystyle y(x)= c_{1}\ x\ e^{x} + c_{2}\ x + x^{2}\ e^{x} + x\ \ln \frac{1}{|x|}$ (10)

Kind regards

$\chi$ $\sigma$

#### chisigma

##### Well-known member
For completeness sake now we describe the general solving procedure of an ODE of the type...

$\displaystyle y^{\ ''} + p(x)\ y^{\ ’}\ + q(x)\ y = \varphi(x)$ (1)

The first step is to find the general solution of the incomplete ODE...

$\displaystyle y^{\ ''} + p(x)\ y^{\ ’}\ + q(x)\ y = 0$ (2)

... which can be written as...

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

... where u(*) and v(*) are two independent solutions of (2), $c_{1}$ and $c_{2}$ are constants. If u and v are both solution of (2) then ...

$\displaystyle u^{\ ''} + p(x)\ u^{\ ’}\ + q(x)\ u = 0$

$\displaystyle v^{\ ''} + p(x)\ v^{\ ’}\ + q(x)\ v = 0$ (4)

Multiplying the first of the (4) by v, the second by u and subtracting is...

$\displaystyle (v\ u^{\ ''} - u\ v^{\ ''}) = - p(x)\ (v\ u^{\ '} - u\ v^{\ '})$ (5)

... and setting $z= v\ u^{\ '} - u\ v^{\ '}$ we obtain the first order ODE...

$\displaystyle z^{\ '}= - p(x)\ z$ (6)

... one solution of which is $\displaystyle z = e^{- \int p(x)\ dx}$, so that is...

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

... and the (7) allows to obtain, if we are able to find a solution v of (2), another solution u independent from it.

Now that we have u and v we have to find the particular solution of (1) in the form...

$\displaystyle Y= C_{1}(x)\ u + C_{2} (x)\ v$ (8)

... where...

$\displaystyle C_{1}(x) = - \int \frac{ v\ \varphi(x)}{W_{u,v}(x)}\ dx$

$\displaystyle C_{2}(x) = \int \frac{ u\ \varphi(x)}{W_{u,v}(x)}\ dx$ (9)

... the Wronskian of u and v being...

$\displaystyle W_{u,v} (x)= u\ v^{\ '}-v\ u^{\ '}$ (9)

The general solution of (1) is...

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

The procedure we have described permits a comfortable solution of an ODE like (1). The only 'weak point' is that it can start only if a particular solution of the incomplete ODE is known and that sometime can be an hard task...

Kind regards

$\chi$ $\sigma$

#### chisigma

##### Well-known member
An interesting example of second order linear incomplete ODE can be found in mathhelpforum.com...

series solution!

The ODE is...

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

... and for that a 'series solution' is explicity required. Applying the procedure we have described in previous post we arrive at the first order ODE...

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

... one solution of which is...

$\displaystyle z= \frac{e^{-x}}{x}$ (3)

... so that if u and v are two independent solutions of (1) then is...

$\displaystyle u= v\ \int \frac{e^{-x}}{x\ v^{2}}\ dx$ (4)

Now $v= \frac{e^{-x}}{x}$ is solution of (1) so that we obtain...

$\displaystyle u= \frac{e^{-x}}{x}\ \int x\ e^{x}\ dx = \frac{x-1}{x}$ (5)

... so that the general solution of (1) is...

$\displaystyle y(x)=c_{1}\ \frac{x-1}{x} + c_{2}\ \frac{e^{-x}}{x}$ (6)

Observing (6) it is obvious that any non zero solution of (1) has a singularity in x=0 and therefore the standard Mc Laurin series solution attempt necessarly fails...

Kind regards

$\chi$ $\sigma$

#### chisigma

##### Well-known member
... so that the general solution of (1) is...

$\displaystyle y(x)=c_{1}\ \frac{x-1}{x} + c_{2}\ \frac{e^{-x}}{x}$ (6)

Observing (6) it is obvious that any non zero solution of (1) has a singularity in x=0 and therefore the standard Mc Laurin series solution attempt necessarly fails...
Of course that is not fully true, because in the particular case $\displaystyle c_{2}=c_{1}=c$ the series solution do exist and is...

$\displaystyle y(x)= c\ \sum_{n=1}^{\infty} (-1)^{n+1}\ \frac{x^{n}}{(n+1)!}$

In this case however is $y(0)=0$ and You can only impose a value to $y^{\ '}(0)$...

Kind regards

$\chi$ $\sigma$

Last edited: