Hi I am trying to calculate,
$$ \int_0^a \ln \left( \frac{b-\sqrt{a^2-x^2}}{b+\sqrt{a^2-x^2}} \right)dx $$ where $a,b$ are positive real constants. I Know $\ln(xy)=\ln x +\ln y$, but I do not know how to evaluate this integral then. I need to find a closed form for the indefinite integral $$ \int \ln \big(b\pm \sqrt{a^2-x^2}\big) dx $$ so this is really the problem I am facing. The closed form exists and is in terms of elementary functions. Thanks!
This is a possible way (I assume $a\geq 0$, $b\geq 0$):
1) substitute $x= a \sin t $.
2) integrate the resulting integral by parts to get rid of $\ln$
3) you should end up with $$-\int_0^{\pi/2}\frac{2 a^2 b \sin^2 t\,dt }{b^2 -a^2 \cos^2 t} .$$
4) it is possible to integrate the last integral by elementary means or using the residue theorem. You should obtain $$\pi \left(\sqrt{b^2 -a^2} -b\right).$$
Edit:
Here are the steps in a bit more detail ($0\leq a \leq b$):
1) after subsitution $x= a \sin t$ with $dx = a \cos t\, dt$ we obtain $$ a \int_{0}^{\pi/2} \!dt\,\cos t\, \ln \left( \frac{b -a \cos t}{b+a \cos t} \right). $$
2) Integration by parts (where $\cos t$ is integrated and the rest differentiated) leads directly to $$ a \sin t \, \ln \left( \frac{b -a \cos t}{b+a \cos t} \right) \Bigg|_{0}^{\pi/2} - a \int_0^{\pi/2}\!dt\, \sin t \frac{b+ a \cos t}{b -a \cos t} \frac{2 a b}{(b+ a \cos t)^2} \sin t\\ = - 2 a^2 b \int_0^{\pi/2}\!dt\, \frac{\sin^2 t}{b^2 -a ^2 \cos^2 t}.$$
3) Now use the substitution $s= \tan t$ with $ds = (1+s^2) dt =\cos^{-2} t\, dt$ as proposed by sos440. This leads to $$ -2 a^2 b \int_0^{\infty}\!\frac{ds}{1+s^2}\, \frac{\sin^2 t}{b^2 -a^2\cos^2 t} = -2 a^2 b \int_0^{\infty}\!ds\, \frac{s^2}{(1+s^2)[b^2 (1+s^2)-a^2]}.$$
4) Employing the partial fraction expansion on the last integrand, you obtain $$ -2 b \int_0^\infty\frac{ds}{1+s^2} + \frac{2(b^2-a^2)}{b} \int_0^\infty \frac{ds}{s^2 +1 - (a/b)^2} .$$ Thus, we need to evaluate the integral $$\int_0^\infty \frac{ds}{s^2+\alpha^2} = \alpha^{-1} \arctan(s/\alpha) \big|_{0}^{\infty} = \frac{\pi}{2\alpha},$$ and we obtain the final result (with $\alpha=1$ and $\alpha= \sqrt{1-(a/b)^2}$) $$ -\pi b + \frac{(b^2-a^2)\pi}{b \sqrt{1-(a/b)^2}} .$$