I'm having trouble solving:
$$\int \frac{1}{\cos^2(x)+\cos(x)+1}dx$$
Wolfram Alpha gives an answer with imaginary numbers. I am able to get somewhat close to the answer by doing a Weierstrass Substitution, but the partial fraction decomposition because very ugly. I wanted to know if there is an easier way of solving the integral? Or if someone could solve it with the partial fractions.
Thanks!
We have $\cos^2(x)+\cos(x)+1\geq \frac{3}{4}$ so the integral is well-defined over any bounded interval of the real line. By letting $x=2\arctan t$ the integral is converted into $$ \int \frac{2(1+t^2)}{3+t^4}\,dt $$ which only depends on $\arctan\left(1\pm \frac{\sqrt{2}\,t}{\sqrt[4]{3}}\right)$ and $\log\left(\sqrt{3} \pm \sqrt{2}\sqrt[4]{3}\,t + t^2\right)$ by partial fraction decomposition.