# Evaluating $\int_{0}^{\pi\over 2}{\mathrm dx\over \cos(x)+\cos^2(x)}\ln\left({1+a\cos(x)\over 1-a\cos(x)}\right)$

I am trying to evaluate this integral, where $a<1$ $$\int_{0}^{\pi\over 2}{\mathrm dx\over \cos(x)+\cos^2(x)}\ln\left({1+a\cos(x)\over 1-a\cos(x)}\right)$$

It is look obvious to enforce a substitution of $u=cos(x)$ because of it commonly appeared in the integral.

$\sin(x)=\sqrt{1-u^2}$

$\mathrm du=-\sin(x)\mathrm dx=-\sqrt{1-u^2}\mathrm dx$

$$\int_{0}^{1}{\mathrm du\over (u+u^2)\sqrt{1-u^2}}\ln\left({1+au\over 1-au}\right)$$

This part $\ln\left({1+au\over 1-au}\right)$ still not simplify, so we make a substitution of $v=\ln\left({1+au\over 1-au}\right)$

which lead to after a very long process of simplification

$$\int_{0}^{k}ve^{v\over 2}\cdot{e^v+1\over e^v-1}\cdot{\mathrm dv\over a(e^v+1)+e^v-1}$$ where $k=\ln\left({1+a\over 1-a}\right)$

This is now involving hyperbolic functions, but I don't how to use it. Where

$\tanh\left(v\over 2\right)={e^v-1\over e^v+1}$

$2e^v\sinh(v)=e^v-1$

$2e^v\cosh(v)=e^v+1$

This is how far I got to, unfortunately I can't continued. Can anyone please point me in the right direction to complete the calculation or help to evalaute the integral. Thank.

Let $I(a) = \int_0^{\pi/2} \frac{1}{\cos x(1+\cos x)}\ln(\frac{1+a\cos x}{1-a \cos x})dx$. Then $I'(a) = \int_0^{\pi/2} \frac{1}{1+\cos x}[\frac{1}{1+a\cos x}+\frac{1}{1-a\cos x}]dx$. Let $J(a) = \int_0^{\pi/2} \frac{1}{1+\cos x}\frac{1}{1+a\cos x}dx$. Then $\theta = \tan(\frac{x}{2})$ gives $J(a) = \int_0^1 \frac{1+\theta^2}{1+\theta^2+a(1-\theta^2)}d\theta$. Note $J(a) = \frac{1}{1-a}-\frac{2a\arctan(\sqrt{\frac{1-a}{1+a}})}{(1-a)\sqrt{1-a^2}}$ (the indefinite integral is the same thing but with an $\theta$ replacing the top "1" in the first term, and a $\theta$ in the arctan in the second term). So, $I'(a) = J(a)+J(-a)$ is determined. I have to go now, but this should be enough.
Assuming $|a|<1$ $$\int_{0}^{\pi/2}\frac{2\,\text{arctanh}(a\cos\theta)}{\cos\theta(1+\cos\theta)}\,d\theta = \sum_{n\geq 0}\frac{2a^{2n+1}}{2n+1}\int_{0}^{\pi/2}\frac{\cos^{2n}\theta}{1+\cos\theta}\,d\theta\tag{1}$$ and $$\int_{0}^{\pi/2}\frac{\cos^{2n}\theta}{2\cos^2\frac{\theta}{2}}\,d\theta\stackrel{\theta\mapsto 2\arctan t}{=}\int_{0}^{1}\left(\frac{1-t^2}{1+t^2}\right)^{2n}\,dt\stackrel{\frac{1-t^2}{1+t^2}\mapsto u}{=}\int_{0}^{1}\frac{u^{2n}(1-u)}{(1-u^2)^{3/2}}\,du\tag{2}$$ can be evaluated in terms of central binomial coefficients due to Euler's beta function.
It follows that the final outcome can be expressed by exploiting the well-known Taylor series of $(1-a^2)^{\pm 1/2}$, $\arcsin(a)$ and $\arcsin(a)(1-a^2)^{\pm 1/2}$. See also this related question.