Evaluate $\int_{0}^{\pi}x\ln[b^{2a}+2b^a\cos(ax)+1]dx$ How to evaluate this integral?
Let $(a,b)\ge2$
$$I=\int_{0}^{\pi}x\ln[b^{2a}+2b^a\cos(ax)+1]\mathrm dx$$
$u=\ln[b^{2a}+2b^a\cos(ax)+1]$
$u^{'}=\frac{2ab^a\sin(ax)}{b^{2a}+2b^a\cos(ax)+1}$
$v=\int x=\frac{x^2}{2}$
$$I=\frac{x^2}{2}\cdot \ln[b^{2a}+2b^a\cos(ax)+1]-\int\frac{ab^ax^2\sin(ax)}{b^{2a}+2b^a\cos(ax)+1}\mathrm dx$$
$$I=\pi^2\cdot \ln(b^a+1)-\int_{0}^{\pi}\frac{ab^ax^2\sin(ax)}{b^{2a}+2b^a\cos(ax)+1}\mathrm dx$$
$w=b^a\cos(ax)$
$$J=\int_{0}^{\pi}\frac{ab^ax^2\sin(ax)}{b^{2a}+2b^a\cos(ax)+1}\mathrm dx$$
$$J=-\int \frac{x^2}{b^{2a}+2w+1}\mathrm dw$$
$$J=-\frac{1}{a}\int \arccos^2\left(\frac{w}{b^a}\right)\frac{1}{b^{2a}+2w+1}\mathrm dw$$
 A: Let $w=b^a.$  Then there exists a closed form in terms of polylogarithms for the integral
$$ I=\int_0^\pi x \log\big(w^2+2\,w\,\cos{(a\,x)}+1 \big) dx = \pi^2\,\log{w} + \frac{i\,\pi}{a} \Big( \text{Li}_2\big(-\frac{e^{i\,a\,\pi}}{w} \big) - 
\text{Li}_2\big(-\frac{e^{-i\,a\,\pi}}{w} \big) \Big)+$$
$$+\frac{1}{a^2}\Big(2\, \text{Li}_3(-1/w) - \Big( \text{Li}_3\big(-\frac{e^{i\,a\,\pi}}{w} \big) + 
\text{Li}_3\big(-\frac{e^{-i\,a\,\pi}}{w} \big) \Big) \Big). $$
The proof consists of factoring the argument of the logarithm as 
$(w+\exp{(i\,\pi\,a)})(w+\exp{(-i\,\pi\,a)}),$ using the additive property of the log to get a sum of two integrals, and let Mathematica do the integral.  In the comments it was said that it can be assumed that $a$ can be an integer greater than two.  For this case we have
$$ I = \pi^2\,\log{w} + (1 - (-1)^a)/a^2 \Big( \text{Li}_3\big(-\frac{1}{w} \big) - 
\text{Li}_3\big(\frac{1}{w} \big) \Big) .$$
The special case for even $a,$ as mentioned by Zachy, is easily recovered.
