I was trying to calculate the following definite integral of a function $f(x)$:
$$\int_{0}^{2\pi}\frac{1}{10+3\cos x}dx$$
After some effort, I managed to find the following antiderivative:
$$F\left(x\right)\ =\ \frac{2\tan^{-1}\left(\sqrt{\frac{7}{13}}\tan\left(\frac{x}{2}\right)\right)}{\sqrt{91}}$$
I double checked on Wolfram Alpha, and the back answers of my textbook. I confirmed that my integration is correct. Now I had to apply the limits to get the final answer, so I calculated $F(2\pi) - F(0)$, and got the answer $0$.
However, when I tried to calculate the definite integral using Desmos, I obtained two different answers. First, I directly entered the equation in the form $\int_{0}^{2\pi}f\left(x\right)dx$, and I got a non-zero answer $(0.658656788383)$. Then, I entered $F(2\pi) - F(0)$, and this time, I got the answer $0$. Finally, I plotted $y = f(x)$, and saw that for all points, $y > 0$, which means the definite integral couldn't be zero.
I'm confused about why Desmos is giving me different answers for the same integral, and I'm not sure which one is correct. Is this a problem with Desmos, or is there an error in my calculations? I've double-checked my integration and the antiderivative, and I believe they are correct. Could there be some issue in my way of applying the limits?
Any insights or suggestions on how to resolve this discrepancy would be greatly appreciated.
Thank you.
Noting that:
$$ \frac{\text{d}}{\text{d}x}\underbrace{\left[\frac{2}{\sqrt{91}}\,\arctan\left(\sqrt{\frac{7}{13}}\tan\left(\frac{x}{2}\right)\right)+c\right]}_{F_c(x)} = \frac{1}{10+3\cos(x)} \quad \quad \forall\,x\in\mathbb{R}\backslash\{\pi+2\,k\,\pi\} $$
by the additive property of integrals, we have:
$$ \begin{aligned} \int_0^{2\pi} \frac{1}{10+3\cos(x)}\,\text{d}x & = \int_0^{\pi} \frac{1}{10+3\cos(x)}\,\text{d}x + \int_{\pi}^{2\pi} \frac{1}{10+3\cos(x)}\,\text{d}x \\ & = \left[\lim_{x \to \pi^-} F_c(x) - \lim_{x \to 0^+} F_c(x)\right] + \left[\lim_{x \to 2\pi^-} F_c(x) - \lim_{x \to \pi^+} F_c(x)\right] \\ & = \left(\frac{\pi}{\sqrt{91}}-0\right) + \left(0+\frac{\pi}{\sqrt{91}}\right) \\ & = \frac{2\pi}{\sqrt{91}} \end{aligned} $$
and this is the desired integral as you can check here.