Discrepancy in definite integral $\int_{0}^{2\pi}\frac{1}{10+3\cos x}dx$ using Desmos

225 Views Asked by At

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.

5

There are 5 best solutions below

0
On

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.

0
On

Your anti-derivative $F(x)$, though correct, is only piece-wise continuous and you cannot apply the limits across discontinuities. To do so, derive and utilize the everywhere continuous anti-derivative below instead $$\int \frac{1}{10+3\cos x}dx =\frac1{\sqrt{91}}\left(x+2\tan^{-1}\frac{3\cos x}{3\sin x+10+\sqrt{91}} \right)+C $$

0
On

The problem is similar to the one in this question. While $F'(x)$ is equal to the integrand wherever it is differentiable, it is not everywhere differentiable because it is not continuous. To make it continuous, you have to add a step function like so: $$ F_*(x) = \frac{2}{\sqrt{91}}\left(\tan^{-1}\left[\sqrt{\frac{7}{13}}\tan\left(\frac{x}{2}\right)\right] + \pi\left\lfloor\frac{x}{2\pi}+\frac{1}{2}\right\rfloor\right) $$ Here is a graph comparing $F(x)$ to $F_*(x)$. You can see that $F_*$ is continuous while $F$ is not. This extra term then gives the correct answer: $$ F_*(2\pi) - F_*(0) = \frac{2\pi}{\sqrt{91}}\approx 0.6586568 $$ Note that this problem is very common with antiderivatives that involve inverse trig functions, so keep that in mind for the future.

0
On

The mistake made by OP is the substitution $t=\tan \frac{x}{2}$ which is not continuous at $x=\pi $ and hence discontinuous and non-integrable on the interval $(0, 2\pi)$. In order to use the substitution, we have to split the interval into two by symmetry as below: $$ \int_0^{2\pi} \frac{1}{10+3 \cos x} d x =2 \int_0^\pi \frac{1}{10+3 \cos x} d x $$ Now we can let $t=\tan \frac{x}{2}$ and obtain $$ \begin{aligned} \int_0^{2\pi} \frac{1}{10+3 \cos x} d x & =2 \int_0^{\infty} \frac{1}{10+\frac{3\left(1-t^2\right)}{1+t^2}} \frac{2 d t}{1+t^2} \\ & =4 \int_0^{\infty} \frac{d t}{13+7 t^2} \\ & =\frac{4}{\sqrt{91}}\left[\tan ^{-1}\left(\frac{\sqrt{7} t}{\sqrt{13}}\right) \right]_0^{\infty} \\ & =\frac{2 \pi}{\sqrt{91}} \end{aligned} $$


Alternatively, we can further split the interval into $$ \begin{aligned} \int_0^\pi \frac{1}{10+3 \cos x} d x&=\int_0^{\frac{\pi}{2}} \frac{1}{10+3 \cos x} d x+\int_{\frac{\pi}{2}}^\pi \frac{1}{10+3 \cos x} \\ & =\int_0^{\frac{\pi}{2}} \frac{1}{10+3 \cos x} d x+\int_0^{\frac{\pi}{2}} \frac{1}{10-3 \cos x} d x \\ & =20 \int_0^{\frac{\pi}{2}} \frac{1}{100-9 \cos ^2 x} d x\\&= 20 \int_0^{\frac{\pi}{2} } \frac{d(\tan x)}{91+100 \tan ^2 x}\\& =\frac{2}{\sqrt{91}}\left[\tan ^{-1}\left(\frac{10 \tan x}{\sqrt{91}}\right)\right]_0^{\frac{\pi}{2} }\\&= \frac{\pi}{\sqrt{91}} \end{aligned} $$ Hence $$ \int_0^\pi \frac{1}{10+3 \cos x} d x = \frac{2 \pi}{\sqrt{91}} $$

0
On

Complementing other answers, here is a comparison between OP's formula for the antiderivative and the actual antiderivative:

Comparison

From this, we observe:

  1. OP's formula works only on each of the intervals of the form $((2k-1)\pi, (2k+1)\pi)$ for integer $k$.

  2. To make OP's formula work on larger intervals, we need to adjust the constant of integration for each interval $((2k-1)\pi, (2k+1)\pi)$.


So, what went wrong in OP's derivation? I believe that the computation OP went through is something like:

\begin{align*} \int \frac{1}{10 + 3\cos x} \, \mathrm{d}x &= \int \frac{1}{10 + 3\bigl(\frac{1-t^2}{1+t^2}\bigr)} \cdot \frac{2}{1+t^2} \, \mathrm{d}t \tag{$t = \tan(x/2)$} \\ &= \int \frac{2}{13 + 7t^2} \, \mathrm{d}t \\ &= \frac{2}{\sqrt{91}} \arctan\left(\sqrt{\frac{7}{13}}t\right) + \mathsf{C} \\ &= \frac{2}{\sqrt{91}} \arctan\left(\sqrt{\frac{7}{13}}\tan\frac{x}{2}\right) + \mathsf{C} \end{align*}

However, this derivation makes use of the substitution $t=\tan\frac{x}{2}$, which is differentiable only on each interval of the form $((2k-1)\pi, (2k+1)\pi)$ for integer $k$. The question of whether this result extends outside the interval still needs to be resolved, and the actual computation shows that the answer is negative.

There are several ways to circumvent this issue, some of which are already illustrated in other answers.