Artificial intelligent assistant

Prove this integral related to the Ising model I came across this integral when learning the Ising model. Without external field Onsager's solution of a 2D square lattice with $J_2=0$ should equal the solution of a 1D Ising model, which leads to this $$ \int_0^{2\pi}\ln \left(\cosh 2K-\sinh 2K\cos\theta\right)\,\mathrm{d}\theta=4\pi\ln\cosh K $$ where $K\in\mathbb{R}$. I tested this integral numerically using Mathematica and it holds. But I want to prove it. I tried splitting the LHS to $$ 2\pi\ln\cosh2K+\int_0^{2\pi}\ln(1-\tanh 2K\cos\theta)\,\mathrm{d}\theta $$ and expanding the log function using Taylor series, but then the integration result became a complicated series $$ -\sum_{n=1}^\infty \frac{1}{2n}\frac{2\pi}{4^n}\binom{2n}{n}\tanh^{2n}2K $$ which does not easily relate to the RHS. Anyone has better idea? Ising model is famous so this may have been done long ago.

We will assume $K$ is real and positive.

Let $c = \cosh K$ and $s = \sinh K$. Notice $\cosh(2K) = c^2+s^2$ and $\sinh(2K) = 2sc$.
The integral at hand $\mathcal{I}$ equals to

$$\begin{align}\mathcal{I} &= \int_0^{2\pi} \log(c^2+s^2 - 2sc\cos\theta) d\theta = \int_0^{2\pi} \log((c -s e^{i\theta})(c - s e^{-i\theta})) d\theta\\\ &= 2\Re\left[\int_0^{2\pi} \log(c - se^{i\theta}) d\theta\right] \end{align} $$ Change variable to $z = e^{i\theta}$, the integral inside the bracket can be rewritten as a contour integral over the unit circle.

$$\mathcal{I} = 4\pi\Re\left[\frac{1}{2\pi i}\int_{|z|=1} \log(c - sz) \frac{dz}{z}\right]$$

Notice $c > s > 0$, the function $\log(c - sz)$ is entire over some open circle the contains the closed unit disk. By Cauchy integral formula, we get $$\mathcal{I} = 4\pi\Re\left[ \log(c- s\cdot 0))\right] = 4\pi\log(c) = 4\pi\log(\cosh K)$$

xcX3v84RxoQ-4GxG32940ukFUIEgYdPy a1240f32106a6cc587ab1e7a84dbd17a