<s>[INST] 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?
 [/INST] 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)$$
</s>