Analytical solution of the nonlinear diffusion equation