HOME
PDF (letter size)
PDF (legal size)

## Solving special form of second order ODE with varying coeﬃcients

August 6, 2020   Compiled on August 6, 2020 at 5:42am

Given ode of the form$$\frac{d^{2}y\left ( x\right ) }{dx^{2}}+p\left ( x\right ) \frac{dy\left ( x\right ) }{dx}+q\left ( x\right ) y\left ( x\right ) =0 \tag{1}$$ It is possible to solve this directly under special condition which is given below by transforming the ODE into one with constant coeﬃcients.

The ﬁrst step is to apply transformation on the independent variable. Let \begin{align*} t & =u\left ( x\right ) \\ & =\int \sqrt{q\left ( x\right ) }dx \end{align*}

Where $$t$$ is the new independent variable. Hence\begin{align*} \frac{dy}{dx} & =\frac{dy}{dt}\frac{dt}{dx}\\ \frac{d^{2}y}{dx^{2}} & =\frac{d^{2}y}{dt^{2}}\left ( \frac{dt}{dx}\right ) ^{2}+\frac{dy}{dt}\frac{d^{2}t}{dx^{2}} \end{align*}

Substituting these back into (1) gives\begin{align*} \left ( \frac{d^{2}y}{dt^{2}}\left ( \frac{dt}{dx}\right ) ^{2}+\frac{dy}{dt}\frac{d^{2}t}{dx^{2}}\right ) +p\left ( x\right ) \left ( \frac{dy}{dt}\frac{dt}{dx}\right ) +q\left ( x\right ) y\left ( t\right ) & =0\\ \frac{d^{2}y}{dt^{2}}\left ( \frac{dt}{dx}\right ) ^{2}+\frac{dy}{dt}\left ( \frac{d^{2}t}{dx^{2}}+p\left ( x\right ) \frac{dt}{dx}\right ) +q\left ( x\right ) y\left ( t\right ) & =0 \end{align*}

But since we assumed that $$t=\int \sqrt{q\left ( x\right ) }dx$$, then $$\frac{dt}{dx}=\sqrt{q\left ( x\right ) }$$ and $$\frac{d^{2}t}{dx^{2}}=\frac{q^{\prime }\left ( x\right ) }{2\sqrt{q\left ( x\right ) }}$$. The above becomes$\frac{d^{2}y}{dt^{2}}q\left ( x\right ) +\frac{dy}{dt}\left ( \frac{q^{\prime }\left ( x\right ) }{2\sqrt{q\left ( x\right ) }}+p\left ( x\right ) \sqrt{q\left ( x\right ) }\right ) +q\left ( x\right ) y\left ( t\right ) =0$ Dividing by $$q\left ( x\right )$$, and assuming $$q\left ( x\right ) \neq 0$$ in the domain $$x$$, the above becomes\begin{align} \frac{d^{2}y}{dt^{2}}+\frac{dy}{dt}\left ( \frac{q^{\prime }\left ( x\right ) }{2\left ( q\left ( x\right ) \right ) ^{\frac{3}{2}}}+\frac{p\left ( x\right ) }{\sqrt{q\left ( x\right ) }}\right ) +y\left ( t\right ) & =0\nonumber \\ \frac{d^{2}y}{dt^{2}}+\frac{dy}{dt}\left ( \frac{q^{\prime }\left ( x\right ) +2q\left ( x\right ) p\left ( x\right ) }{2\left ( q\left ( x\right ) \right ) ^{\frac{3}{2}}}\right ) +y\left ( t\right ) & =0 \tag{2} \end{align}

Now, if it happens that $$\frac{q^{\prime }\left ( x\right ) +2q\left ( x\right ) p\left ( x\right ) }{2\left ( q\left ( x\right ) \right ) ^{\frac{3}{2}}}$$ is constant (does not depend on $$x$$), then the above ode is now constant coeﬃcient. Solving the above for $$y\left ( t\right )$$ and then replacing $$t$$ by $$\int \sqrt{q\left ( x\right ) }dx$$ gives the solution of the original ODE. The following are two example on how to use this method.

### 1 Example 1

Solve $y^{\prime \prime }\left ( x\right ) +xy^{\prime }\left ( x\right ) +e^{-x^{2}}y\left ( x\right ) =0$ In the above $$p\left ( x\right ) =x,q\left ( x\right ) =e^{-x^{2}}$$. Hence we ﬁrst check to see if the condition is satisﬁed.\begin{align*} \frac{q^{\prime }\left ( x\right ) +2q\left ( x\right ) p\left ( x\right ) }{2\left ( q\left ( x\right ) \right ) ^{\frac{3}{2}}} & =\frac{-2xe^{-x^{2}}+2xe^{-x^{2}}}{2\left ( e^{-x^{2}}\right ) ^{\frac{3}{2}}}\\ & =0 \end{align*}

