Computing $\int_{0}^{\pi}\ln\left(1-2a\cos x+a^2\right) \, dx$ 
For $a\ge 0$ let's define $$I(a)=\int_{0}^{\pi}\ln\left(1-2a\cos x+a^2\right)dx.$$ Find explicit formula for $I(a)$.

My attempt: Let
$$\begin{align*}
f_n(x)
&= \frac{\ln\left(1-2
\left(a+\frac{1}{n}\right)\cos x+\left(a+\frac{1}{n}\right)^2\right)-\ln\left(1-2a\cos x+a^2\right)}{\frac{1}{n}}\\
&=\frac{\ln\left(\displaystyle\frac{1-2
\left(a+\frac{1}{n}\right)\cos x+\left(a+\frac{1}{n}\right)^2}{1-2a\cos x+a^2}\right)}{\frac{1}{n}}\\
&=\frac{\ln\left(1+\dfrac{1}{n}\left(\displaystyle\frac{2a-2\cos x+\frac{1}{n}}{1-2a\cos x+a^2}\right)\right)}{\frac{1}{n}}.
\end{align*}$$
Now it is easy to see that $f_n(x) \to \frac{2a-2\cos x}{1-2a\cos x+a^2}$ as $n \to \infty$. $|f_n(x)|\le \frac{2a+2}{(1-a)^2}$ RHS is integrable so $\lim_{n\to\infty}\int_0^\pi f_n(x)dx = \int_0^\pi \frac{2a-2\cos x}{1-2a\cos x+a^2} dx=I'(a)$. But 
$$\int_0^\pi \frac{2a-2\cos x}{1-2a\cos x+a^2}=\int_0^\pi\left(1-\frac{(1-a)^2}{1-2a\cos x+a^2}\right)dx.$$ Consider
$$\int_0^\pi\frac{dx}{1-2a\cos x+a^2}=\int_0^\infty\frac{\frac{dy}{1+t^2}}{1-2a\frac{1-t^2}{1+t^2}+a^2}=\int_0^\infty\frac{dt}{1+t^2-2a(1-t^2)+a^2(1+t^2)}=\int_0^\infty\frac{dt}{(1-a)^2+\left((1+a)t\right)^2}\stackrel{(*)}{=}\frac{1}{(1-a)^2}\int_0^\infty\frac{dt}{1+\left(\frac{1+a}{1-a}t\right)^2}=\frac{1}{(1-a)(1+a)}\int_0^\infty\frac{du}{1+u^2}=\frac{1}{(1-a)(1+a)}\frac{\pi}{2}.$$
So $$I'(a)=\frac{\pi}{2}\left(2-\frac{1-a}{1+a}\right)\Rightarrow I(a)=\frac{\pi}{2}\left(3a-2\ln\left(a+1\right)\right).$$
It looks too easy, is there any crucial lack?
$(*)$ — we have to check $a=1$ here by hand and actually consider $[0,1), (1,\infty)$ but result on these two intervals may differ only by constant - it may be important but in my opinion not crucial for this proof.

For some reason, this problem appeared on the main page for me even though the problem was posted quite a while ago. Let me present an alternative approach which does not really require any integrating.
Let us consider your integral:
$$I(a)=\int_{0}^{\pi}\ln\left(1-2a\cos(x)+a^2\right)\ \text{d}x,\;\ a>1$$
Consider a triangle $ABC$ with angles $\alpha,\beta,\gamma$ opposite to the sides $a,b,c$, respectively:

The law of cosines states
$$c^2=a^2+b^2-2ab\cos(\gamma)$$
To keep with this notation, let $b=1$ and $\gamma=x$.
Our integral becomes
$$\begin{align}
I(a) & = \int_{0}^{\pi}\ln\left(c^2\right)\ \text{d}\gamma \\
 & = 2\int_{0}^{\pi}\ln\left(c\right)\ \text{d}\gamma \\ 
\end{align}$$
The law of sines states
$$\frac{\sin(\alpha)}{a}=\frac{\sin(\beta)}{b}=\frac{\sin(\gamma)}{c}$$
Our integral becomes
$$\begin{align}
I(a) & = 2\int_{0}^{\pi}\ln\left(a\ \frac{\sin(\gamma)}{\sin(\alpha)}\right)\ \text{d}\gamma \\
 & = 2\pi \ln(a)+2\int_{0}^{\pi}\ln\left(\sin(\gamma)\right)\ \text{d}\gamma-2\int_{0}^{\pi}\ln\left(\sin(\alpha)\right)\ \text{d}\gamma \\ 
\end{align}$$
Consider the right-hand integral. In a triangle, the three angles $\alpha,\beta,\gamma$ add up to $\pi$ radians. Let $\gamma=\pi-\alpha-\beta$ such that $\text{d}\gamma=-\text{d}\alpha-\text{d}\beta$. 
When $\gamma\rightarrow 0:\alpha\rightarrow \pi,\beta\rightarrow 0$. When $\gamma\rightarrow \pi:\alpha\rightarrow 0,\ \beta\rightarrow 0$.
Our integral becomes
$$\begin{align}
I(a) & = 2\pi \ln(a)+2\int_{0}^{\pi}\ln\left(\sin(\gamma)\right)\ \text{d}\gamma\\
 & -2\left[\int_{\pi}^{0}\ln\left(\sin(\alpha)\right)(-\text{d}\alpha)+\int_{0}^{0}\ln\left(\sin(\alpha)\right)(-\text{d}\beta)\right] \\
 & = 2\pi \ln(a)+2\int_{0}^{\pi}\ln\left(\sin(\gamma)\right)\ \text{d}\gamma-2\int_{0}^{\pi}\ln\left(\sin(\alpha)\right)\ \text{d}\alpha \\ 
\end{align}$$
Recognize that the integrals evaluate to the same value and therefore will cancel out each other.
$$I(a)=2\pi\ln(a),\;\ a>1$$
