Evaluating definite integrals using Fundamental Theorem of Calculus

Here is a statement of the second part of the Fundamental Theorem of Calculus (FTC2), from a well-known calculus text (James Stewart, Calculus, 4th ed):

If $f$ is continuous on $[a,b]$, then $\int_a^b f(x) \, dx = F(b)-F(a)$, where $F$ is any [emphasis mine] antiderivative of $f$, that is, a function such that $F'=f$.

The following, however, seems to give a counterexample.*
Can someone resolve this for me?:

Let $f(x) = \frac{1}{4 \sin (x)+5}$.

$f$ is continuous on $[0, 2 \pi]$:

enter image description here

Consider two antiderivatives of $f$, $F_1$ and $F_2$:

$$F_1(x) = \frac{x}{3}+\frac{2}{3} \tan^{-1}\left(\frac{\cos (x)}{\sin (x)+2}\right)$$

$$F_2(x)=\frac{1}{3} \left(\tan ^{-1}\left(2-\frac{3}{\tan \left(\frac{x}{2}\right)+2}\right)-\tan^{-1}\left(2-\frac{3}{\cot \left(\frac{x}{2}\right)+2}\right)\right).$$

Using Mathematica, I've confirmed that both $F_1'= f$ and $F_2'= f$. According to my reading of the above statement of FTC(2), $\int_0^{2\pi} f (x) \, dx = F_1(2\pi)-F_1(0)= F_2(2\pi)-F_2(0)$

However,

$F_1(2\pi)-F_1(0)=2\pi/3$

$F_2(2\pi)-F_2(0)=0$

Note from the plots below that $F_1$ is continuous on $[a,b]$, while $F_2$ is not. Given all of this, it seems the sufficient condition for $\int_a^b f (x) \, dx = F(b)-F(a)$ is that the antiderivative be continuous on $[a,b]$, not the integrand.

$F_1 =$

enter image description here

$F_2=$

enter image description here

*I've taken this example function from a wolfram.com blog.


A differentiable function is continuous. If your "antiderivative" is not continuous, it is not an antiderivative of a continuous function.


@Martin Argerami posted a succinct and correct answer:

A differentiable function is continuous. If your "antiderivative" is not continuous, it is not an antiderivative of a continuous function.

To elaborate, $F_2$ is not continuous due to the multi-valued nature of $\arctan$. Since $\tan$ is a periodic function (with a period of $\pi$), this means that $\arctan$ has an infinite number of values. Its plot looks like this:

multi-valued arctan

To make it a proper function (one unique output value), we usually pick the primary branch (the one through the origin). However, notice that the primary branch is discontinuous at infinity - if we pass through positive infinity and come back out at negative infinity, we've jumped from $\pi/2$ to $-\pi/2$. What we really wanted was to move to the next branch up to preserve continuity, but to do that we'd no longer have a single valued function. We wouldn't have a function at all, really, since the common definition of function requires it to be single valued.

The discontinuities of $F_2$ are precisely where the argument of $\arctan$ becomes infinite - where $2+\cot\frac{x}{2}$ and $2+\tan\frac{x}{2}$ become zero - approximately 4.07 and 5.36.