How do I replace variables in $\frac{d^2 \psi}{dx^2}$? I have 
$$\frac{d^2 \psi}{dx^2}=a^3 x \psi$$
but I need to change to $z$ by
$$z=ax$$
and end with 
$$\frac{d^2 \psi}{dz^2}=z \psi$$
How do I change variables here?

This is what I tried:
$$dz=adx$$
$$\frac{d^2 \psi}{dz^2} = \frac{d}{dz}\left (\frac{d \psi}{dz}  \right )$$
$$=\frac{d}{dz}\left (\frac{d \psi}{dx} \frac{dx}{dz}  \right )$$
$$=\frac{d}{dz}\left (\frac{d \psi}{dx} \frac{1}{a} \right )$$
...but then what do I do with $\frac{d\psi}{dx}$??
 A: You are confusing yourself with the transformation.
$$
\frac{d}{dx} \to \frac{d}{dz}
$$
This is the what you want to get to, a replacement operator for $d/dx$. To finish this off we need
$$
\frac{d}{dx} = \frac{dz}{dx}\frac{d}{dz} = a\frac{d}{dz}
$$
so now we have a replacement for $d/dx$ you can now apply it twice to get what you want.
A: The trick here is to let $\dfrac{d}{dz}=\dfrac{d}{dx}\cdot \dfrac{dx}{dz}$. This gives:
$$\frac{d^2 \psi}{dz^2}=\frac{d}{dz}\left(\frac{d \psi}{dx}\cdot \frac{1}{a}\right)=\frac{d}{dx}\left(\frac{d \psi}{dx}\cdot \frac{1}{a}\right)\cdot \frac{dx}{dz}=\frac{d^2 \psi}{dx^2}\cdot \frac{1}{a^2}$$

However, a more efficient method would be to find formulae for the terms you already have in the differential equation instead (i.e. $x$,$\frac{d\psi}{dx}$,$\frac{d^2\psi}{dx^2}$). You have:
$$dz=a~dx \implies \frac{dz}{dx}=a$$
Therefore, if we work out what $\frac{d\psi}{dx}$ is:
$$\frac{d\psi}{dx}=\frac{d\psi}{dz}\cdot \frac{dz}{dx}=\frac{d\psi}{dz}\cdot a$$
Hence, for the second derivative $\frac{d^2\psi}{dx^2}$, you should have:
$$\frac{d^2 \psi}{dx^2}=\frac{d}{dx}\left(\frac{d\psi}{dx}\right)=\frac{d}{dx}\left(\frac{d\psi}{dz}\cdot a\right)=\frac{d}{dz}\left(\frac{d\psi}{dz}\cdot a\right)\cdot \frac{dz}{dx}=\frac{d^2 \psi}{dz^2}\cdot a^2$$
Substituting into the differential equation gives you the desired ODE.

In case you wish to solve it afterwards: Notice that after the change of variable, it is an Airy Differential Equation.
