How can I solve this integral
\begin{equation} \int_0^{\infty}p dp \int_0^{\pi} d \theta \frac{\cos n \theta}{(p^2+k^2-2pk\cos\theta)^{1/2}} \end{equation}
where $k>0$ and $n=2,3,4,\cdots$.
What I have done:
First of all, I have used Laplace expansion in spherical coordinates: \begin{equation} \frac{1}{|\mathbf{x}-\mathbf{x}'|} =\sum_{\ell =0}^{\infty} \frac{r_<^{\ell}}{r_{>}^{\ell+1}}P_{\ell}(\cos\gamma), \quad \text{where} \ \cos\gamma = \cos\theta \cos\theta' + \sin\theta \sin\theta' \cos(\phi-\phi') \end{equation} So we can assume that $\mathbf{k} = (k,0,0)$ and $\mathbf{p} = (p,\theta,0)$ in spherical coordinates. And we get: \begin{equation*} \frac{1}{(p^2 + k^2 - 2pk \cos\theta)^{1/2}} = \sum_{\ell = 0}^{\infty} \frac{r_<^{\ell}}{r_{>}^{\ell + 1}} P_{\ell}(\cos\theta) \end{equation*} Then the integral becomes:
\begin{align} &\int_0^{\infty} p\ \mathrm{d}{p} \int_0^{\pi} \ \mathrm{d}{\theta} \frac{\cos n \theta}{(p^2 + k^2 - 2pk \cos\theta)^{1/2}} \\[.2cm] ={}& \sum_{\ell=0}^{\infty} \left( \int_0^{k}\frac{p^{\ell}}{k^{\ell+1}}\cdot p \ \mathrm{d}{p} + \int_k^{\infty}\frac{k^{\ell}}{p^{\ell + 1}}\cdot p\ \mathrm{d}p\right)\left(\int_0^{\pi}\cos(n\theta) P_{\ell}(\cos\theta)\ \mathrm{d}{\theta}\right)\\[.2cm] ={}&k\cdot\sum_{\ell=0}^{\infty}\frac{2\ell+1}{(\ell+2)(\ell-1)}\left(\int_0^{\pi}\cos(n\theta) P_{\ell}(\cos\theta)\ \mathrm{d}{\theta}\right) \end{align}
I have used the Fourier expansion of Legendre polynomials which can be derived from the generating function.
\begin{equation} P_{n}(\cos\theta) = \sum_{k=0}^{n} \frac{(2k-1)!!}{(2k)!!} \frac{(2n-2k-1)!!}{(2n-2k)!!} \cos[(n-2k)\theta] \end{equation} We set the coefficient as $a_{nk}$: \begin{equation} a_{nk} = \frac{(2k-1)!!}{(2k)!!} \frac{(2n-2k-1)!!}{(2n-2k)!!} \end{equation} Thus, the integral over angles can be transformed into \begin{align} \int_0^{\pi}\cos(n\theta) P_{\ell}(\cos\theta)\ \mathrm{d}\theta&= \sum_{m=0}^{\ell}a_{\ell m} \int_0^{\pi} \cos (n\theta) \cos[(\ell -2m)\theta] \ \mathrm{d}{\theta}\\ &\overset{(1)}{=}\sum_{m=0}^{\ell} a_{\ell m} \left(\frac{\pi}{2}\delta_{\ell-2m,n}+\frac{\pi}{2}\delta_{2m-\ell,n}\right)\\ &\overset{(2)}{=}\pi\sum_{m=0}^{\ell}a_{\ell m}\delta_{\ell-2m,n} \end{align} Finally, the result of this integral is: \begin{align} &\int_0^{\infty} p\ \mathrm{d}{p} \int_0^{\pi} \ \mathrm{d}{\theta} \frac{\cos n \theta}{(p^2 + k^2 - 2pk \cos\theta)^{1/2}} \\[.2cm] ={}&\sum_{\ell=2}^{\infty} \frac{2\ell+1}{(\ell+2)(\ell-1)}k \sum_{m=0}^{\ell} \pi a_{\ell m}\delta_{\ell-2m,n}\\[.2cm] \overset{(2)}{=}{}&\sum_{\ell =n,\ 2|(\ell-n)}^{\infty}\frac{2\ell+1}{(\ell+2)(\ell-1)}\pi k a_{\ell,\frac{\ell-n}{2}},\quad j\mapsto \frac{\ell-n}{2}\\[.2cm] ={}&\pi k \sum_{j=0}^{\infty} \frac{2(2j+n)+1}{(2j+n+2)(2j+n-1)} a_{2j+n,j}\\[.2cm] ={}&\boxed{ \pi k \sum_{j=0}^{\infty} \frac{2(2j+n)+1}{(2j+n+2)(2j+n-1)} \frac{(2j-1)!!}{(2j)!!}\frac{(2j+2n-1)!!}{(2j+2n)!!}} \end{align} where,
- $\displaystyle{\int_0^{\pi} \cos mx \cos nx \ \mathrm{d}{x} = \frac{\pi}{2}\delta_{mn},\quad (m,n\in\mathbb{N}^{+})}$
- $\displaystyle{ \ell-2m = -\ell, -\ell+2,-\ell+4, \cdots, \ell-2,\ell}$.
My Question:
I have try to calculate this series via Mathematica, I define
\begin{align}
f(n) &= \sum_{j=0}^{\infty} \frac{2(2j+n)+1}{(2j+n+2)(2j+n-1)} \frac{(2j-1)!!}{(2j)!!}\frac{(2j+2n-1)!!}{(2j+2n)!!}\\[.2cm]
&=\sum_{j=0}^{\infty}\frac{1}{2j+n+2}\frac{(2j-1)!!}{(2j)!!}\frac{(2j+2n-1)!!}{(2j+2n)!!} + \sum_{j=0}^{\infty}\frac{1}{2j+n-1}\frac{(2j-1)!!}{(2j)!!}\frac{(2j+2n-1)!!}{(2j+2n)!!}
\end{align}
I have found that this series has a very simple form:
\begin{align}
f(2)= \frac{2}{3},\quad f(3) = \frac{3}{8},\quad f(4) = \frac{4}{15},\quad f(5)=\frac{5}{24},\quad f(6)=\frac{6}{35},\quad \cdots
\end{align}
It seems to imply that the original integral result was:
\begin{equation}
\int_0^{\infty} p\ \mathrm{d}{p} \int_0^{\pi} \ \mathrm{d}{\theta} \frac{\cos n \theta}{(p^2 + k^2 - 2pk \cos\theta)^{1/2}} \overset{?}{=} \boxed{\color{red}{ \frac{n}{n^2-1}\pi k} }
\end{equation}
The computer tells this result should be correct, but I can't get this result by simplifying the series.
Is there any way you can calculate this integral result, or can you simplify my series?
The integral is $I_n=\int_0^\infty\int_0^\pi f(p,\theta)\cos n\theta\,d\theta\,dp$ with $f(p,\theta)=p(p^2+k^2-2pk\cos\theta)^{-1/2}$.
The idea is to exchange the integrations after some preparation: let, say, $$h(p,\theta)=\begin{cases}\hfill 0,\hfill&0\leqslant p\leqslant k\\1+\frac{k}{p}\cos\theta,&\hfill p>k\hfill\end{cases}$$ so that $\int_0^\pi h(p,\theta)\cos n\theta\,d\theta=0$ (we're using $n>1$ here).
Then, if we put $g(p,\theta)=f(p,\theta)-h(p,\theta)$, we get $I_n=\int_0^\infty\int_0^\pi g(p,\theta)\cos n\theta\,d\theta\,dp$.
Now $g(p,\theta)$ is (absolutely) integrable, and $\int_0^\infty g(p,\theta)\,dp$ is elementary: $$\small\int\frac{p\,dp}{\sqrt\triangle}=\sqrt\triangle+kc\log(p-kc+\sqrt\triangle)+\text{const.}\qquad\color{gray}{\left\{\begin{aligned}c&=\cos\theta\\\triangle&=p^2+k^2-2pkc\end{aligned}\right.}$$ implies, for $p>k$, $$\small\int_0^p g(\bar{p},\theta)\,d\bar{p}=\sqrt\triangle-p+kc\log\frac{p-kc+\sqrt\triangle}{p(1-c)}$$ so that, after taking $p\to\infty$, we get $$\int_0^\infty g(p,\theta)\,dp=-k\cos\theta\left(1+2\log\left|\sin\frac\theta2\right|\right).$$
Thus, after exchanging the integrations (and using $n>1$ again), $$I_n=-2k\int_0^\pi\log\left|\sin\frac\theta2\right|\cos\theta\cos n\theta\,d\theta=k(J_{n-1}+J_{n+1}),$$ with $$J_n=-\int_0^\pi\log\left|\sin\frac\theta2\right|\cos n\theta\,d\theta=\frac\pi{2n}\qquad(n>0)$$ evaluated, say, using $$-\log\left|2\sin\frac\theta2\right|=\sum_{n=1}^\infty\frac{\cos n\theta}n.$$