Why does fundamental theorem of calculus not work for this integral $\int_0^{2\pi}\frac{dx}{(3+\cos x)(2+\cos x)}$? $$\int\frac{dx}{(3+\cos x)(2+\cos x)}=  \frac{2\arctan(\frac{\tan(\frac x2)}{\sqrt3})}{\sqrt3} - \frac{\arctan(\frac{\tan(\frac x2)}{\sqrt2})}{\sqrt2} + C $$
This is the antiderivative . By the FTC :
$$\int_a^b f(x) = F(b) - F(a)$$
where $F(x)$ is a primitve function.
$$\left. \int_0^{2\pi}\frac{dx}{(3+\cos x)(2+\cos x)}= \frac{2\arctan(\frac{\tan(\frac x2)}{\sqrt3})}{\sqrt3} - \frac{\arctan(\frac{\tan(\frac x2)}{\sqrt2})}{\sqrt2} \right|_0^{2\pi}=0$$
$\frac{dx}{(3+\cos x)(2+\cos x)}$ is positive on$[0,2\pi]$ hence the result above is wrong.
Correct result is:
$$\int_0^{2\pi}\frac{dx}{(3+\cos x)(2+\cos x)}=\Bigl(\frac2{\sqrt3}-\frac1{\sqrt2}\Bigr) \pi$$
Why am I not getting the correct result ?
 A: Because $$\frac{2\arctan(\frac{\tan(\frac x2)}{\sqrt3})}{\sqrt3} - \frac{\arctan(\frac{\tan(\frac x2)}{\sqrt2})}{\sqrt2}\tag1$$is not an antiderivative of $\frac1{(3+\cos x)(2+\cos x)}$. Such an antiderivative would have to be defined at every point of $[0,2\pi]$, but $(1)$ is undefined at $\pi$.
A: The anti-derivative $F(x)$ should be a Differentiable function over $(a,b)$. 
Before using FTC, use Even symmetry Property which says that:$$\int_{0}^{2a}f(x)dx=2\int_{0}^{a}f(x)dx$$ When $f(2a-x)=f(x)$
A: Tan is not $1-1$ so its inverse is multivalued, like square root.  'Arctan' is always between $-\pi/2$ and $+\pi/2$ but you need to add the right multiples of pi to make a continuous function.
As $x$ passes through $\pi$, the function $\tan x/2$ jumps from $+\infty$ to $-\infty$, the arctan jumps from $+\pi/2$ to $-\pi/2$.  So to make your antiderivative continuous, you need to add $\pi$ to the arctan when $x\gt\pi$
A: Let $f(x)=\frac{1}{(3+\cos x)(2+\cos x)}$
and $F(x)$ be its anti-derivative. 
Pertaining to this very question,what if we tried to make a substitution $\cos x=u$.
Since we would have to change the limits accordingly we see that the limit comes out to be
$\displaystyle\int_1^1 g(u) \mathrm du=0$, where the function $g$ is obtained after the substitution.
Is the problem here that $f(x)$  is not invective or is it that the $f(x)$ anti-derivative 
is not differentiable $ \exists x \in [0,2\pi]$ 
