Using a 'Similarity Variable' to transform a PDE into an ODE? I have a PDE:
$$\frac{\partial y}{\partial t}=\alpha\frac{\partial^2y}{\partial x^2}\tag{1}$$
So we're looking for a function:
$$y=f(x,t)$$
The following substitution with a Similarity Variable then transforms the PDE into a simple ODE:
$$z=\frac{x}{2\sqrt{\alpha t}}\tag{2}$$
$$\frac{\mathrm{d}^2y(z)}{\mathrm{d}z^2}=-2z \frac{\mathrm{d}y(z)}{\mathrm{d}z}\tag{3}$$
The latter solves easily to:
$$y=c_1\int e^{-z^2}\mathrm{d}z+c_2$$
The trouble is I can't seem to carry out this substitution to get from $(1)$ to $(3)$, using $(2)$.
I thought of extracting $x$ and $t$ from $(2)$ and differentiating them as $\mathrm{d}t$ and $\mathrm{d}x^2$ but couldn't make that work.
So how to make this substitution work?
 A: I don't know anything about similarity transformations, but this looks pretty straightforward:
By the chain rule,
$$\frac{\partial y}{\partial t} = \frac{\partial y}{\partial z} \frac{\partial z}{\partial t} = -\frac{\alpha x}{4(\alpha t)^{3/2}}\frac{\partial y}{\partial z}=-\frac{2\alpha z^3}{x^2}\frac{\partial y}{\partial z}$$
$$\frac{\partial y}{\partial x}=\frac{\partial y}{\partial z}\frac{\partial z}{\partial x}$$
$$\frac{\partial^2y}{\partial x^2} = \frac{\partial}{\partial x}\left(\frac{\partial y}{\partial z}\right)\frac{\partial z}{\partial x}+\frac{\partial}{\partial x}\left(\frac{\partial z}{\partial x}\right)\frac{\partial y}{\partial z} = \frac{1}{2\sqrt{\alpha t}}\frac{\partial^2 y}{\partial z^2}\frac{\partial z}{\partial x} = \frac{1}{4\alpha t}\frac{\partial^2 y}{\partial z^2}=\frac{z^2}{x^2}\frac{\partial^2 y}{\partial z^2}$$
Hence,
$$-\frac{2\alpha z^3}{x^2}\frac{\partial y}{\partial z} = \alpha \frac{z^2}{x^2}\frac{\partial^2 y}{\partial z^2}$$
Rearranging,
$$\frac{d^2 y}{d z^2}=-2z\frac{d y}{d z}$$
