Closed form for the integral $\int_{-1}^{1} \frac{\ln[(1+x^2)~ -x\sqrt{k+x^2}]}{\sqrt{1-x^2}}\mathrm dx$ 
Somewhere, the integral
$$\int_{-1}^{1} \frac{\ln[(1+x^2)~ -x\sqrt{k+x^2}]}{\sqrt{1-x^2}}\mathrm dx$$
has been found numerically to be real and finite, if $k \in (-\infty,3].$

Can one find a closed form for this integral?
 A: $$I=\int_{-1}^{1} \frac{\ln[(1+x^2) -x\sqrt{k+x^2}]}{\sqrt{1-x^2}}dx$$
Split in two parts and let $x\to-x$ for the $(-1,0)$ interval to see that:
$$ I=\int_{0}^{1} \frac{\ln[(1+x^2) +x\sqrt{k+x^2}]}{\sqrt{1-x^2}}dx+\int_{0}^{1} \frac{\ln[(1+x^2) -x\sqrt{k+x^2}]}{\sqrt{1-x^2}}dx$$
$$=\int_0^1 \frac{\ln(1+(2-k)x^2)}{\sqrt{1-x^2}}dx\overset{x=\sin t}=\int_0^\frac{\pi}{2} \ln(1+(2-k)\sin^2 t)dt\overset{t=\operatorname{arccot x}}=\int_0^\infty \frac{\ln\left(\frac{3-k+x^2}{1+x^2}\right)}{1+x^2}dx$$
For simplicity let's put $3-k=a$, then we have:
$$I(a)=\int_0^\infty \frac{\ln(a+x^2)-\ln(1+x^2)}{1+x^2}dx\Rightarrow I'(a)=\int_0^\infty \frac{1}{(1+x^2)(a+x^2)}dx$$
$$=\frac{1}{1-a}\left(\int_0^\infty \frac{1}{a+x^2}dx-\int_0^\infty \frac{1}{1+x^2}dx\right)=\frac{1}{1-a}\left(\frac{1}{\sqrt a}\cdot  \frac{\pi}{2}-\frac{\pi}{2}\right)=\frac{\pi}{2}\frac{1}{\sqrt a(1+\sqrt a)}$$
Now we have to integrate back, but notice that $I(1)=0$ then:
$$I(a)=\frac{\pi}{2} \int_1^a\frac{1}{\sqrt x(1+\sqrt x)}dx\overset{\sqrt x=t}=\pi \int_1^{\sqrt a}\frac{1}{1+t}dt=\pi \ln(1+\sqrt a)-\pi \ln 2 $$
Finally, returning back to $k$ we can write the closed form as:
$$\boxed{\int_{-1}^{1} \frac{\ln[(1+x^2) -x\sqrt{k+x^2}]}{\sqrt{1-x^2}}dx=\pi\ln\left(\frac{1+\sqrt{3-k}}{2}\right)}$$
A: Denoting the integral by $I(k)$, let us use $\int_{-a}^{a}f(x)dx, =\int_{0}^{a} [f(x)+f(-x)] dx,$ then
$$I(k)=\int_{-1}^{1} \frac{\ln[1+x^2-x\sqrt{k+x^2}]}{\sqrt{1-x^2}} dx= \int_{0}^{1} \frac{\ln[1+(2-k)x^2]}{\sqrt{1-x^2}}dx =\frac{1}{2} \int_{0}^{\pi} \ln \left (\frac{1+r^2}{2}+\frac{1-r^2}{2} \cos \theta \right) d \theta,$$ where we took $x=\sin(\theta/2)$ and $r^2=3-k$.
Next, we take $g(p)=\int_{0}^{\pi} \ln(p+q \cos\theta) d\theta$ , then $g'(p)=\int_{0}^{\pi} \frac{d\theta} {(p+q \cos \theta)}$. We can write
$$2g'(p)=\int_{0}^{\pi} \left( \frac{1}{p+q \cos \theta}+\frac{1}{p-q \cos \theta}\right) d\theta=$$
$$2p \int_{0}^{\pi} \frac{d\theta}{p^2-q^2 \cos^2 \theta}=2p\int_{0}^{\pi/2} \frac{\mbox{sec}^2\theta ~d\theta}{\tan^2\theta+(p^2-q^2)/p^2}.$$
$$\Rightarrow g'(p)=\frac{\pi}{\sqrt{p^2-q^2}} \Rightarrow g(p)=\pi \ln \frac{p+\sqrt{p^2-q^2}}{2}, ~p=\frac{1+r^2}{2},~ q=\frac{1-r^2}{2}.$$ Hence $$I(k)=\pi \ln \left(\frac{1+\sqrt{3-k}}{2} \right)$$
