TITLE: Prove the following integral is constant: $\int_{-1}^{+1} \frac{ \ln |a-x|^2 }{\sqrt{1 - x^2}} dx$
QUESTION [10 upvotes]: There is a famous improper integral with exact solution given by
$$\int_{0}^{+1} \frac{ \ln x }{\sqrt{1 - x^2}} dx = -\frac{\pi}{2} \ln 2$$
From this, it is pretty easy to generalize to the following variation:
$$\int_{-1}^{+1} \frac{ \ln |x|^2 }{\sqrt{1 - x^2}} dx = -2 \pi \ln 2$$
From what I can tell, we can even extend this further to show that:
$$\int_{-1}^{+1} \frac{ \ln |a-x|^2 }{\sqrt{1 - x^2}} dx = -2 \pi \ln 2$$
for any $|a| \leq 1$. Unfortunately, I have only been able to verify this numerically (i.e., testing it for various values in Wolfram Alpha). However, I cannot think of a straightforward way to prove it generally.
The identity has an interesting physics application I am working on. It shows that a surface charge density with the form
$$\sigma(x) = \frac{1}{\sqrt{1 - x^2}}$$
will also result in a constant potential along a thin strip from [-1,1]; an interesting result for transmission line models and a nice validation for simulation methods. I would love to see a straightforward proof of this. I suspect it has been done, as I have seen it mentioned in the literature. I just can't find a reference to it, and I do not see any easy way to replicate it myself.
Thanks in advance!

REPLY [3 votes]: Here is another explanation: Substitute $x = \cos\theta$. Then fof $|a| \leq 1$,
\begin{align*}
\int_{-1}^{1} \frac{\log|x - a|^2}{\sqrt{1-x^2}} \, \mathrm{d}x
&= 2 \int_{-1}^{1} \frac{\log|x - a|}{\sqrt{1-x^2}} \, \mathrm{d}x \\
&= 2 \int_{0}^{\pi} \log\left|\cos\theta - a\right| \, \mathrm{d}\theta \\
&= \int_{-\pi}^{\pi} \log\left|\cos\theta - a\right| \, \mathrm{d}\theta \\
&= \int_{-\pi}^{\pi} \left( \log\left|e^{2i\theta} - 2ae^{i\theta} + 1\right| - \log 2 \right) \, \mathrm{d}\theta \\
&= -2\pi \log 2 + \operatorname{Re}\left[ \frac{1}{i} \int_{|z|=1} \frac{\log(z^2 - 2az + 1)}{z} \, \mathrm{d}z \right],
\end{align*}
where we utilized the formula $\cos\theta = \frac{e^{i\theta} + e^{-i\theta}}{2}$ and $\log|z| = \operatorname{Re}(\log z)$. Since $z^2 - 2az + 1 = 0$ only at the points $a \pm i\sqrt{1-a^2}$ on the unit circle $|z| = 1$ and the integrand has only logarithmic singularities there, the Cauchy integration formula still works, giving
$$ \frac{1}{2\pi i} \int_{|z|=1} \frac{\log(z^2 - 2az + 1)}{z} \, \mathrm{d}z
= \left. \log(z^2 - 2az + 1)\right|_{z=0}
= 0. $$
Therefore the desired identity holds.