I have to solve Poisson equation with source part containing unknown function, and it comes to be, that for doing that I need to calculate Laplace Series (expansion of function in terms of spherical harmonics) coefficients for following function:
$f(\theta, \phi) = \frac{\cos\phi}{\sin\theta}$
Tried to compute it in Wolfram Mathematica but got "Indetermined" for all coefficients with $m=1$ and zero for non-unit $m$.
The exact form for coefficients is as follows:
$f_{lm}=\int_{0}^{\pi}\int_{0}^{2\pi}f(\theta,\phi)Y_{lm}^{*}(\theta,\phi)\sin\theta d\theta d\phi$
I would appreciate if someone could provide an analytical expression for $f_{lm}$.
We have for a normalization $N_{l,m}$ (according to what you use) $$ f_{l,m}=N_{l,m}\int^{\pi}_{0}\int^{2\pi}_{0}\frac{\cos(\phi)}{\sin(\theta)}\sin(\theta)e^{im\phi}P^{m}_l(\cos(\theta))d\theta d\phi= $$ $$ =N_{l,m}\left(\int^{\pi}_0\cos(\phi)e^{im\phi}d\phi\right)\left(\int^{2\pi}_{0}P^l_m(\cos(\theta))d\theta\right), $$ where $P^l_m(x)$ is the associated Legendre polynomial. The first integral is (easily) $$ \int^{\pi}_0\cos(\phi)e^{im\phi}d\phi=\frac{i(1+e^{i\pi m})m}{m^2-1} $$ with $m$ integer.
For the second integral is $$ P^m_l(z)=\frac{1}{\Gamma(1-m)}\left(\frac{1+z}{1-z}\right)^{m/2}{ }_2F_1\left(-l,1+l;1-m;\frac{1-z}{2}\right). $$ Hence $$ P^m_l(\cos(\theta))=\frac{1}{\Gamma(1-m)}\left(\frac{1+\cos(\theta)}{1-\cos(\theta)}\right)^{m/2}{ }_2F_1\left(-l,1+l;1-m;\frac{1-\cos(\theta)}{2}\right)= $$ $$ =\frac{1}{\Gamma(1-m)}\left(\frac{2\cos^2(\theta/2)}{2\sin^2(\theta/2)}\right)^{m/2}{ }_2F_1\left(-l,1+l;1-m;\frac{2\sin^2(\theta/2)}{2}\right)= $$ $$ =\frac{1}{\Gamma(1-m)}\left(\cot^2(\theta/2)\right)^{m/2}{ }_2F_1\left(-l,1+l;1-m;\sin^2(\theta/2)\right)= $$ $$ =\frac{1}{\Gamma(1-m)}\sum^{\infty}_{n=0}\frac{(-l)_n(l+1)_n}{(1-m)_n n!}\left(\cot^2(\theta/2)\right)^{m/2}\left(\sin^{2}(\theta/2)\right)^n. $$ Hence $$ \int^{2\pi}_{0}P^m_l(\cos(\theta))d\theta=\frac{1}{\Gamma(1-m)}\sum^{\infty}_{n=0}\frac{(-l)_n(l+1)_n}{(1-m)_n n!}\int^{2\pi}_{0}\left(\cos^2(\theta/2)\right)^{m/2}\left(\sin^{2}(\theta/2)\right)^{n-m/2}d\theta $$ But $\cos(x)$ is monotone in $(0,\pi)$ and a simple change of variable $\theta/2\rightarrow \theta $ in the above integral lead us to $$ I_{n,m}=\int^{2\pi}_{0}\left(\cos^2(\theta/2)\right)^{m/2}\left(\sin^{2}(\theta/2)\right)^{n-m/2}d\theta=2\int^{\pi}_0\left(\cos^2(\theta)\right)^{m/2}\left(\sin^{2}(\theta)\right)^{n-m/2}d\theta $$ Another change of variable $cos(\theta)\rightarrow t$ lead us to $$ I_{n,m}=2\int^{-1}_{1}(t^2)^{m/2}(1-t^2)^{n-m/2}\frac{-dt}{\sqrt{1-t^2}} =2\int^{1}_{-1}(t^2)^{m/2}(1-t^2)^{n-m/2-1/2}dt= $$ $$ =4\int^{1}_{0}(t^2)^{m/2}(1-t^2)^{n-m/2-1/2}dt=2\int^{1}_{0}t^{m/2-1/2}(1-t)^{n-m/2-1/2}dt. $$ Hence $$ I_{n,m}=2\frac{\Gamma\left(\frac{1+m}{2}\right)\Gamma\left(\frac{1-m}{2}+n\right)}{n!} $$ Hence $$ \int^{2\pi}_{0}P^{m}_{l}(\cos(\theta))d\theta=\frac{2}{\Gamma(1-m)}\sum^{\infty}_{n=0}\frac{(-l)_n(1+l)_n}{(1-m)_n(n!)^2}\Gamma\left(\frac{1+m}{2}\right)\Gamma\left(\frac{1-m}{2}+n\right)= $$ $$ =\frac{2}{\Gamma(1-m)}\Gamma\left(\frac{1+m}{2}\right)\Gamma\left(\frac{1-m}{2}\right)\sum^{\infty}_{n=0}\frac{(-l)_n(1+l)_n}{(1-m)_n(n!)^2}\left(\frac{1-m}{2}\right)_n. $$ And finaly for $l,m$ integers with $l\geq0$, we have $$ f_{l,m}=N_{l,m}\frac{(1+e^{i\pi m})m}{1-m^2}\frac{2i\Gamma\left(\frac{1-m}{2}\right)\Gamma\left(\frac{1+m}{2}\right)}{\Gamma(1-m)}{ }_3F_2\left(-l,l+1,\frac{1-m}{2};1-m,1;1\right) $$ But according to Mathematica program (and I think it must be on tables) $$ \frac{1}{\Gamma(1-m)}{ }_3F_2\left(-l,l+1,\frac{1-m}{2};1-m,1;1\right)=\frac{2^m\pi}{\Gamma\left(\frac{1-l}{2}\right)\Gamma\left(1+\frac{l}{2}\right)\Gamma\left(\frac{1-l-m}{2}\right)\Gamma\left(1+\frac{l-m}{2}\right)} $$ and $$ N_{l,m}:=\sqrt{\frac{2l+1}{4\pi}}\sqrt{\frac{(l-m)!}{(l+m)!}} $$ Hence for $l,m$ integers and $l\geq 0$, we have $$ f_{l,m}=4\pi iN_{l,m}\frac{2^me^{i\pi m/2}m}{(m^2-1)\Gamma\left(\frac{1-l}{2}\right)\Gamma\left(1+\frac{l}{2}\right)\Gamma\left(\frac{1-l-m}{2}\right)\Gamma\left(1+\frac{l-m}{2}\right)} $$ For $l\leq-1$ we set in the above formula $l\rightarrow -l-1$.