[Math] Convergence/Divergence of Improper Trigonometric Integral $\int\limits_{0}^{\frac{\pi}{2}} \tan(x) dx$

calculusimproper-integralsintegration

I am currently taking a Calculus II course and working through some practice questions in the textbook by Adams. I could not figure out the following question and have a contradictory answer to what Wolfram|Alpha says, yet I do not know where I am going wrong.

Determine whether $\int\limits_{0}^{\frac{\pi}{2}} \tan(x) dx$ converges or diverges. If it does not diverge, give the value it converges to.

The following is my attempt to solve this problem, I am clearly wrong since Wolfram|Alpha disagrees with me, so a sufficient answer would just be to point out where my mistake was/what misconception I have about evaluating improper integrals.


At $x=\frac{\pi}{2}$ there is a vertical asymptote since $\tan(\frac{\pi}{2})$ is undefined. Thus, this integral is vertically improper at $x=\frac{\pi}{2}$. We then convert the improper integral to a limit of a proper integral as follows,

$$\int\limits_{0}^{\frac{\pi}{2}} \tan(x) dx = \lim\limits_{c \rightarrow (\frac{\pi}{2})^-} \int\limits_{0}^{c} \tan(x) dx = \lim\limits_{c \rightarrow (\frac{\pi}{2})^-} -\ln(\cos(x))|_{0}^{c}$$

We can then evaluate the resulting limit as follows,

$$\lim\limits_{c \rightarrow (\frac{\pi}{2})^-} -\ln(\cos(x))|_{0}^{c} = \lim\limits_{c \rightarrow (\frac{\pi}{2})^-} (-\ln(\cos(c)) + \ln(\cos(0)))$$
Since $\ln(\cos(0))=0$ we have then reduced the problem to,

$$\lim\limits_{c \rightarrow (\frac{\pi}{2})^-} -\ln(\cos(c)) = \infty$$
Therefore, the integral diverges to infinity.

Yet, Wolfram|Alpha states that the integral converges to a finite value, namely, around $38$, so I'm at a loss of what is going on.

If anyone would be able to clear this up for me that would be helpful.

Best Answer

Your working is perfectly correct, the only incorrect logic is the following:

I am clearly wrong since Wolfram|Alpha disagrees with me

To compute the integral Wolfram|Alpha has used a numerical method to estimate the value and the method it is using is not sophisticated enough to handle this integral near the asymptote.

This is not uncommon. I can't remember specific instances off the top of my head, but several times I've been able to work out simpler expressions than the forms returned in WA. Humans are still usually better mathematicians than computers (13/02/12) .

Related Question