1

Evaluate $\int_0^x \frac{dt}{1+\cos^2t}$ $\forall x \in \mathbb{R}$

I got this question in an analysis exam, and I did what everybody does (this), I made $u=\tan t$ and I got $\frac{1}{\sqrt2}\tan^{-1}\left(\frac{\tan x}{\sqrt2}\right)$ but I know this is wrong because $\tan x$ is not continuous in every $[0,x]$, here it's solved until $\pi$, but my limit is $x$ so I'm not sure what should I do.

Also, we have the integral of a positive amount, so my answer should be an increasing function...

Here is explained why this happens (which I already know), and the answers there don't solve the integral between $0$ and $x$. One answer gives a possible result (that have to be adapted, since there it is indefinite), but no deduction of it. The answer given here is much more complete and perfectly address my specific question.

Lotte
  • 1,070
  • 2
    you may look at the different branches of arctan carefully to get a sensible answer. – tired May 03 '15 at 17:38
  • So I could divide $[0,x]$ in several intervals where the substitution is not sinful and then put my answer in term of $n$ intervals I may have? Or is that an ugly solution? – Lotte May 03 '15 at 17:42
  • 1
    look at the answer given, it is excellent! – tired May 03 '15 at 17:43

1 Answers1

6

We have $$\dfrac1{1+\cos^2(t)} = \dfrac{\sec^2(t)}{\sec^2(t)+1} = \dfrac{\sec^2(t)}{2+\tan^2(t)}$$ This gives us $$I(x) = \int_0^x \dfrac{dt}{1+\cos^2(t)} = \int_0^x \dfrac{\sec^2(t)}{2+\tan^2(t)}dt$$ Setting $y=\tan(t)$, we have $$I(x) = \int_0^{\tan(x)} \dfrac{dy}{2+y^2} = \left.\dfrac1{\sqrt2}\arctan\left(\dfrac{y}{\sqrt2}\right) \right\vert_0^{\tan(x)} = \dfrac1{\sqrt2}\arctan\left(\dfrac{\tan(x)}{\sqrt2}\right)$$ This is valid for $x \in [0,\pi/2]$. For $x>\pi/2$, express $x$ as $n\pi+y$, where $y \in [-\pi/2,\pi/2]$, we then have $$I(x) = \dfrac{n\pi}{\sqrt2}+\dfrac1{\sqrt2}\arctan\left(\dfrac{\tan(y)}{\sqrt2}\right)$$ Hence, $I(x) > 0$ for all $x > 0$.

Adhvaitha
  • 20,259
  • i don't think the answer is right. what you need is $I(x) = \int_0^x \frac{dt}{1+\cos^2 t} = 2I(\pi/2) + I(\pi - x), \pi/2< x < \pi$ then $I(x) = int(x,\pi)I(\pi) + I(x - \pi(int(x/\pi)) $ – abel May 03 '15 at 18:03
  • @abel Thanks. Hopefully fixed now. – Adhvaitha May 04 '15 at 02:39
  • Isn't $\tan \pi/2$ (and also $\tan -\pi/2$) undefined? –  Feb 23 '20 at 04:06