Integral of $\tan(x)$ from $0$ to $2\pi$ I had a disputation with my friend. He said that
$$ \int_0^{2\pi} \tan(x) \ dx $$
is undefined. While I admit that the Integral from $0$ to $\frac{\pi}{2}$ goes to infinity, I don't know if the Integral from 0 to $2\pi$ is a real number or not. Could I also say that because the symmetry of $\tan$, the expression above is just $0$?
 A: This is an improper integral, and the usual way these are handled is by taking limits at each point of discontinuity (in this case, at $\pi/2$ and $3\pi/2$, from both sides at each).
The result in this case is that the integral does not converge.
There is good reason to do this, even if there is symmetry in the problem.  For example, consider $\int_{-1}^1 \frac{1}{x} dx$.  There is symmetry there, but you get different answers  with the following:


*

*$\lim_{e\to 0+} \int_{-1}^{-e}\frac{dx}{x}+\int_{e}^1\frac{dx}{x}$

*$\lim_{e\to 0+} \int_{-1}^{-e^2}\frac{dx}{x}+\int_{e}^1\frac{dx}{x}$

*$\lim_{e\to 0+} \int_{-1}^{-e}\frac{dx}{x}+\lim_{f\to 0+}\int_{f}^1\frac{dx}
{x}$
However if the third expression exists (it doesn't in this case), then it agrees with the first two.  That is the definition that is in standard use.
A: In general for an integral $\int_a^b f(x) dx$ to be well-defined, we need 
$\int_a^c f(x)dx$ and $\int_c^b f(x)dx$ both to be well-defined, for all $c \in (a,b)$.
This is not the case for $\int_0^{2\pi}\tan(x)dx$ since $\int_0^{\pi/2}\tan(x)$ is not well-defined.
However, the Cauchy principal value is $0$, since
$$\int_{0}^{2\pi} \tan(x)dx = \lim_{\delta \to 0}\left(\int_{0}^{\pi/2-\delta} \tan(x)dx + \int_{\pi/2+\delta}^{\pi} \tan(x)dx \right) + \lim_{\epsilon \to 0}\left(\int_{\pi}^{3\pi/2-\epsilon} \tan(x)dx + \int_{3\pi/2+\epsilon}^{2\pi} \tan(x)dx \right) = 0$$
A: Hint:
$$
\int \tan x dx=\int \dfrac{\sin x}{\cos x}dx = -\int(\cos x)^{-1} d(\cos x)=-\log(\cos x)) +C 
$$
so 
$$
\int_0^{\pi/2} \tan x dx = \lim_{x \rightarrow \pi/2}(-\log(\cos x))+1
$$
does not converge.
A: The integration extends over singularities of the tangent function at $x=\pi/2$ and $x=3\pi/2$.  To determine convergence, note that 
$$\int \tan xdx=-\log|\cos x|+C.$$
Therefore, the integral diverges logarithmically.  
However, if we interpret the integration in a Cauchy Principal Value sense, then we can write
$$\begin{align}
\int_0^{2\pi} \tan x dx&=\lim_{\epsilon \to 0}\left(\int_0^{\pi/2-\epsilon} \tan x dx+\int_{\pi/2+\epsilon}^{3\pi/2-\epsilon} \tan x dx+\int_{3\pi/2+\epsilon}^{2\pi} \tan x dx\right)\\\\
&=\lim_{\epsilon \to 0}\left(\log\left|\frac{\cos(0)}{\cos(\pi/2-\epsilon)}\right|+\log\left|\frac{\cos(\pi/2+\epsilon)}{\cos(3\pi/2-\epsilon)}\right|+\log\left|\frac{\cos(3\pi/2-\epsilon)}{\cos 2\pi}\right|\right)\\\\
&=\lim_{\epsilon \to 0}\left([\log 1-\log \sin(\epsilon)]+[\log \sin(\epsilon)-\log \sin(\epsilon)]+[\log \sin(\epsilon)-\log 1]\right)\\\\
&=0
\end{align}$$
So, while the integral does diverge, it's Cauchy Principal Value is zero.
