Laplace equation on a sphere, Legendre polynomials. Solve the following dirichlet problem: $$\Delta u(r,\theta,\phi) = 0 $$ $$r < 1$$
$$u(1,\theta,\phi) = cos^2(\theta)sin^2(\phi)$$
After a lengthy calculation using seperation of variables we get the solution form: 
$$u(r,\theta,\phi) = \sum_{n=0}^{\infty} \sum_{m=-n}^{n} (Cmn)r^ne^{im\theta}P_n ^{|m|}(cos(\phi))$$
where $P_n ^{|m|}(\phi)$ is the associated Legendre function, and for 
$$u(1,\theta,\phi) = cos^2(\theta)sin^2(\phi) = \sum_{n=0}^{\infty} \sum_{m=-n}^{n} (Cmn)e^{im\theta}P_n ^{|m|}(cos(\phi))$$
we can derive the integral solution for $Cnm$
$$Cnm = \frac{(2n-1)(n-|m|)!}{4\pi(n+|m|)!}\int_{0}^{\pi}\int_{-\pi}^{\pi}cos^2(\theta)sin^2(\phi)e^{-im\theta}P_n ^{|m|}(cos(\phi))sin(\phi)d\theta d\phi$$
But at this point I am kinda lost. I have no idea where to begin computing this integral, or what to do with m & n. The main problem is of course the legendre functions, everything else is straight forward. Do we compute a general formula for the associated legendre function, and plug that in? Am I misintepreting the solution forms? I have worked a lot with basic orthogonal bases and a bit with regular legendre polynomials but at this point I am stumped. Any guidance would be greatly appreciated!  
 A: Using $\cos^2 \theta=\frac12(1+\cos 2\theta)$, we have
$$\int_0^{2\pi}e^{-im\theta}\cos^2 \theta \,d\theta=\frac12 \int_0^{2\pi}e^{-im\theta}(1+\cos 2\theta) \,d\theta=\pi\delta_{m,0}+\frac12\pi\delta_{m,2}+\frac12\pi\delta_{m,-2}$$
So, now the only terms that are non-zero are $C_{n,0}$, $C_{n,2}$, and $C_{n,-2}$.  The requisite integrals are 
$$\int_0^\pi P_n^0(\cos \phi)\,\sin^3 \phi\,d\phi=\int_0^\pi P_n^0(\cos \phi)\,(1-\cos^2\phi)\,\sin \phi\,d\phi \tag 1$$
$$\int_0^\pi P_n^2(\cos \phi)\,\sin^3 \phi\,d\phi=\int_0^\pi P_n^2(\cos \phi)\,(1-\cos^2\phi)\,\sin \phi\,d\phi \tag 2$$
Now, note that $P_0^0=1$, $P_2^0=\frac12(3\cos^2\phi -1)$, and $P_2^2=3(1-\cos^2 \phi)$.  Then in $(1)$, we have 
$$1-\cos^2 \phi=\frac23(P_0^0-P_2^0)$$
while in $(2)$, we have
$$1-\cos^2 \phi=\frac13 P_2^2$$
Now, simply exploit the orthogonal property of the Associated Legendre Functions 
$$\int_0^\pi P_n^m(\cos \phi)P_{n'}^m(\cos \phi)\,\sin \phi\,d\phi=\frac{2(n+m)!}{(2n+1)(n-m)!}\delta_{n,n'}$$
and you will have it!
A: Hint
Assuming that all your development is correct.
For $m>0$
$$C_{nm} = \frac{(2n-1)(n-m)!}{4\pi(n+m)!}\int_{0}^{\pi}\int_{-\pi}^{\pi}cos^2(\theta)sin^2(\phi)e^{-im\theta}P_n ^{m}(cos(\phi))sin(\phi)d\theta d\phi$$
For $m<0$
$$C_{nm} = \frac{(2n-1)(n+m)!}{4\pi(n-m)!}\int_{0}^{\pi}\int_{-\pi}^{\pi}cos^2(\theta)sin^2(\phi)e^{im\theta}P_n ^{-m}(cos(\phi))sin(\phi)d\theta d\phi$$
Finaly, for $m=0$ 
$$C_{n0} = \frac{(2n-1)}{4\pi }\int_{0}^{\pi}\int_{-\pi}^{\pi}cos^2(\theta)sin^2(\phi) sin(\phi)d\theta d\phi$$
The last one I'm pretty sure you know to solve.
In the first two, first change the variables from $\phi$ to $t=\cos\phi$ (I guess I don't need to say it, but don't forget the differentials and the limits). Next, change the Legender polynomial to its differential definition
$$P_n(x)=\frac{1}{2^n n!}
\frac{d^n}{dx^n}\left[
(x^2-1)^n\right]
$$
another thing you could try is 
\begin{align}P_n(x)= 2^n\cdot \sum_{k=0}^n x^k {n \choose k}{\frac{n+k-1}2\choose n}\end{align}
One of them should be solvable. Also, I like the answer by Dr. MV
Hope this helps.
