An analytical solution for the scalar probability density function in homogeneous turbulence