Since this does not depend on $$x$$, then it is possible to apply this method. ODE (2) becomes\begin{align*} \frac{d^{2}y}{dt^{2}}+\frac{dy}{dt}\left ( \frac{q^{\prime }\left ( x\right ) +2q\left ( x\right ) p\left ( x\right ) }{2\left ( q\left ( x\right ) \right ) ^{\frac{3}{2}}}\right ) +y\left ( t\right ) & =0\\ \frac{d^{2}y}{dt^{2}}+y\left ( t\right ) & =0 \end{align*}

Therefore $y\left ( t\right ) =c_{1}\cos t+c_{2}\sin t$ But \begin{align*} t & =\int \sqrt{q\left ( x\right ) }dx\\ & =\int \sqrt{e^{-x^{2}}}dx\\ & =\int e^{-\frac{x^{2}}{2}}dx\\ & =\sqrt{\frac{\pi }{2}}\operatorname{erf}\left ( \frac{x}{\sqrt{2}}\right ) \end{align*}

Hence the solution in $$x$$ becomes$y\left ( x\right ) =c_{1}\cos \left ( \sqrt{\frac{\pi }{2}}\operatorname{erf}\left ( \frac{x}{\sqrt{2}}\right ) \right ) +c_{2}\sin \left ( \sqrt{\frac{\pi }{2}}\operatorname{erf}\left ( \frac{x}{\sqrt{2}}\right ) \right )$

### 2 Example 2

Solve $xy^{\prime \prime }\left ( x\right ) +\left ( x^{2}-1\right ) y^{\prime }\left ( x\right ) +x^{3}y\left ( x\right ) =0$ Assuming $$x>0$$. The above becomes$y^{\prime \prime }\left ( x\right ) +\frac{\left ( x^{2}-1\right ) }{x}y^{\prime }\left ( x\right ) +x^{2}y\left ( x\right ) =0$ In the above $$p\left ( x\right ) =\frac{\left ( x^{2}-1\right ) }{x},q\left ( x\right ) =x^{2}$$. Hence we ﬁrst check to see if the condition is satisﬁed.\begin{align*} \frac{q^{\prime }\left ( x\right ) +2q\left ( x\right ) p\left ( x\right ) }{2\left ( q\left ( x\right ) \right ) ^{\frac{3}{2}}} & =\frac{2x+2x^{2}\frac{\left ( x^{2}-1\right ) }{x}}{2\left ( x^{2}\right ) ^{\frac{3}{2}}}\\ & =\frac{2x^{2}+2x^{2}\left ( x^{2}-1\right ) }{2xx^{3}}\\ & =\frac{2x^{2}+2x^{4}-2x^{2}}{2x^{4}}\\ & =1 \end{align*}

Since this does not depend on $$x$$, then it is possible to apply this method. ODE (2) becomes\begin{align*} \frac{d^{2}y}{dt^{2}}+\frac{dy}{dt}\left ( \frac{q^{\prime }\left ( x\right ) +2q\left ( x\right ) p\left ( x\right ) }{2\left ( q\left ( x\right ) \right ) ^{\frac{3}{2}}}\right ) +y\left ( t\right ) & =0\\ \frac{d^{2}y}{dt^{2}}+\frac{dy}{dt}+y\left ( t\right ) & =0 \end{align*}

Therefore $y\left ( t\right ) =e^{\frac{-t}{2}}\left ( c_{1}\cos \left ( \frac{\sqrt{3}}{2}t\right ) +c_{2}\sin \left ( \frac{\sqrt{3}}{2}t\right ) \right )$ But \begin{align*} t & =\int \sqrt{q\left ( x\right ) }dx\\ & =\int \sqrt{x^{2}}dx\\ & =\int xdx\\ & =\frac{x^{2}}{2} \end{align*}

Hence the solution in $$x$$ becomes$y\left ( x\right ) =e^{\frac{-x^{2}}{4}}\left ( c_{1}\cos \left ( \frac{\sqrt{3}}{4}x^{2}\right ) +c_{2}\sin \left ( \frac{\sqrt{3}}{4}x^{2}\right ) \right )$

### 3 References

1. Elementary diﬀerential equations and boundary value problems. Boyce and DiPrima. 10th edition. Wiley publisher.