I am following a quantum mechanics text book which uses a simple looking substitution in a derivative.
The substitution is $$\xi=\gamma x\tag1$$
It then says that $$\frac{d\psi}{dx}=\frac{d\psi}{d\xi}\frac{d\xi}{dx}=\gamma\frac{d\psi}{d\xi}\tag2$$
So far so good. Now comes the part I don't follow. It says: $$\frac{d^2\psi}{dx^2}=\gamma^2\frac{d^2\psi}{d\xi^2}\tag3$$
I don't know how they get this. I tried $$\frac{d^2\psi}{dx^2}=\frac{d^2\psi}{d\xi^2}\frac{d^2\xi}{dx^2}\tag4$$ but I get $$\frac{d^2\xi}{dx^2}=0$$ by using the substitution in equation (1). I'd appreciate it if someone could explain this to me.
Another thing I tried is (suggested by comment below): $$\frac{d}{dx}\left(\frac{d\psi}{dx}\right)=\frac{d}{dx}\left(\frac{d\psi}{d\xi}\frac{d\xi}{dx}\right)=\frac{d^2\psi}{dxd\xi}\frac{d\xi}{dx}+\frac{d\psi}{d\xi}\frac{d^2\xi}{dx^2}\tag5$$
Now since $$\frac{d^2\xi}{dx^2}=0$$ equation (5) reduces to:$$\frac{d}{dx}\left(\frac{d\psi}{dx}\right)=\frac{d}{dx}\left(\frac{d\psi}{d\xi}\frac{d\xi}{dx}\right)=\gamma\frac{d^2\psi}{dxd\xi}$$
Once again, I'm stuck..