Need help with $\int_0^\pi\arctan^2\left(\frac{\sin x}{2+\cos x}\right)dx$ Please help me to evaluate this integral:
$$\int_0^\pi\arctan^2\left(\frac{\sin x}{2+\cos x}\right)dx$$
Using substitution $x=2\arctan t$ it can be transformed to:
$$\int_0^\infty\frac{2}{1+t^2}\arctan^2\left(\frac{2t}{3+t^2}\right)dt$$
Then I tried integration by parts, but without any success...

Generalizing Jack's answer. Take $a\in\Bbb R\setminus\{0\}$, and write
$$J(a)=\int_0^\pi\arctan^2\left(\frac{\sin x}{a+\cos x}\right)dx.$$
From symmetry, we can write
$$J(a)=\frac12\int_{-\pi}^\pi\arctan^2\left(\frac{\sin x}{a+\cos x}\right)dx$$
Then
$$\arctan\left(\frac{\sin x}{a+\cos x}\right)=\Im\log(a+e^{ix})=\sum_{n\ge1}\frac{(-1)^{n+1}}{na^n}\sin(nx).$$
Then from Parseval's theorem,
$$\frac1\pi\int_{-\pi}^\pi\arctan^2\left(\frac{\sin x}{a+\cos x}\right)dx=\sum_{n\ge1}\left(\frac{(-1)^{n+1}}{na^n}\right)^2,$$
so that
$$J(a)=\frac\pi2\mathrm{Li}_2\left(\tfrac1{a^2}\right).$$
Unfortunately, your integral, given by $J(2)=\frac\pi2\mathrm{Li}_2(1/4)$, does not appear to have a closed form.
