# Evaluating a definite integral involving $\tan^{-1}$

The question is to evaluate $$\int_{\pi/2}^{5\pi/2} \frac{e^{\tan^{-1} \sin x}}{e^{\tan^{-1} \sin x}+e^{\tan^{-1} \cos x}}dx$$

I tried to take idea from the graph of $\tan^{-1} \tan x$ and rewrite the integral as $$\int_{\pi/2}^{5\pi/2} \frac{e^{\tan^{-1} \sin x}}{e^{\tan^{-1} \sin x}+e^{\tan^{-1} -\cos x}}dx$$.I couldn't proceed from here.Any ideas?Thanks.

Upon enforcing the substitution $x=\pi/2 -y$ we see that

\begin{align} I&=\int_{\pi/2}^{5\pi/2}\frac{e^{\arctan(\sin(x))}}{e^{\arctan(\sin(x))}+e^{\arctan(\cos(x))}}\,dx\\\\ &=\int_0^{2\pi}\frac{e^{\arctan(\cos(y))}}{e^{\arctan(\cos(y))}+e^{\arctan(\sin(y))}}\,dy\tag 1 \end{align}

Noting that the integrand is $2\pi$-periodic, we can write

$$\int_0^{2\pi}\frac{e^{\arctan(\cos(y))}}{e^{\arctan(\cos(y))}+e^{\arctan(\sin(y))}}\,dy=\int_{\pi/2}^{5\pi/2}\frac{e^{\arctan(\cos(y))}}{e^{\arctan(\cos(y))}+e^{\arctan(\sin(y))}}\,dy \tag 2$$

Using $(2)$ in $(1)$ we see that

$$I=\int_{\pi/2}^{5\pi/2}\frac{e^{\arctan(\cos(x))}}{e^{\arctan(\sin(x))}+e^{\arctan(\cos(x))}}\,dx \tag 3$$

Therefore, by adding $(1)$ and $(3)$ and dividing by $2$ yields the coveted result

$$\int_{\pi/2}^{5\pi/2}\frac{e^{\arctan(\sin(x))}}{e^{\arctan(\sin(x))}+e^{\arctan(\cos(x))}}\,dx=\pi$$