Prove that, $\int_{0}^{2\pi}\frac{\cos x+2}{5+4\cos x} dx=\pi$
Note that $$\int\frac{\cos x+2}{5+4\cos x} dx=F(x):={x\over4}+{1\over2}\arctan\left({\tan{x\over2}\over3}\right)+c$$ but the function $F$ is not continuous on the interval of integration $[0,2\pi]$ (on the other hand a primitive of a continuous function should be continuous by the Fundamental Theorem of Calculus).
Since $F$ has a "jump" at $x=\pi$ we may split the interval and therefore we obtain $$\int_0^{2\pi}\frac{\cos x+2}{5+4\cos x} dx =\int_0^{\pi} +\int_{\pi}^{2\pi} =[F(x)]_{0^+}^{\pi^-}+[F(x)]_{\pi^+}^{2\pi^-}=\frac{\pi}{2}+\frac{\pi}{2}=\pi.$$
$\newcommand{\bbx}[1]{\,\bbox[15px,border:1px groove navy]{\displaystyle{#1}}\,} \newcommand{\braces}[1]{\left\lbrace\,{#1}\,\right\rbrace} \newcommand{\bracks}[1]{\left\lbrack\,{#1}\,\right\rbrack} \newcommand{\dd}{\mathrm{d}} \newcommand{\ds}[1]{\displaystyle{#1}} \newcommand{\expo}[1]{\,\mathrm{e}^{#1}\,} \newcommand{\ic}{\mathrm{i}} \newcommand{\mc}[1]{\mathcal{#1}} \newcommand{\mrm}[1]{\mathrm{#1}} \newcommand{\pars}[1]{\left(\,{#1}\,\right)} \newcommand{\partiald}[3][]{\frac{\partial^{#1} #2}{\partial #3^{#1}}} \newcommand{\root}[2][]{\,\sqrt[#1]{\,{#2}\,}\,} \newcommand{\totald}[3][]{\frac{\mathrm{d}^{#1} #2}{\mathrm{d} #3^{#1}}} \newcommand{\verts}[1]{\left\vert\,{#1}\,\right\vert}$ \begin{align} &\bbox[10px,#ffd]{\int_{0}^{2\pi}{\cos\pars{x} + 2 \over 5 + 4\cos\pars{x}}\,\dd x} = {\pi \over 2} + {3 \over 4}\int_{-\pi}^{\pi}{\dd x \over 5 - 4\cos\pars{x}} = {\pi \over 2} + {3 \over 2}\int_{0}^{\pi}{\dd x \over 5 - 4\cos\pars{x}} \\[5mm] = &\ {\pi \over 2} + {3 \over 2}\int_{-\pi/2}^{\pi/2}{\dd x \over 5 + 4\sin\pars{x}} = {\pi \over 2} + {3 \over 2}\int_{0}^{\pi/2}\bracks{{1 \over 5 + 4\sin\pars{x}} + {1 \over 5 - 4\sin\pars{x}}}\dd x \\[5mm] = &\ {\pi \over 2} + 15\int_{0}^{\pi/2}{\dd x \over 25 - 16\sin^{2}\pars{x}} = {\pi \over 2} + 15\int_{0}^{\pi/2}{\sec^{2}\pars{x}\,\dd x \over 25\sec^{2}\pars{x} - 16\tan^{2}\pars{x}} \\[5mm] = &\ {\pi \over 2} + 15\int_{0}^{\pi/2}{\sec^{2}\pars{x}\,\dd x \over 9\tan^{2}\pars{x} + 25} = {\pi \over 2} + 15\,{1 \over 25}\,{5 \over 3}\int_{0}^{\pi/2}{\bracks{3\sec^{2}\pars{x}/5}\,\dd x \over \bracks{3\tan\pars{x}/5}^{\, 2} + 1} \\[5mm] = &\ {\pi \over 2}\ +\ \underbrace{\int_{0}^{\infty}{\dd x \over x^{2} + 1}} _{\ds{=\ {\pi \over 2}}}\ =\ \bbx{\pi} \end{align}