Prove $\int\limits_{0}^{\pi/2}\frac{dx}{1+\sin^2{(\tan{x})}}=\frac{\pi}{2\sqrt{2}}\bigl(\frac{e^2+3-2\sqrt{2}}{e^2-3+2\sqrt{2}}\bigr)$ 
Prove the following integral
  $$I=\int\limits_{0}^{\frac{\pi}{2}}\dfrac{dx}{1+\sin^2{(\tan{x})}}=\dfrac{\pi}{2\sqrt{2}}\left(\dfrac{e^2+3-2\sqrt{2}}{e^2-3+2\sqrt{2}}\right)$$

This integral result was calculated using Mathematica and 
I like this integral. But I can't solve it. 
My idea:
Let $$\tan{x}=t\Longrightarrow dx=\dfrac{1}{1+t^2}dt$$
so
$$I=\int\limits_{0}^{\infty}\dfrac{dt}{1+\sin^2{t}}\cdot \dfrac{1}{1+t^2}$$
then I can't proceed. Can you help me? Thank you.
 A: First note that
$$ \begin{align} \int_{0}^{\pi /2} \frac{1}{1+ \sin^{2} ( \tan x)} \ dx &=  \int_{0}^{\infty} \frac{1}{(1+\sin^{2} t)(1+t^{2})} \ dt \\ &= 2 \int_{0}^{\infty} \frac{1}{(3 - \cos 2t)(1+t^{2})} \ dt \end{align}$$
Then using the identity $$\sum_{k=0}^{\infty} a^{k} \cos(kx) = \frac{1- a \cos x}{1-2a \cos x + a^{2}} , \ \ |a|<1$$
we have
$$1 + 2 \sum_{k=1}^{\infty} a^{k} \cos(kx) = 1 + 2 \left(\frac{1-a \cos x}{1-2a \cos x +a^{2}} -1\right) = \frac{1-a^{2}}{1-2 a \cos x + a^{2}}$$
Therefore,
$$ \begin{align} \int_{0}^{\infty} \frac{1}{(1-2a \cos 2x +a^{2})(1+x^{2})} \ dx &= \frac{1}{1-a^{2}} \int_{0}^{\infty} \Big(1+2 \sum_{k=1}^{\infty} a^{k} \cos(2kx) \Big) \ \frac{1}{1+x^{2}} \ dx \\ &= \frac{\pi}{2} \frac{1}{1-a^{2}} + \frac{2}{1-a^{2}} \sum_{k=1}^{\infty} a^{k} \int_{0}^{\infty} \frac{\cos(2kx)}{1+x^{2}} \ dx \\  &= \frac{\pi}{2} \frac{1}{1-a^{2}} + \frac{\pi}{1-a^{2}} \sum_{k=1}^{\infty} \Big(\frac{a}{e^{2}} \Big)^{k} \\ &= \frac{\pi}{2} \frac{1}{1-a^{2}} + \frac{\pi}{1-a^{2}} \frac{a/e^{2}}{1-a^/e^{2}} \\ &= \frac{\pi}{2} \frac{1}{1-a^{2}} \Big(1+ \frac{2a}{e^{2}-a} \Big) = \frac{\pi}{2} \frac{1}{1-a^{2}} \frac{e^{2}+a}{e^{2}-a} \end{align}$$
Now rewrite the integral as
$$ \frac{1}{1+a^{2}} \int_{0}^{\infty} \frac{1}{(1 - \frac{2a}{1+a^{2}} \cos 2x)(1+x^{2})} \ dx$$
and let $a= 3 - 2 \sqrt{2}$.
Then
$$ \begin{align} \frac{1}{1+a^{2}} \int_{0}^{\infty} \frac{1}{(1- \frac{1}{3} \cos 2x)(1+x^{2})} \ dx  &= \frac{3}{1+a^{2}} \int_{0}^{\infty} \frac{1}{(3 - \cos 2x)(1+x^{2})} \ dx \\ &= \frac{\pi}{2} \frac{1}{1-a^{2}} \frac{e^{2} + 3 - 2 \sqrt{2}}{e^{2} - 3 + 2 \sqrt{2}} \end{align}$$
which implies
$$ \begin{align} \int_{0}^{\pi /2} \frac{1}{1+\sin^{2} (\tan x)} \ dx &= \frac{\pi}{3} \frac{1+a^{2}}{1-a^{2}}\frac{e^{2} + 3 - 2 \sqrt{2}}{e^{2} - 3 + 2 \sqrt{2}} \\ &= \frac{\pi}{3} \frac{3}{2 \sqrt{2}}\frac{e^{2} + 3 - 2 \sqrt{2}}{e^{2} - 3 + 2 \sqrt{2}} \\ &= \frac{\pi}{2 \sqrt{2}}\frac{e^{2} + 3 - 2 \sqrt{2}}{e^{2} - 3 + 2 \sqrt{2}}  \end{align}$$
A: I hope nobody cares that i exhume this question, but i found it interesting that it is possible to obtain this integral by a relativly straightforward contour integration method.
Observe that,following the question opener and using parity, that we can rewrite the integral as
$$
\frac{1}{2}\int^{\infty}_{-\infty}\frac{1}{1+t^2}\frac{1}{1+\sin^2(t)}
$$
It is now easy to show that the poles are
$$
t_{\pm}=\pm i\\
t_{n\pm}=\pi n\pm i \text{arcsinh(1)}
$$
so we have two isolated poles and the rest lies on two straight lines paralell to the real axis.
Because the integrand interpreted as a complex function converges as $|z|\rightarrow\infty$ we can choose a semicircle closed in the upper half  plane as an integration contour. We find
$$
I=\pi i\sum_{n=-\infty}^{\infty}\text{res}(t_{n+})+\pi i \text{res}(t_{+})
$$
Where the residues are given by
$$
\text{res}(t_{+})=\frac{i}{2}\frac{1}{2 \sinh^2(1)-1}\\
\text{res}(t_{n+})=\frac{-i}{2\sqrt{2}}\frac{1}{1+(n \pi+i \text{arcsinh(1)} )^2}
$$
Therefore the integral reduces to the following sum
$$
I=\frac{\pi}{2\sqrt{2}} \sum_{n=-\infty}^{\infty} \frac{1}{1+(n \pi+i \text{arcsinh(1)})^2} -\frac{\pi}{2}\frac{1}{2 \sinh^2(1)-1}
$$
Using a partial fraction decomposition together with the Mittag-Leffler expansion of $\coth(x)$, this can be rewritten as
$$
I=\frac{\pi}{4\sqrt{2}} \sum_{n=-\infty}^{\infty} \frac{-i}{-i+n \pi+ \text{arcsinh(1)}}+ \frac{i}{i+n \pi+ i\text{arcsinh(1)}}-\frac{\pi}{2}\frac{1}{2 \sinh^2(1)-1}=\\
\frac{\sqrt{2} \pi}{8} \left(  \coth \left(1-\text{arcsinh(1)}\right)+  \coth \left(1+\text{arcsinh(1)}\right)\right)-\frac{\pi}{2}\frac{1}{2 \sinh^2(1)-1}\\
$$
Or 
$$
I\approx 1.16353
$$
Which matches the claimed result.
One can also compute this explicitly noting that $\text{arcsinh(1)}=\log(1+\sqrt{2})$ (*). But this is rather tedious so i just leave this step to the reader and conclude that
$$
I=\frac{e^2+3-2\sqrt{2}}{e^2-3+2\sqrt{2}}
$$
Appendix
Just to give some details of the last part of the calculations:
Using (*) the part stemming from the sum is 
$$
\frac{\pi}{4\sqrt{2}}\left(\frac{ \frac{1+\sqrt{2}}{e}+\frac{e}{1+\sqrt{2}}}{ \frac{e}{1+\sqrt{2}}-\frac{1+\sqrt{2}}{e}}+\frac{e \left(1+\sqrt{2}\right)+\frac{1}{1+\sqrt{2} e} }{\left(1+\sqrt{2}\right) e-\frac{1}{\left(1+\sqrt{2}\right) e}}\right)=\\
\frac{\left(e^4-1\right) \pi }{2 \sqrt{2} \left(1-6 e^2+e^4\right)}
$$
The part of the single pole gives
$$
\frac{\pi }{2 \left(\left(\frac{e}{2}-\frac{1}{2 e}\right)^2-1\right)}=\frac{2 e^2 \pi }{1-6 e^2+e^4}
$$
Adding both terms and factorizing then yields the desired result
A: Let $f : [-1,1] \to \mathbb{R}$ be any continuous even function on $[-1,1]$. 
Consider following integral
$$I_f \stackrel{def}{=} 
\int_0^{\pi/2} f(\sin(\tan x)) dx 
= \frac12 \int_{-\pi/2}^{\pi/2} f(\sin(\tan x)) dx
= \frac12 \int_{-\infty}^{\infty} f(\sin y)\frac{dy}{1+y^2}
$$
where $y = \tan x$. Since $f(\cdot)$ is even, $f(\sin y)$ is periodic in $y$ with period $\pi$. We can rewrite $I_f$ as
$$
I_f = \frac12 \int_{-\pi/2}^{\pi/2} f(\sin y)g(y) dy
$$
where 
$$g(y) 
= \sum_{n=-\infty}^\infty \frac{1}{1+(y+n\pi)^2}
= \frac{1}{2i}\sum_{n=-\infty}^\infty \left(\frac{1}{n\pi + y - i} - \frac{1}{n\pi+y + i}\right)$$
Let $z = \tan y$ and $T = -i\tan i = \tanh 1 = \frac{e^2-1}{e^2+1}$. Recall following expansion of $\cot y$,
$$\cot y = \frac{1}{y} + \sum_{n \in \mathbb{Z} \setminus \{0\}}\left( \frac{1}{y+n\pi} - \frac{1}{n\pi}\right)$$
We find
$$g(y) = \frac{1}{2i}(\cot(y-i) - \cot(y+i))
= \frac{1}{2i} \left(\frac{1 + izT}{z - iT} - \frac{1 - izT}{z + iT}\right)
= \frac{(z^2+1)T}{z^2+T^2}
$$
As a result, we can get rid of the explicit trigonometric dependence in $I_f$:
$$
I_f = \frac12 \int_{-\infty}^\infty f\left(\frac{z}{\sqrt{1+z^2}}\right) \frac{(z^2+1)T}{z^2+T^2} \frac{dz}{1+z^2}
= \frac{T}{2}\int_{-\infty}^\infty f\left(\frac{z}{\sqrt{1+z^2}}\right) \frac{dz}{z^2+T^2}
$$
For any $a > 0$, let $b = \sqrt{a^2+1}$ and apply above formula to
$f_{a}(z) \stackrel{def}{=} \frac{1}{a^2+z^2}$, we have
$$\begin{align}
I_{f_a}
&= \frac{T}{2}\int_{-\infty}^\infty \frac{z^2+1}{a^2+b^2z^2}\frac{dz}{z^2+T^2}\\
&= \frac{T}{2(a^2-b^2T^2)}\int_{-\infty}^\infty \left(\frac{1-T^2}{z^2+T^2} - \frac{1}{a^2+b^2z^2}\right) dz\\
&= \frac{T}{2(a^2-b^2T^2)}\left((1-T^2)\frac{\pi}{T} - \frac{\pi}{ab}\right)
 = \frac{\pi}{2ab}\frac{b + aT}{a + bT}
\end{align}
$$
When $a = 1$, $b$ becomes $\sqrt{2}$ and $I_{f_1}$ reduces to the integral $I$ we want to compute, i.e.
$$I = I_{f_1} = \frac{\pi}{2\sqrt{2}}\frac{\sqrt{2}+\frac{e^2-1}{e^2+1}}{1+\sqrt{2}\frac{e^2-1}{e^2+1}}
= \frac{\pi}{2\sqrt{2}}\frac{(\sqrt{2}+1)e^2 + (\sqrt{2}-1)}{(\sqrt{2}+1)e^2 - (\sqrt{2}-1)}
= \frac{\pi}{2\sqrt{2}}\frac{e^2 + (\sqrt{2}-1)^2}{e^2 - (\sqrt{2}-1)^2}
$$
