<s>[INST] Definite Integral $\int_{1-\sqrt{a}}^{1+\sqrt{a}} \ln(1-z t^2)\frac{\sqrt{4a-(t^2-1-a)^2}}{t}\, dt$ Suppose $z<\frac{1}{(1+\sqrt{a})^2}$, $0<a<1$. I need to compute the following integral as function of z:
$$
I(z)= \int_{1-\sqrt{a}}^{1+\sqrt{a}} \ln(1-z t^2)\frac{\sqrt{4a-(t^2-1-a)^2}}{t}\, dt
$$
So far, following the trick in this question I defined
$$
J'(p)=\int_{1-\sqrt{a}}^{1+\sqrt{a}} \frac{t}{p t^2 -1}\sqrt{4a-(t^2-1-a)^2}\, dt
$$
With the change of variable $t^2-1-a = x$,
$$
J'(p)=\frac{1}{2} \int_{-2\sqrt{a}}^{2\sqrt{a}} \frac{\sqrt{4a-x^2}}{px + p(a+1)-1}\, dx
$$
Doing the Euler substitution $x = 2\sqrt{a}\frac{t^2-1}{t^2+1}$, we have (using Mathematica)
$$
J'(p) = 16 a \int_0^{\infty}\frac{t^2}{(t^2+1)^2 \bigg( \Big[p\big(\sqrt{a}+1\big)^2-1\Big]t^2+p\big(\sqrt{a}-1)^2-1\bigg)} \, dt
$$
\begin{equation}
\begin{split}
J'(p) &= 16 a \int_0^{\infty}\frac{t^2}{(t^2+1)^2 \bigg( \Big[p\big(\sqrt{a}+1\big)^2-1\Big]t^2+p\big(\sqrt{a}-1)^2-1\bigg)} \, dt \\
&= \frac{\pi}{2} \frac{-1+p(a+1)+\Big(1-\big(\sqrt{a}-1\big)^2p\Big)\sqrt{\frac{-1+\big(\sqrt{a}+1\big)^2p}{-1+\big(\sqrt{a}-1\big)^2p}}}{p^2}
\end{split}
\end{equation}
Now, to find $I(z) = \int_0^z J'(p) \, dp$, there is a problem that in the $J'(p)$ there is a logarithm of $p$ which makes it undefined at 0.
 [/INST] With the substitution $x=\frac{ t^2-1-a}{2\sqrt a}$, along with the shorthands $p= \frac{2z\sqrt a}{1-z-az}$, $q= \frac{1+a}{2\sqrt a} $, the integral simplifies to
\begin{align}
I(z)=& \int_{1-\sqrt{a}}^{1+\sqrt{a}} \ln(1-z t^2)\frac{\sqrt{4a-(t^2-1-a)^2}}{t}\, dt\\
=& \sqrt a\int_{-1}^1 [\ln(1-z-az)+\ln (1-p x)]\frac{\sqrt{1-x^2}}{q+x}dx \\
= & \>\pi a\ln(1-z-az)+\sqrt a \>J(p)
\end{align}
where $\int_{-1}^1 \frac{ \sqrt{1-x^2}}{q+x}dx = \pi \sqrt a$ is used and
\begin{align}
 J(s) =&\int_{-1}^1 \frac{\ln (1-s x) \sqrt{1-x^2}}{q+x}dx \\
J’(s)=& -\int_{-1}^1 
\frac{x \sqrt{1-x^2}}{(1-s x)(q+x)}dx \\
=& \frac1{1+sq}\int_{-1}^1 \left(\frac{q\sqrt{1-x^2}}{x+q}- \frac{\sqrt{1-x^2}}{1-s x}\right)dx\\
= & \frac\pi{1+sq}\left(\frac{1+a}2
-\frac{1-\sqrt{1-s^2}}{s^2} \right)
\end{align}
Then
\begin{align}
I(z)=& \>a\pi \ln(1-z-az)+\sqrt a \int_0^p J’(s)ds
 = - \pi\sqrt{a} \int_0^p \frac{1-\sqrt{1-s^2}}{s^2(1+sq)} ds\\
= &- \pi\sqrt{a}\bigg[ \sqrt{q^2-1} \> \bigg(\tanh^{-1}\frac{p+q}{\sqrt{(q^2-1)(1-p^2)}}
  - \tanh^{-1} \frac{q}{\sqrt{q^2-1}}\bigg)
\\& \hspace{9mm}-q\,{\rm \tanh^{-1}}\sqrt{1-p^2} 
+ q \ln\frac{2(1+pq)}{p} +\frac{\sqrt{1-p^2}-1}p \bigg]
\end{align}
</s>