<s>[INST] A trig ratio integral Consider the two integrals, where $a$ and $n$ are integers,
\begin{align}
I_{1} &= \int_{-n \pi}^{n \pi} \frac{\tan^{2a}x \, dx}{\tan^{2a}x + \cot^{2a}x} \\
I_{2} &= \int_{-(2n+1)\pi/2}^{(2n+1)\pi/2} \frac{\tan^{2a}x \, dx}{\tan^{2a}x + \cot^{2a}x}.
\end{align}
It would seem that $I_{2}$ would have a finite value. 
Questions:


*

*What is the finite value of $I_{2}$ ?

*What is the best way to evaluate the integral $I_{1}$ ?

 [/INST] inside  $I_1$ it is even function so integral will be
\begin{align}
I_{1} &=2 \int_{0}^{n \pi} \frac{\tan^{2a}x \, dx}{\tan^{2a}x + \cot^{2a}x} \\
\end{align}
 then what function written inside the integral holds $f(x)=f(n\pi-x)$
then integral $I_1$ will be
\begin{align}
I_{1} &=4 \int_{0}^{\frac{n \pi}{2}} \frac{\tan^{2a}x \, dx}{\tan^{2a}x + \cot^{2a}x} \\
\end{align}
then use property \begin{align}
I &= \int_{a}^{{b}} f(x) \\
\end{align}\begin{align}
I &= \int_{a}^{{b}} f(a+b-x) \\
\end{align}and  add both, you will get\begin{align}
2I_{1} &=4 \int_{0}^{\frac{n \pi}{2}} {\, dx}{ } \\
\end{align}
and this is real easy to do.in similar you can do $I_2$
</s>