# Derivation of an integral containing the complete elliptic integral of the first kind

This is a repost of mathoverflow to draw broader attentions. https://mathoverflow.net/questions/439770/derivation-of-an-integral-containing-the-complete-elliptic-integral-of-the-first

I found the following formula in "INTEGRALS AND SERIES, vol.3" by Prudnikov, Brychkov and Marichev (page 188, eq.5).

$$\int_0^{\infty} \frac{x^{\alpha-1}}{\sqrt{(a+x)^2+z^2}}K\Bigg(\frac{2\sqrt{ax}}{\sqrt{(a+x)^2+z^2}}\Bigg)dx \\ \quad \quad = \frac{\sqrt{\pi}}{4}\Gamma\Big(\frac{\alpha}{2}\Big)\Gamma\ \Big(\frac{1-\alpha}{2}\Big)(a^2+z^2)^{(\alpha-1)/2}P_{-\alpha}\Bigg(\frac{z}{\sqrt{a^2+z^2}}\Bigg)$$

$$K$$: complete elliptic integral of the first kind.

$$\Gamma$$: Gamma function

$$P$$: Legendre function of the first kind.

$$\alpha$$: complex value

The book says this is valid for $$a>0, \operatorname{Re} z>0, 0 < \operatorname{Re}\alpha<1$$. Could anybody tell me how this can be derived ?

I think this formula would be useful for evaluating Mellin transform of a function that contains the complete elliptic integrals.

https://www.researchgate.net/publication/268650078_Integrals_and_Series_Volume_3_More_Special_Functions

Since $$\displaystyle K(k)=\int_0^{\pi/2}\frac{d t}{\sqrt{1-k^2\sin^2t}}$$,

\begin{align} &\frac{1}{\sqrt{(a+x)^2+z^2}}K\left(\frac{2\sqrt{ax}}{\sqrt{(a+x)^2+z^2}}\right) \\ =& \int_0^{\pi/2}\frac{dt}{\sqrt{(a+x)^2+z^2-4ax\sin^2t}} \\ =& \int_0^{\pi/2}\frac{dt}{\sqrt{a^2+z^2+x^2+2ax\cos2t}} \\=& \frac14\int_{-\pi}^{\pi}\frac{d\phi}{\sqrt{a^2+z^2+x^2+2ax\cos \phi}}\quad \phi=2t \end{align}

The integrand is the reciprocal of the distance between $$(-x,\pi/2,0)$$ and $$\left(r=\sqrt{z^2+a^2},\theta=\arctan\dfrac az,\phi\right)$$ under spherical coordinate, so one can expand it into series of spherical harmonics, assuming $$x$$ sufficiently small $$\frac1{\sqrt{a^2+z^2+x^2+2ax\cos \phi}}=\sum_{l\ge0}\frac{(-x)^l}{r^{l+1}}\sum_{m=-l}^l(-1)^mP_l^{-m}(0)P_l^{m}(\cos\theta)e^{ i m\phi}$$ Perform the integral over $$\phi$$ and only the terms with $$m=0$$ remains, so $$\int_{-\pi}^{\pi}\frac{d\phi}{\sqrt{a^2+z^2+x^2-2ax\cos \phi}}=2\pi\sum_{l\ge0}\frac{(-x)^l}{r^{l+1}}P_l(0)P_l(\cos\theta)$$ Now use Ramanujan's Master Theorem with $$\varphi(l)=\frac\pi2\frac{1}{r^{l+1}}P_l(0)P_l(\cos\theta)$$

$$\mathcal M\left(\frac{\pi}2\sum_{l\ge0}\frac{x^l}{r^{l+1}}P_l(0)P_l(\cos\theta)\right)(s)=\frac\pi{\sin\pi s}\varphi(-s)\\ =\Gamma(s)\Gamma(1-s)\cdot\frac\pi2\frac{1}{r^{1-s}}P_{-s}(0)P_{-s}(\cos\theta)$$

Finally, recall the special value of Legendre function $$P_{\nu}(0)=\frac{\sqrt{\pi }}{\Gamma \left(\frac{1-\nu}{2}\right) \Gamma \left(\frac{\nu }{2}+1\right)}$$ and the duplication formula of Gamma function. After a little algebra, substitute$$r=\sqrt{a^2+z^2},\cos\theta=\frac{z}{\sqrt{a^2+z^2}}$$ and the result follows.

• Thank you very much for your answer. When discussing the 1/distance in the spherical coordinate system, I guess $\theta = \mathrm{arctan}\frac{z}{a}$ should be $\mathrm{arctan}\frac{a}{z}$. Am I correct ? Commented Feb 6, 2023 at 6:51
• I totally agree. I think it is just a typo and is fixed now. Commented Feb 6, 2023 at 10:11
• I have a question. When expanding 1/distance into a series, the assumption that $x$ is smaller than $\sqrt{a^2+z^2}$ is made to produce $(-x)^l$ form in the numerator. However, since the integration of x is performed until $\infty$ in Mellin transform, this assumption may be violated at large value of x somewhere. How should this problem understood ? Commented Feb 20, 2023 at 4:28
• The RMT only requires expansion at the origin (that is why it is powerful). You can refer to any proof of the master theorem to varify its validity. Commented Feb 20, 2023 at 4:39
• Thank you for clear explanation. I should check more details of the theorem; looks almost like a magic for me :). Commented Feb 20, 2023 at 4:48