This the the equation for Yml(x) before plugging in for Plm(x).

 
ylm(x)=sqrt[(2*l+1)*((l-m)!)/(4*Pi*((l+m)!))]*w*Plm(x) w=exp[i*m*(phi)] x=cos(theta)