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)$
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}$$
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} $$