I am self learning differential equations from the book “Differential Equations With Hostorical Applications” by George Simmons. The following problems is the one I am having an issue with:

Given the homogeneous equation $y” + P(x)y’ + Q(x)y =0$, and change the independent variable from $x$ to $z=z(x)$. Show that the homogeneous equation can be transformed through this change of variables into an equation with constant coefficients iff $frac{Q’ + 2PQ}{Q^{3/2}}$ is constant, in which case $z = int sqrt{Q(x)}dx$ will effect the desired result.

As of now I have solved the “only if” direction with the following math:

Let $ z = z(x)$. We have the following:

$$frac{df}{dx} = frac{df}{dz}frac{dz}{dx} = z'(x) frac{df}{dx} Rightarrow frac{d}{dx} rightarrow z'(x)frac{d}{dz}$$

for the first derivative, and for the second derivative we have:

$$frac{d^{2}f}{dx^{2}} = frac{d}{dx}left(z'(x)frac{df}{dz}right) = frac{d}{dz}left(z'(x)frac{df}{dz}right)z'(x) = (z'(x))^{2}frac{d^{2}f}{dz^{2}} + z'(x)frac{d}{dz}left(z'(x)right) frac{df}{dz} = ldots $$

$$ ldots = (z'(x))^{2}frac{d^{2}f}{dz^{2}} +z'(x)frac{d}{dx}left(z'(x)right)frac{dx}{dz} frac{df}{dz}$$

$$frac{dx}{dz} = frac{d}{dz}left(z^{-1}(z) right) = frac{1}{z'(x)}$$

$$Downarrow$$

$$frac{d^{2}f}{dx^{2}} = (z'(x))^{2}frac{d^{2}f}{dz^{2}} + z”(x)frac{df}{dz} Rightarrow frac{d^{2}}{dx^{2}} rightarrow (z'(x))^{2}frac{d^{2}}{dz^{2}} + z”(x)frac{d}{dz}$$

and all together we have the following three equations, which combined gives us the transformed differential equation.

$$y” + P(x)y’ + Q(x)y =0$$

$$frac{d}{dx} rightarrow z'(x)frac{d}{dz}$$

$$frac{d^{2}}{dx^{2}} rightarrow (z'(x))^{2}frac{d^{2}}{dz^{2}} + z”(x)frac{d}{dz}$$

$$y” + left(frac{P(z)}{z'(x)} + frac{z”(x)}{(z'(x))^{2}}right)y’ + frac{Q(z)}{(z'(x))^{2}}y = 0$$

Now suppose that $frac{Q(z)}{(z'(x))^{2}} = c_{2}$ and that $left(frac{P(z)}{z'(x)} + frac{z”(x)}{(z'(x))^{2}}right) = c_{1}$. Plug $z'(x) = sqrt{frac{c_{2}}{Q(z)}}$ and $z”(x) = frac{Q'(x)}{2sqrt{c_{2}Q(x)}}$ into the the equation for $c_{1}$, and we get that :

$$frac{2PQ + Q’}{Q^{3/2}} = frac{2c_{1}}{sqrt{c_{2}}} = constant$$

I have tried various things for the other direction, but I can’t seem to make any progress.