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.