# Difficult integral from general relativity $\int_{a}^{0} \frac{1+mu}{\sqrt{u-a} \sqrt{b-u}} \,du$

When solving for the angular deflection of a light ray passing close to a star in general relativity, one needs to compute an elliptic integral. By some clever factoring and application of a relevant approximation, one reduces the problem to $$\Delta \phi = -2\int_{a}^{0} \frac{1+mu}{\sqrt{u-a} \sqrt{b-u}} \,du$$ I know (and have verified with Mathematica) that this has exact solution $$\Delta \phi = 2m\sqrt{-ab}+[4+2m(a+b)]\arctan\left(-\sqrt\frac{a}{b}\right),$$ but do not see how to replicate this solution. I've tried reverse engineering this in the case integration by parts was used but can't quite figure it out. Also, is there a complex contour integration approach - perhaps on the dogbone contour? Any hint or point to relevant literature would be appreciated. Thanks.

• Use $u=a+(b-a)\sin^2t$.
– J.G.
Jun 9, 2022 at 21:39
• Typically, complex analysis techniques are only going to work when you have something like $\int_0^\infty$ or $\int_0^{2\pi}$. Jun 9, 2022 at 21:58
• In general, integrals with square roots of a single quadratic polynomial, and some other polynomial stuff, are evaluable in elementary terms. Jun 9, 2022 at 21:58
• @TedShifrin Not if you use a dogbone contour.
– J.G.
Jun 10, 2022 at 18:07
• @J.G. Agreed. Provided the endpoints of the integral — the doggy bone's ends — are at the branch points (not the case here); and then one must analyze points at infinity on the Riemann surface and apply the Residue Theorem appropriately. Jun 10, 2022 at 18:35

Hmm. We have \begin{align*} -2\int_{a}^{0} \frac{1+mu}{\sqrt{u-a} \sqrt{b-u}} \,du &=2\int_{0}^{a} \frac{1+mu}{\sqrt{(u-a)(b-u)}} \,du \\ &=2\int_{0}^{a} \frac{1+mu}{\sqrt{-(u^2-u(b+a)+ab)}} \,du \\ &=2\int_{0}^{a} \frac{1+mu}{\sqrt{-\left(\left(u-\frac{b+a}{2}\right)^{\!2}-\frac{(b-a)^2}{4}\right)}} \,du \\ &=2\int_{0}^{a} \frac{1+mu}{\sqrt{\frac{(b-a)^2}{4}-\left(u-\frac{b+a}{2}\right)^{\!2}}} \,du. \end{align*} From here, it seems advisable to substitute \begin{align*} v&=u-\frac{b+a}{2}\\ dv&=du \end{align*} to obtain \begin{align*} \Delta\phi &=2\int_{-(b+a)/2}^{(a-b)/2} \frac{1+m(v+(b+a)/2)}{\sqrt{\frac{(b-a)^2}{4}-v^2}} \,dv \\ &=2\int_{-(b+a)/2}^{(a-b)/2} \frac{(1+m(a+b)/2)+mv}{\sqrt{\frac{(b-a)^2}{4}-v^2}} \,dv \\ &=(2+m(a+b))\int_{-(b+a)/2}^{(a-b)/2} \frac{1}{\sqrt{\frac{(b-a)^2}{4}-v^2}} \,dv+2m\int_{-(b+a)/2}^{(a-b)/2} \frac{v}{\sqrt{\frac{(b-a)^2}{4}-v^2}} \,dv. \end{align*} The antiderivative of the first gives you the $$\arctan$$ function via trigonometric substitution, and the second is the square root function via substitution.
Substitute $$u=\frac{b y^2+a}{1+y^2}$$ to remove the square-root in the denominator \begin{align} \Delta \phi =& -2\int_{a}^{0} \frac{1+mu}{\sqrt{u-a} \sqrt{b-u}} \,du\\ =& -4\int_0^{\sqrt{\frac{-a}b}}\frac{(bm+1)y^2+(am+1)}{(1+y^2)^2}dy\\ =&\ \bigg(\frac{2(b-a)my}{1+y^2}-[2(a+b)m+4]\tan^{-1} y\bigg)\bigg|_0^{\sqrt{\frac{-a}b}}\\ = &\ 2m\sqrt{-ab}-[2m(a+b)+4]\tan^{-1}\sqrt{\frac{-a}b} \end{align} (Note that the result cited in the post is incorrect.)
• @AdrianKeister - Agree, not obvious. But, I did enough with $\sqrt{(b-u)(u-a)}$ in the denominator to know this sub would lead to $\arctan$ in its antiderivative, while yours leads to $\arcsin$. Jun 10, 2022 at 17:15