# Why is the integral of sec^2(x) from 0 to pi infinity?

Why is it, if you take the integral of sec^2(x) from 0 to pi, my calculator returns "infinity" as the answer, but according to the second fundamental theorem of calculus, I got 0 with my own work.

I integrated sec^2(x) to get tan(x), then evaluated at a, and b, and took the difference: tan(pi) - tan(0) = 0

I would love to understand how infinity is an answer that my "math tool" got.

• What's $\cos(\pi/2)$? – Mhenni Benghorbal Feb 20 '14 at 4:25
• You made the mistake of assuming the hypothesis of the Fundamental Theorem was satisfied for $\sec^2x$. Remember that the Fundamental Theorem works only for functions that are continuous on the interval $(a,b)$. Your error is exactly analogous to computing $\int_{-1}^1\frac{1}{x}=\ln|1|-\ln|-1|=0$. – symplectomorphic Feb 20 '14 at 4:42

$sec^{2}(x)$ = $\frac{1}{cos^2(x)}$ As $x$ goes from 0 to $\frac{\pi}{2}$ what happends? Well, think about this: $cos(\frac{\pi}{2})=0$. As we approach $\frac{\pi}{2}$ from either side, we have $\frac{1}{cos^2(x)} \rightarrow \infty$. Then, if you think of the integral as measuring the area under the curve, you see why this integral goes to $\infty$.

.

• I cannot upvote all the responses because my account forbids me. Great explanation! Forgot about the asymptote at pi/2. – Matt Feb 20 '14 at 4:42

Hint

As you correctly found, the antiderivative of $\sec ^2(x)$ is $\tan (x)$. If the bounds of integration are $0$ and $a$, the value of the integral is $\tan (a)$ which means that the results approached infinity when $a$ approached $\pi/2$.

I am sure that you can take from here.

You can't really take the integral on $[0,\pi/2]$ since $\sec^2x=1/\cos^2 x$ is discontinuous at $\pi/2$. So what we really want is $$\lim_{\theta\to\pi/2^-}\int_0^{\theta}\sec^2x\,dx+\lim_{\psi\to\pi/2^+}\int_{\psi}^\pi\sec^2x\,dx.$$ We have to split the integral up around the singularity. In this case, we have $$\lim_{\theta\to\pi/2^-}\int_0^{\theta}\sec^2x\,dx=\lim_{\theta\to\pi/2^-}\tan x\big|^\theta_0=\lim_{\theta\to\pi/2^-}\tan\theta=\infty\\ \lim_{\psi\to\pi/2^+}\int_{\psi}^\pi\sec^2x\,dx=\lim_{\psi\to\pi/2^+}\tan x\big|_\psi^\pi=\infty.$$ So the while the integral as you put it doesn't really work, this should approximate what your calculator is working out.