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?
 A: Because the cosine is periodic we may split the interval into 3 parts:
$$
\int_0^{3\pi/2} \frac{dx}{5/2+\cos(2x)}
=
\frac12 \int_0^{3\pi}\frac{dy}{5/2+\cos y}
=
\frac32 \int_0^{\pi}\frac{dy}{5/2+\cos y}
$$
$$
=
\frac32 \frac{2}{\sqrt{(5/2)^2-1}}\arctan\frac{\frac32 \tan(y/2)}{\sqrt{21/4}}\bigg{|}_{y=0}^{y=\pi}
=
\frac32 \frac{2}{\sqrt{21/4}}\arctan\frac{3 \tan(y/2)}{\sqrt{21}} \bigg{|}_{y=0}^{y=\pi}
$$
$$
=
\frac32 \frac{2}{\sqrt{21/4}} \bigg \{
\arctan\frac{3 \tan(\pi/2)}{\sqrt{21}}
-
\arctan\frac{3 \tan(0/2)}{\sqrt{21}}
\bigg \}
$$
$$
=
\frac{3}{\sqrt{21/4}}\bigg \{
\arctan\infty
-
\arctan 0
\bigg \}
$$
$$
=
\frac32 \frac{2}{\sqrt{21/4}}[
\pi/2
-
0
]
=\sqrt{\frac37}\pi
$$
A: Let
$$ F(x)=\frac{2\arctan\left(\sqrt{\frac{7}{3}}\tan{x}\right)}{\sqrt{21}}. $$
Then $f(x)$ is undefined at $x=\frac\pi2, \frac{3\pi}2$ and
$$ \lim_{x\to(\frac{\pi}2)^-}F(x)=\infty, \lim_{x\to(\frac{\pi}2)^+}
F(x)=-\infty,\lim_{x\to(\frac{3\pi}2)^-}F(x)=\infty$$
and hence
\begin{eqnarray}
&&\int_0^{\frac{3}{2}\pi}\frac{1}{\frac{5}{2}+\cos(2x)}dx \\
&=&F(x)\bigg|_{0}^{(\frac{\pi}2)^-}+F(x)\bigg|_{(\frac{\pi}2)^+}^{(\frac{3\pi}2)^-}\\
&=&\lim_{(\frac{\pi}2)^-}F(x)+\lim_{(\frac{3\pi}2)^-}F(x)-\lim_{(\frac{\pi}2)^+}F(x)\\
&=&\frac{3\pi}{\sqrt{21}}=\pi\sqrt{\frac37}.
\end{eqnarray}
A: 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.$$
