Deriving a differential equation I have the following information:

$$\mathrm{i})\;\frac{\partial\theta}{\partial
 t}=D\frac{\partial^2\theta}{\partial x^2}\qquad
 \mathrm{ii})\;Q=\int_{\mathbb{R}}\theta
 (x,t)\,dx\qquad\mathrm{iii})\;\theta (x,t)=\frac{Q}{\sqrt{Dt}}f(z)$$
Where $f$ is some function and $z=x/\sqrt{Dt}$. It is also given that $Q$ and $D$ are constant.

I am asked to show that:
$$\frac{d^2 f}{dz^2}+\frac{z}{2}\frac{df}{dz}+\frac{1}{2}f=0$$
Is there a neat way of getting to this? Any help is appreciated.
 A: Ok, let me give you a hint:
You have, by applying the chain rule to every term and remembering that $z = z(x,t)$:
$$\begin{align}
\theta_t = - \frac{1}{2} \frac{Q}{\sqrt{D}} t^{-3/2} f(z(x,t)) + \frac{Q}{\sqrt{D}}t^{-1/2} \frac{\partial f(z(x,t))}{\partial t} = -\frac{D Q f\left(z\right)}{2 (D t)^{3/2}}-\frac{Q x f'\left(z \right)}{2 D t^2}, 
\end{align}$$
since $\frac{\partial f}{\partial t} = f'(z) \frac{\partial z}{\partial t}.$ And, on the other hand:
$$\theta_{xx} = \frac{\partial}{\partial x} \left( \frac{\partial \theta}{\partial x} \right) = \frac{\partial}{\partial x} \left(\frac{Q}{\sqrt{Dt}} \frac{\partial z}{\partial x}\right) = \frac{\partial}{\partial x} \left(\frac{Q}{\sqrt{Dt}} f'(z) \frac{1}{\sqrt{Dt}} \right) = \frac{Q}{Dt \sqrt{Dt}} f''(z),$$
since $\frac{\partial f}{\partial x} = f'(z) \frac{\partial z}{\partial x}.$ Substitute every term back into the original PDE, i.e, $\theta_t - D \theta_{xx} = 0$ and recall that $z = x/\sqrt{Dt}$ in order to get the ODE-2 for $f(z)$:
$$ f''(z) + \frac{z}{2} f'(z) + \frac{1}{2} f(z) = 0.$$
The new variable $z$ is called self-similar variable and $f(z)$ self-similar solution or similarity solution. This kind of simplifications (from PDE to ODE) is very useful when considering dimensional analysis in some problems in fluid mechanics, such as the Blasius boundary layer problem.
Cheers! 
