Changing dependent variable in 2nd order ODE Consider the 2nd order ODE
$\frac{d^2 u}{dx^2} + \left( \gamma + \delta x + \epsilon x^2 \right) \frac{du}{dx} + \alpha \left( x - x_0\right) u = 0$.
If we change the dependent function to $w = \exp \left( \gamma x + \tfrac{1}{2} \delta x^2 + \tfrac{1}{3} \epsilon x^3 \right) \frac{du}{dx} $, then $w$ satisfies
$\frac{d^2 w}{dx^2} - \left( \gamma + \delta x + \epsilon x^2 + \frac{1}{x-x_0} \right) \frac{dw}{dx} + \alpha \left( x - x_0\right) w = 0$.
How to prove this? Naively, I get a third order ODE :-( 
 A: $$
w = \exp\left(\int \gamma +\delta x + \varepsilon x^2 dx\right)u'
$$
so we get
$$
\begin{align}
w' &=& \left[\left(\gamma +\delta x + \varepsilon x^2\right)u' + u''\right]\exp\left(\int \gamma +\delta x + \varepsilon x^2 dx\right)\\
 &=& -\alpha(x-x_0)u\exp\left(\int \gamma +\delta x + \varepsilon x^2 dx\right)
\end{align}
$$
then we have
$$
\begin{align}
w'' &=& -\left[\frac{d}{dx}\left(\alpha(x-x_0)u\right)+\alpha(x-x_0)u\left(\gamma +\delta x + \varepsilon x^2 \right)\right]\exp\left(\int \gamma +\delta x + \varepsilon x^2 dx\right)\\
&=&-\left[\alpha u +\alpha(x-x_0)u'+\alpha(x-x_0)u\left(\gamma +\delta x + \varepsilon x^2 \right)\right]\exp\left(\int \gamma +\delta x + \varepsilon x^2 dx\right)\\
&=&-\left[\alpha(x-x_0)u'+\alpha(x-x_0)u\left(\frac{1}{x-x_0}+\gamma +\delta x + \varepsilon x^2 \right)\right]\exp\left(\int \gamma +\delta x + \varepsilon x^2 dx\right)\\
&=&-\alpha(x-x_0)w - \left[\left(-w'\exp\left(-\int \gamma +\delta x + \varepsilon x^2 dx\right)\right)\left(\frac{1}{x-x_0}+\gamma +\delta x + \varepsilon x^2 \right)\right]\exp\left(\int \gamma +\delta x + \varepsilon x^2 dx\right)\\
&=&-\alpha(x-x_0)w + w'\left(\frac{1}{x-x_0}+\gamma +\delta x + \varepsilon x^2 \right)
\end{align}
$$
therefore we get
$$
w''-w'\left(\frac{1}{x-x_0}+\gamma +\delta x + \varepsilon x^2 \right) +\alpha(x-x_0)w = 0
$$
so basically a lot of book keeping!
