TITLE: Integral $\int_{-1}^{1} \frac{1}{x}\sqrt{\frac{1+x}{1-x}} \log \left( \frac{(r-1)x^{2} + sx + 1}{(r-1)x^{2} - sx + 1} \right) \, \mathrm dx$
QUESTION [54 upvotes]: Regarding this problem, I conjectured that 
$$ I(r, s) = \int_{-1}^{1} \frac{1}{x}\sqrt{\frac{1+x}{1-x}} \log \left( \frac{(r-1)x^{2} + sx + 1}{(r-1)x^{2} - sx + 1} \right) \, \mathrm dx = 4 \pi \operatorname{arccot} \sqrt{ \frac{2r + 2\sqrt{r^{2} - s^{2}}}{s^{2}} - 1}. $$
Though we may try the same technique as in the previous problem, now I'm curious if this generality leads us to a different (and possible a more elegant) proof.
Indeed, I observed that $I(r, 0) = 0$ and
$$\frac{\partial I}{\partial s}(r, s) = \int_{0}^{\infty} \left\{ \frac{2\sqrt{y}}{(r-s)y^{2} + 2(2-r)y + (r+s)}+\frac{2\sqrt{y}}{(r+s)y^{2}+ 2(2-r)y + (r-s)} \right\} \,\mathrm dy, $$
which can be evaluated using standard contour integration technique. But simplifying the residue and integrating them seems still daunting.

EDIT. By applying a series of change of variables, I noticed that the problem is equivalent to prove that
$$ \tilde{I}(\alpha, s) := \int_{-1}^{1} \frac{1}{x}\sqrt{\frac{1+x}{1-x}} \log \left( \frac{ 1 + 2sx \sin\alpha + (s^{2} - \cos^{2}\alpha) x^{2}}{ 1 - 2sx \sin\alpha + (s^{2} - \cos^{2}\alpha) x^{2}} \right) \, \mathrm dx = 4\pi \alpha $$
for $-\frac{\pi}{2} < \alpha < \frac{\pi}{2}$ and $s > 1$. (This is equivalent to the condition that the expression inside the logarithm is positive for all $x \in \Bbb{R}$.)
Another simple observation. once you prove that $\tilde{I}(\alpha, s)$ does not depend on the variable $s$ for $s > 1$, then by suitable limiting process it follows that
$$ \tilde{I}(\alpha, s) = \int_{-\infty}^{\infty} \log \left( \frac{ 1 + 2x \sin\alpha + x^{2}}{ 1 - 2x \sin\alpha + x^{2}} \right) \, \frac{\mathrm dx}{x}, $$
which (I guess) can be calculated by hand. The following graph may also help us understand the behavior of this integral.

REPLY [26 votes]: Just for references, I remark that the following proposition was proved in my answer:

Proposition. If $0 < r < 1$ and $r < s$, then
  $$ I(r, s) := \int_{-1}^{1} \frac{1}{x} \sqrt{\frac{1+x}{1-x}} \log \left( \frac{1 + 2rsx + (r^{2} + s^{2} - 1)x^{2}}{1 - 2rsx + (r^{2} + s^{2} - 1)x^{2}} \right) \, dx = 4\pi \arcsin r. \tag{*} $$

Recently, I found an alternate proof which is much simpler and does not use contour integration technique.

Lemma 1. For any $k = 0, 1, 2, \cdots$ we have
  $$ \int_{0}^{1} \frac{x^{2k}}{\sqrt{1-x^{2}}} \, dx
= (-1)^{k} \frac{\pi}{2} \binom{-1/2}{k}. $$

Since this is so famous, we skip the proof.

Lemma 2. For any $z \in \Bbb{C}$ with $|z| \leq 1$, we have
  $$ f(z)
:= - \int_{-1}^{1} \frac{1}{x} \sqrt{\frac{1+x}{1-x}} \log(1 - zx) \, dz= \pi \sin^{-1} z - \pi \log \left( \tfrac{1}{2}+\tfrac{1}{2}\sqrt{1-z^{2}} \right) . \tag{1} $$

Proof of Lemma. Expand $-\log(1-zx)$ using the MacLaurin series. Then we have
$$ f(z) = \sum_{n=1}^{\infty} \frac{z^{n}}{n} \int_{-1}^{1} x^{n-1} \sqrt{\frac{1+x}{1-x}} \, dx. \tag{2} $$
To identify the coefficient, we observe that
\begin{align*}
\int_{-1}^{1} x^{n-1} \sqrt{\frac{1+x}{1-x}} \, dx
&= \int_{0}^{1} x^{n-1} \sqrt{\frac{1+x}{1-x}} \, dx + \int_{-1}^{0} x^{n-1} \sqrt{\frac{1+x}{1-x}} \, dx \\
&= \int_{0}^{1} x^{n-1} \frac{(1+x) + (-1)^{n-1}(1-x)}{\sqrt{1-x^{2}}} \, dx
\end{align*}
Dividing the cases based on the parity of $n$, it follows that
$$ \int_{-1}^{1} x^{n-1} \sqrt{\frac{1+x}{1-x}} \, dx = \begin{cases}
\displaystyle 2\int_{0}^{1} \frac{x^{n}}{\sqrt{1-x^{2}}} \, dx, & n \text{ even} \\
\displaystyle 2\int_{0}^{1} \frac{x^{n-1}}{\sqrt{1-x^{2}}} \, dx, & n \text{ odd}.
\end{cases}. $$
Thus by Lemma 1 we know an exact formula for the coefficients of $f(z)$ in $\text{(2)}$, and we obtain
\begin{align*}
f(z)
&= \pi \sum_{k=0}^{\infty} \binom{-1/2}{k} \frac{(-1)^{k} z^{2k+1}}{2k+1} + \pi \sum_{k=1}^{\infty} \binom{-1/2}{k} \frac{(-1)^{k} z^{2k}}{2k} \\
&= \pi \int_{0}^{z} \frac{dw}{\sqrt{1- w^{2}}} + \pi \int_{0}^{z} \left( \frac{1}{\sqrt{1- w^{2}}} - 1 \right) \, \frac{dw}{w}.
\end{align*}
Therefore evaluating the last integral yields $\text{(1)}$ as desired. ////
Proof of Proposition. Now let us return to the proof of our proposition. Let $r = \cos\alpha$ and $s = \cos\beta$ for any $\alpha, \beta \in \Bbb{R}$. Then by a simple application of trigonometry, we find that
$$ 1 \pm 2rsx + (r^{2} + s^{2} - 1)x^{2} = (1 \pm x \cos(\alpha+\beta))(1 \pm x \cos(\alpha-\beta)). $$
So it follows that
\begin{align*}
I(r, s)
&= f(\cos(\alpha+\beta)) + f(\cos(\alpha-\beta)) - f(-\cos(\alpha+\beta)) - f(\cos(\alpha-\beta)) \\
&= 2\pi \sin^{-1}\cos(\alpha+\beta) + 2\pi \sin^{-1}\cos(\alpha-\beta).
\end{align*}
If we restrict our attention to the case $0 < \alpha < \beta < \pi/2$, then it follows that we have
\begin{align*}
I(r, s)
&= 2\pi \sin^{-1}\cos(\alpha+\beta) + 2\pi \sin^{-1}\cos(\alpha-\beta) \\
&= 4\pi ( \tfrac{\pi}{2} - \alpha ) \\
&= 4\pi \arcsin r.
\end{align*}
This completes the proof.