<s>[INST] How to evaluate this definite integral $ \int_{-\pi/3}^{\pi/3} \frac{(\pi +4x^3)\,dx}{2-\cos(|x|+ \frac{\pi}{3})} $ $$ \int_{-\pi/3}^{\pi/3} \frac{(\pi +4x^3)\,dx}{2-\cos(|x|+ \frac{\pi}{3})}  $$
I have separated the integral into two parts, then expanded using $\cos(a+b)$ formula, after that I am lost. Can someone provide me hint?
 [/INST] You don't need to separate the integrand.  First of all, the $x^3$ piece vanishes; this follows immediately from the fact that this is an odd integrand over an even interval.  That leaves the first piece, which I can reduce to
$$2 \pi \int_{\pi/3}^{2 \pi/3} \frac{dx}{2-\cos{x}}$$
This may be evaluated using a substitution of the form $t=\tan{x/2}$; $dx=2 dt/(1+t^2)$.  Then the integral is equal to
$$\begin{align}4 \pi \int_{1/\sqrt{3}}^{\sqrt{3}} dt \frac{1}{1+ 3 t^2}   &= \frac{4 \pi}{3 \sqrt{3}} \left [\arctan{\frac{t}{\sqrt{3}}}\right ]_{1/\sqrt{3}}^{\sqrt{3}}\\ &= \frac{4 \pi}{3 \sqrt{3}} \left (\arctan{1}-\arctan{\frac13} \right )\\ &= \frac{4 \pi}{3 \sqrt{3}} \arctan{\frac12}\end{align}$$
</s>