# Changing 2nd order homogeneous differential equation to the one with constant coefficients

Given a general 2nd degree homogeneous differential equation $y'' +p(x)y' +q(x)y=0$. Change the independent variable from $x$ to $z=z(x)$. Show that the above given homogeneous 2nd order differential equation can be transformed into an equation with constant coefficients if and only if $(q' + 2pq)/q^{3/2}$ is constant.

When we change variables from $x$ to $z(x)$ what we're doing is effectively looking for a function $z$ that shifts $y$ and its derivatives so that $p(x)$ and $q(x)$ are fixed relative to them, allowing us to consider $p$ and $q$ as constants in this new variable.

By the chain rule, $$\frac{\mathrm d}{\mathrm{d}x} y(z(x)) = \frac{\mathrm d}{\mathrm{d}z} y(z) \frac{\mathrm{d}z}{\mathrm{d}x}$$ and $$\frac{\mathrm d}{\mathrm{d}x} (\frac{\mathrm d}{\mathrm{d}z} y(z) \frac{\mathrm{d}z}{\mathrm{d}x}) = \frac{\mathrm{d}^2}{\mathrm{d}z^2} y(z) (\frac{\mathrm{d}z}{\mathrm{d}x})^2 +\frac{\mathrm d}{\mathrm{d}z} y(z) \frac{\mathrm{d}^2 z}{\mathrm{d}x^2}$$.

Substituting into the original equation and rearranging, we get

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

And so for the new coefficients to be constant, we require $\frac{z''(x) +p(x)z'(x)}{(z'(x))^2}= A_1$ and $\frac{q(x)}{(z'(x))^2} = \frac{1}{A_2}$ where $A_1,A_2$ are constants.

the second of these is easier to solve, giving us $z'(x) = \sqrt{A_2q(x)}$, which we can differentiate to give $$z''(x) = \frac{1}{2}\frac{A_2}{\sqrt{A_2 q(x)}} q'(x)$$ We can then plug this into the equation for the other coefficient and solve for $z$, $$\frac{\frac{1}{2}\frac{A_2}{\sqrt{A_2 q(x)}} q'(x) +p(x)\sqrt{A_2 q(x)}}{A_2 q(x)} = A_1$$ Multiplying the top and bottom of the LHS by $\sqrt{A_2 q(x)}$ and rearranging gives us $$\frac{q'(x) + 2p(x)q(x)}{q(x)^\frac{3}{2}} = 2\sqrt{A_2}A_1$$ and so the desired expression is clearly constant.

In the question nothing about the domain. It becomes problematic when $q^{3/2}$ appears. What can we say if $q<0$ and everything is real? Using the calculations of Baron we can write \begin{align} A_2q &=(z')^2, \\ A_2q'&=2z'z'',\\ z''&=\frac{A_2q'}{2z'}. \end{align} Substituting back we obtain $$\frac{A_2q'+2p(z')^2}{2(z')^3}=A_1.$$ Since $(z')^2=A_2q$, from the last formula we have $$A_2(q'+2pq)=2A_1(z')^3.$$ Squaring both side and using again the expression for $(z')^2$ we arrive at $$\frac{(q'+2pq)^2}{q^3}=4A_1^2A_2.$$

Chris Cunningham's answer here seems to have an alternative proof.

(That's probably just stupidity, but I still can't follow Baron Mingus' proof - shouldn't it be p(z) when you substitute?)