The principal value of an integral Prove the following
$$\int^\infty_0 \frac{\tan(x)}{x}=\frac{\pi}{2} $$
This question was posted on some forum, but i think it should be rewritten as
$$PV\int^\infty_0 \frac{\tan(x)}{x}=\frac{\pi}{2} $$
 Because if the discontinuoities of the zeros of $\cos(x)$.
My attempt
Consider the following function 
$$f(x) = \frac{\tan(x)}{x}$$
On the interval $\left(-\frac{\pi}{2},\frac{\pi}{2} \right)$, clearly the function is symmetric and positive around the origin.
Let us consider $x \in \left(0,\frac{\pi}{2} \right)$
$$f'(x)  = \frac{\sec^2(x) (2x - \sin(2 x))}{2x^2} > 0$$
Note that $\lim_{x\to 0} f(x) = 1$, we deduce that the function is increasing on the interval $\left(0,\frac{\pi}{2} \right)$. Hence
$$\int^{\pi/2}_{-\pi/2}\frac{\tan(x)}{x}\,dx = 2 \int^{\pi/2}_0 \frac{\tan(x)}{x}\,dx >2 \int^{\pi/2}_0\,dx = \pi$$
 Also note that 
Near $\pi/2$ the integral acts like $\frac{1}{\pi/2-x}$ which diverges to inifnity.
The visual of $f$ is on that interval 

From the graph of $f$ on the real line it seems the integrals on left and right are also divergent to -infinity and contribute to the infinity at the middle to cause a convergent value.

Question
I need a proof if the principal value exists or not?
 A: Let $Z = \{k\pi +\frac{\pi}{2} : k \in \Bbb{Z}$ be the set of poles of $\tan x$ and define
$$ I(N,\epsilon) = \int\limits_{\substack{ \text{dist}(x,Z) > \epsilon \\ 0 < x < N\pi}} \frac{\tan x}{x} \, dx. $$
Then I will prove that
$$ \lim_{\substack{\epsilon &\to 0^+ \\ N&\to\infty}} I(N,\epsilon) = \frac{\pi}{2}. $$
Indeed, let $\epsilon \in (0,\pi/2)$. If we denote by $D(\epsilon) = \{x \in [0,\pi] : |x - \frac{\pi}{2}| > \epsilon \}$, then
\begin{align*}
I(N,\epsilon)
&= \frac{1}{2} \sum_{k=0}^{N-1} \int_{D(\epsilon)} \left( \frac{1}{x + k\pi} + \frac{1}{x - (k+1)\pi} \right) \tan x \, dx \\
&= \frac{1}{2} \int_{D(\epsilon)} \left( \sum_{k=0}^{N-1} \frac{2x-\pi}{(x + k\pi)(x - (k+1)\pi)} \right) \tan x \, dx \tag{*}
\end{align*}
Here are several observations:


*

*The function $f(x) = \dfrac{2x-\pi}{x(x-\pi)} \tan x$ extends to a bounded continuous function on $[0,\pi]$.

*On the interval $(0,\pi)$, we have the following bound
$$ \left|\frac{x(x-\pi)}{(x + k\pi)(x - (k+1)\pi)}\right|
\leq \begin{cases}
1, & k = 0, \\
\frac{1}{k^2}, & k \geq 1
\end{cases} $$
This shows that the integrand of $\text{(*)}$ converges uniformly on $(0,\pi)$ to
$$ \lim_{N\to\infty} \sum_{k=0}^{N-1} \left( \frac{1}{x+k\pi} + \frac{1}{x-(k+1)\pi} \right) \tan x = \cot x \cdot \tan x = 1. $$
Therefore it follows that
$$ \lim_{\substack{\epsilon &\to 0^+ \\ N&\to\infty}} I(N,\epsilon)
= \frac{1}{2}\int_{0}^{\pi} dx = \frac{\pi}{2}. $$

Addendum. In fact, the integrand of $\text{(*)}$ is always non-negative and monotone-increases to $1$ as $N \to \infty$:

Thus the same conclusion can be obtained by the monotone convergence theorem.
A: $\newcommand{\bbx}[1]{\,\bbox[8px,border:1px groove navy]{\displaystyle{#1}}\,}
 \newcommand{\braces}[1]{\left\lbrace\,{#1}\,\right\rbrace}
 \newcommand{\bracks}[1]{\left\lbrack\,{#1}\,\right\rbrack}
 \newcommand{\dd}{\mathrm{d}}
 \newcommand{\ds}[1]{\displaystyle{#1}}
 \newcommand{\expo}[1]{\,\mathrm{e}^{#1}\,}
 \newcommand{\ic}{\mathrm{i}}
 \newcommand{\mc}[1]{\mathcal{#1}}
 \newcommand{\mrm}[1]{\mathrm{#1}}
 \newcommand{\pars}[1]{\left(\,{#1}\,\right)}
 \newcommand{\partiald}[3][]{\frac{\partial^{#1} #2}{\partial #3^{#1}}}
 \newcommand{\root}[2][]{\,\sqrt[#1]{\,{#2}\,}\,}
 \newcommand{\totald}[3][]{\frac{\mathrm{d}^{#1} #2}{\mathrm{d} #3^{#1}}}
 \newcommand{\verts}[1]{\left\vert\,{#1}\,\right\vert}$

With $\ds{n \in \mathbb{N}_{\ \geq\ 0}}$:

\begin{align}
\mrm{P.V.}\int_{n\pi}^{n\pi + \pi}{\tan\pars{x} \over x}\,\dd x & =
\mrm{P.V.}\int_{0}^{\pi}{\tan\pars{x} \over x + n\pi}\,\dd x =
-\,\mrm{P.V.}\int_{-\pi/2}^{\pi/2}{\cot\pars{x} \over x + n\pi + \pi/2}\,\dd x
\\[5mm] & =
-\int_{0}^{\pi/2}\cot\pars{x}\pars{%
{1 \over x + n\pi + \pi/2} - {1 \over -x + n\pi + \pi/2}}\,\dd x
\\[5mm] & =
-\,{1 \over \pi}\int_{0}^{\pi/2}\cot\pars{x}\pars{%
{1 \over n + 1/2 + x/\pi} - {1 \over n + 1/2 - x/\pi}}\,\dd x
\end{align}

Then,
\begin{align}
\mrm{P.V.}\int_{0}^{\infty}{\tan\pars{x} \over x}\,\dd x & =
\sum_{n = 0}^{\infty}\mrm{P.V.}\int_{n\pi}^{n\pi + \pi}{\tan\pars{x} \over x}
\,\dd x
\\[5mm] & =
-\,{1 \over \pi}\int_{0}^{\pi/2}\cot\pars{x}
\bracks{\Psi\pars{{1 \over 2} - {x \over \pi}} -
\Psi\pars{{1 \over 2} + {x \over \pi}}}\,\dd x
\\[5mm] & =
-\,{1 \over \pi}\int_{0}^{\pi/2}
\cot\pars{x}\braces{\pi\cot\pars{\pi\bracks{{1 \over 2} + {x \over \pi}}}}
\,\dd x
\\[5mm] & =
-\,{1 \over \pi}\int_{0}^{\pi/2}\cot\pars{x}\bracks{-\pi\tan\pars{x}}\,\dd x =\
\bbox[15px,#ffe,border:1px dotted navy]{\ds{\pi \over 2}}
\end{align}
