<s>[INST] Integrate $\int_0^\pi\frac{3\cos x+\sqrt{8+\cos^2 x}}{\sin x}x\ \mathrm dx$ Please help me to solve this integral:
$$\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:
$$\int\frac{\cos x}{\sin x}x\ \mathrm dx=\ x\log(2\sin x)+\frac{1}{2} \Im\ \text{Li}_2(e^{2\ x\ i}),$$
where $\Im\ \text{Li}_2(z)$ denotes the imaginary part of the dilogarithm. The corresponding definite integral $$\int_0^\pi\frac{\cos x}{\sin x}x\ \mathrm dx$$ 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
$$\int_0^\pi\frac{3\cos x+\sqrt{8+\cos^2 x}}{\sin x}x\ \mathrm dx\stackrel{?}{=}\pi \log 54,$$
but I have no idea how to prove it.
 [/INST] Begin with $u$-substitution using 
$$\begin{align}
u & =x\\
dv & = \frac{3\cos(x)+\sqrt{8+\cos^2(x)}}{\sin(x)}\,dx\end{align}$$
so that $du=dx$, and my CAS tells me (which I suppose could be verified through differentiation and identities) that
$$\begin{align}
v & = \sinh^{-1}\left(\frac{\cos(x)}{\sqrt{8}}\right)+\frac{3}{2}\ln\left(\frac{3\sqrt{\cos^2(x)+8}-\cos(x)+8}{3\sqrt{\cos^2(x)+8}+\cos(x)+8}\right)+3\ln(1-\cos(x))
\end{align}$$
Now we have 
$$\begin{align}
\left[x\left(\sinh^{-1}\left(\frac{\cos(x)}{\sqrt{8}}\right)+\frac{3}{2}\ln\left(\frac{3\sqrt{\cos^2(x)+8}-\cos(x)+8}{3\sqrt{\cos^2(x)+8}+\cos(x)+8}\right)+3\ln(1-\cos(x))\right)\right]_0^\pi\\
-\int_0^\pi\left(\sinh^{-1}\left(\frac{\cos(x)}{\sqrt{8}}\right)+\frac{3}{2}\ln\left(\frac{3\sqrt{\cos^2(x)+8}-\cos(x)+8}{3\sqrt{\cos^2(x)+8}+\cos(x)+8}\right)+3\ln(1-\cos(x))\right)dx
\end{align}$$
and most of the integral part can be evaluated by taking advantage of symmetry about $\pi/2$:
$$\begin{align}
\left[x\left(\sinh^{-1}\left(\frac{\cos(x)}{\sqrt{8}}\right)+\frac{3}{2}\ln\left(\frac{3\sqrt{\cos^2(x)+8}-\cos(x)+8}{3\sqrt{\cos^2(x)+8}+\cos(x)+8}\right)+3\ln(1-\cos(x))\right)\right]_0^\pi\\
-3\int_0^\pi\ln(1-\cos(x))dx
\end{align}$$ 
($\sinh^{-1}$ is odd and $\cos(x)$ has odd symmetry about $\pi/2$. For the logarithmic term, the input to $\ln()$ at $x$ is the reciprocal of the input at $\pi/2-x$.) 
Some of the nonintegral-part can be cleanly evaluated:
$$\begin{align}
\pi\sinh^{-1}\left(\frac{-1}{\sqrt{8}}\right)+\frac{3\pi}{2}\ln\left(\frac{9}{8}\right)+\left[3x\ln(1-\cos(x))\right]_0^\pi\\
-3\int_0^\pi\ln(1-\cos(x))dx
\end{align}$$ 
and now moving the "unclean" part back into an integral:
$$\begin{align}
\pi\sinh^{-1}\left(\frac{-1}{\sqrt{8}}\right)+\frac{3\pi}{2}\ln\left(\frac{9}{8}\right)+\int_0^\pi\left(3\ln(1-\cos(x))+\frac{3x\sin(x)}{1-\cos(x)}\right)\,dx\\
-3\int_0^\pi\ln(1-\cos(x))dx\\
=\pi\sinh^{-1}\left(\frac{-1}{\sqrt{8}}\right)+\frac{3\pi}{2}\ln\left(\frac{9}{8}\right)+\int_0^\pi\frac{3x\sin(x)}{1-\cos(x)}\,dx
\end{align}$$ 
My CAS says this is
$$\begin{align}
\pi\sinh^{-1}\left(\frac{-1}{\sqrt{8}}\right)+\frac{3\pi}{2}\ln\left(\frac{9}{8}\right)+\pi\ln(64)
\end{align}$$
which is the only thing the CAS does that I don't quite get. But it's nothing special about endpoints: even WA can give an antiderivative if we can use the dilogarithm. It looks like an integral that might even appear somewhere on this site. A conversion of the arcsinh and logarithm rules yields
$$\begin{align}
\pi\ln(2^{-\frac{1}{2}})+\pi\ln\left(\frac{27}{8^{3/2}}\right)+\pi\ln(64)=\pi\ln(54)
\end{align}$$
</s>