3

$$ I = \int_0^{4\pi} \frac{\sec^2x\ dx}{2+\tan^2x} $$ Now it is simple and I can just write it as, $I=\left[\frac{1}{√2}\tan^{-1}(\tan x/√2)\right]_0^{4\pi}$. Now if I simply place limits I will get $0-0=0$. But if I take $8$ common as $f(2a-x)=f(x)$ property the limits change to $0$ to $π/2$ so the answer also changes to $2√2π$. Which is the correct answer given. I don't understand why we need to apply the property when it isn't needed in the first place and let alone why it gives a different answer?

Dando18
  • 5,368
  • Using MathJax https://math.meta.stackexchange.com/questions/5020/mathjax-basic-tutorial-and-quick-reference would make your question much more readable. – Angina Seng Jul 16 '17 at 17:56
  • For the second one, I suppose you mean: $$I=\frac{1}{\sqrt{2}}\cdot \arctan\left(\frac{\tan(x)}{\sqrt{2}}\right)$$ – projectilemotion Jul 16 '17 at 17:59
  • I am new to stack exchange sorry and to whomever edited my question tan^-1tanx is in numerator please thanks – TheLostGuardian0 Jul 16 '17 at 18:01
  • Well, if you slap-happily express your primitive function in terms of one that has several poles in the interval of integration ($\tan x$), composed with a non-unique inverse function ($\tan^{-1}$), you shouldn't be surprised that the results are a little bit unstable, too. –  Jul 16 '17 at 19:05

1 Answers1

7

Handling Primitive Limitations

The problem lies in the fact that the primitive for $\int\frac{\sec^2(x)\,\mathrm{d}x}{2+\tan^2(x)}=\frac1{\sqrt2}\tan^{-1}\left(\frac{\tan(x)}{\sqrt2}\right)+C$ is only good for one period of $\tan(x)$. The constant changes for the next period because of the discontinuity in $\tan(x)$. So we can compute the integral in pieces: $$ \begin{align} \int_0^{4\pi}\frac{\sec^2(x)\,\mathrm{d}x}{2+\tan^2(x)} &=\int_0^{\pi/2}\frac{\sec^2(x)\,\mathrm{d}x}{2+\tan^2(x)} +\int_{\pi/2}^{3\pi/2}\frac{\sec^2(x)\,\mathrm{d}x}{2+\tan^2(x)} +\int_{3\pi/2}^{5\pi/2}\frac{\sec^2(x)\,\mathrm{d}x}{2+\tan^2(x)}\\ &+\int_{5\pi/2}^{7\pi/2}\frac{\sec^2(x)\,\mathrm{d}x}{2+\tan^2(x)} +\int_{7\pi/2}^{4\pi}\frac{\sec^2(x)\,\mathrm{d}x}{2+\tan^2(x)}\\ &=\int_0^\infty\frac{\mathrm{d}u}{2+u^2}+3\int_{-\infty}^\infty\frac{\mathrm{d}u}{2+u^2}+\int_{-\infty}^0\frac{\mathrm{d}u}{2+u^2}\\[9pt] &=2\sqrt2\,\pi \end{align} $$


Smarter Primitive

As noted above, the function $u(x)=\frac1{\sqrt2}\tan^{-1}\left(\frac{\tan(x)}{\sqrt2}\right)+C$ suffers because of the discontinuity of $\tan(x)$. However, there is a trick that allows us to overcome this problem. Let us assume, for the time being, that $C=0$. We can simply add that to $u$ later. With this assumption, we get $$ \frac{\tan(x)}{\sqrt2}=\tan(\sqrt2 u)\tag1 $$ Using the formula for the tangent of a difference, we get $$ \begin{align} \tan\left(\sqrt2 u-x\right) &=\frac{\tan\left(\sqrt2u\right)-\tan(x)}{1+\tan\left(\sqrt2u\right)\tan(x)}\tag{2a}\\ &=\frac{\frac{1-\sqrt2}{\sqrt2}\tan(x)}{1+\frac1{\sqrt2}\tan^2(x)}\tag{2b} \end{align} $$ The nice thing about $\text{(2b)}$ is that it is bounded and continuous as a function of $x$.

enter image description here

Composing $\tan^{-1}$ with $\text{(2b)}$ encounters no discontinuity, and we can solve for $u$: $$ u=\frac1{\sqrt2}\left(x+\tan^{-1}\left(\frac{\frac{1-\sqrt2}{\sqrt2}\tan(x)}{1+\frac1{\sqrt2}\tan^2(x)}\right)\right)\tag3 $$ Adding $C$ will give us a general primitive, but this primitive, albeit quite a bit more complicated looking, does not suffer from the discontinuities of $\tan(x)$.

enter image description here

Applying $(3)$ to the problem gives $$ u(4\pi)-u(0)=2\sqrt2\pi\tag4 $$

robjohn
  • 345,667