Does $\int_{0}^{\infty} \frac{\sin (\tan x)}{x} \ dx $ converge? Does $ \displaystyle \int_{0}^{\infty} \ \frac{\sin (\tan x)}{x} dx $ converge?
$ \displaystyle \int_{0}^{\infty} \frac{\sin (\tan x)}{x} \ dx = \int_{0}^{\frac{\pi}{2}} \frac{\sin (\tan x)}{x} \ dx + \sum_{n=1}^{\infty} \int_{\pi(n-\frac{1}{2})}^{\pi(n+\frac{1}{2})} \frac{\sin (\tan x)}{x} \ dx $
The first integral converges since $\displaystyle \frac{\sin (\tan x)}{x}$ has a removable singularity at $x=0$ and is bounded near $ \displaystyle \frac{\pi}{2}$.
And $ \displaystyle \int_{\pi(n-\frac{1}{2})}^{\pi(n+\frac{1}{2})} \frac{\sin (\tan x)}{x} \ dx$ converges since $\displaystyle \frac{\sin (\tan x)}{x}$ is bounded near $\pi(n-\frac{1}{2})$ and $\pi(n+\frac{1}{2})$.
But does $ \displaystyle \sum_{n=1}^{\infty} \int_{\pi(n-\frac{1}{2})}^{\pi(n+\frac{1}{2})} \frac{\sin (\tan x)}{x} \ dx$ converge?
 A: Yes.
Note that 
$$\begin{align} I_n:=\int_{\pi(n-\frac12)}^{\pi(n+\frac12)}\frac{\sin(\tan(x))}{x}\,\mathrm dx&=\int_0^{\frac\pi2}\left(\frac1{n\pi+x}-\frac1{n\pi-x}\right)\sin(\tan(x))\,\mathrm dx\\&=\int_0^{\frac\pi2}\frac{-2x}{n^2\pi^2-x^2}\sin(\tan(x))\,\mathrm dx\\
\end{align}$$
With $A:=\int_0^{\frac\pi2}\max\{-2x\sin(\tan (x)),0\}\,\mathrm dx$, $B:=\int_0^{\frac\pi2}\min\{-2x\sin(\tan (x)),0\}\,\mathrm dx$ (which both converge), we can thus estimate
$$  \frac{1}{n^2\pi^2-\pi^2/4}B+\frac{1}{n^2\pi^2-0}A\le I_n\le \frac{1}{n^2\pi^2-\pi^2/4}A+\frac{1}{n^2\pi^2-0}B,$$
The difference between these bounds and $\frac1{n^2\pi^2}(A+B)$ is governed by 
$$\frac{1}{n^2\pi^2-\frac{\pi^2}{4}}-\frac1{n^2\pi^2}=\frac1{4\pi^2 n^4-\pi^2 n^2},$$
hence 
$$ I_n=\frac1{n^2\pi^2}(A+B)+O(n^{-4}).$$
We conclude that $\sum I_n$ converges at least as good as $\sum\frac1{n^2}$.
A: We proof directly without a summation step that

$$
K=\int_{-\infty}^{\infty}\frac{e^{i \tan(x)}}{x}dx=\int_{-\infty}^{\infty} f(x)=i\pi (1-e^{-1}) 
$$

OPs integral is then $\tfrac{\text{Im}K}2$ by symmetry
We need the following short idenity
$$\lim_{R\rightarrow\infty}\tan(R e^{i\phi})= i, \phi \in (0,\pi) \quad ({\star})$$
proof: $\tan(R e^{i\phi})= -i\tfrac{e^{Re^{i\phi}}-e^{-Re^{i\phi}}}{e^{Re^{i\phi}}+e^{-Re^{i\phi}}}=-i \tfrac{e^{R\sin(\phi)+iR\cos(\phi)}+O(e^{-R\sin(\phi)})}{-e^{R\sin(\phi)+iR\cos(\phi)}+O(e^{-R\sin(\phi)})}=i(1+O(e^{-R\sin(\phi)}))$
Now let us write (by Cauchy, note that we count the pole only half sine we enlose him half in the upper half plane)
$$
\oint f(z)dz=\int_{A(R)}f(z)dz+\int_{-R}^Rf(x)dx=-i \pi\text{res}(f(z),z=0)
$$
here $A(R)$ is a halfcircle of radius $R$ in the upper half plane of $\mathbb C
$
$$
\int_{-R}^Rf(x)=-\int_{A(R)}f(z)dz-i \pi \text{res}(f(z),z=0) \quad (\star\star)
$$
Now by $({\star})$, if $R$ is big enough, $\int_{A(R)}f(z)dz= \int_0^{\pi} d\phi\frac{i R e ^{i\phi}e^{i*i} }{R e^{ i \phi}}=i\pi e^{-1}$.
Therefore the rhs of $(\star \star)$ exists and $\lim_{R\rightarrow \infty}\int_{-R}^Rf(x)$ is finite and equals to $K$.
No our final result is just one simple residue calculation away

$$
K=i\pi (1-e^{-1})
$$

