Hide answer & extension
Surprisingly, the value of the integral does not depend on \(a\). To show this, first use \(\tan(x)=\frac{\sin(x)}{\cos(x)}\) on both integrals:
$$I_1=\int_0^{\frac\pi2}\frac1{1+\tan^a(x)}\,dx
$$$$=\int_0^{\frac\pi2}\frac{\cos^a(x)}{\cos^a(x)+\sin^a(x)}\,dx$$
$$I_2=\int_0^{\frac\pi2}\frac1{1+\cot^a(x)}\,dx
$$$$=\int_0^{\frac\pi2}\frac{\sin^a(x)}{\cos^a(x)+\sin^a(x)}\,dx$$
Now consider \(I_1+I_2\):
$$I_1+I_2 = \int_0^{\frac\pi2}\frac{\cos^a(x)+\sin^a(x)}{\cos^a(x)+\sin^a(x)}\,dx$$$$=\int_0^{\frac\pi2}1\,dx$$$$=\frac\pi2$$
By substituting \(u=\tfrac\pi4-x\) into \(I_2\), it can be shown that \(I_1 = I_2\).
Therefore \(I_1=\tfrac\pi4\).
Extension
What is
$$\int_0^{\frac\pi2}\frac1{1-\tan^a(x)}\,dx?$$