<s>[INST] Integral with cosine in the denominator and undefined boundaries I am trying to solve the integral
$$ \int_0^{\frac{3}{2}\pi}\frac{1}{\frac{5}{2}+\cos(2x)}dx $$
And I get the primitive function to be
$$     \frac{2\arctan\left(\sqrt{\frac{7}{3}}\tan{x}\right)}{\sqrt{21}} $$
But $\tan(\frac{3}{2}\pi)$ is not defined. Mathematica gets the same primitive function and can solve it when using the given boundaries. How do I handle the boundaries?
 [/INST] Since the function is $\pi$-periodic, $$\int_{\pi}^{\frac{3}{2}\pi}\frac{1}{\frac{5}{2}+\cos(2x)}dx=\int_{0}^{\frac{1}{2}\pi}\frac{1}{\frac{5}{2}+\cos(2x)}dx.$$
It is also symmetric about $x=\frac{1}{2}\pi$-line and therefore by $x\rightarrow \pi-x$ substitution
$$\int_{\frac{1}{2}\pi}^{\pi}\frac{1}{\frac{5}{2}+\cos(2x)}dx=\int_{0}^{\frac{1}{2}\pi}\frac{1}{\frac{5}{2}+\cos(2x)}dx.$$
Hence,
$$\int_{0}^{\frac{3}{2}\pi}\frac{1}{\frac{5}{2}+\cos(2x)}dx=3\int_{0}^{\frac{1}{2}\pi}\frac{1}{\frac{5}{2}+\cos(2x)}dx.$$
Finally, by using OP's antiderivative, the result will be
$$3\left(\frac{2\arctan\left(\sqrt{\frac{7}{3}}\tan{x}\right)}{\sqrt{21}}\bigg{|}_0^{\frac{\pi}{2}}\right)=3\left(\frac{2\arctan\left(\infty\right)}{\sqrt{21}}\right)=\frac{\sqrt3}{\sqrt7}\pi.$$
</s>