# Integrate ∫π03cosx+√8+cos2xsinxx dx\int_0^\pi\frac{3\cos x+\sqrt{8+\cos^2 x}}{\sin x}x\ \mathrm dx

I managed to calculate an indefinite integral of the left part:

where $\Im\ \text{Li}_2(z)$ denotes the imaginary part of the dilogarithm. The corresponding definite integral diverges. So, it looks like in the original integral summands compensate each other’s singularities to avoid divergence.

I tried a numerical integration and it looks plausible that

but I have no idea how to prove it.

Here’s one way to go.

First, note that

For now I’ll simply claim that

(I would be surprised if this integral has not been handled somewhere on this site.)
But

(The last sum can be found by standard methods.
Schematically, $\sum \frac{a^{2k-1}}{2k(2k-1)} = \sum \int {\mathrm da} \frac{a^{2k-2}}{2k}$.)
Thus, the integral is $\pi \log 54$ as claimed.

Proof of (1):
We have

Note that

and