How do i evaluate this $\int^\frac{\pi}{2}_0 \frac{\sec^2x}{(\sec x+\tan x)^{n}}\,dx = ? ?$ Is there someone who can give me a fast way to evaluate  this :$$\int^\frac{\pi}{2}_0 \frac{\sec^2x}{(\sec x+\tan x)^{n}}\,dx =  ? $$
Note :what I think the result is : $\frac{n}{n²-1} $ but how if it were true ?
Thank you for any help.
 A: $$ I_n = \int_{0}^{\pi/2}\frac{\sec^2(x)\,dx}{(\sec x+\tan x)^n}  =\int_{0}^{\pi/2}\frac{d\theta}{\cos^2(\theta)\left(\frac{1+\sin\theta}{\cos\theta}\right)^n}=\int_{0}^{\pi/2}\frac{d\theta}{\sin^2(\theta)\left(\frac{1+\cos\theta}{\sin\theta}\right)^n}$$
hence:
$$ I_n = \int_{0}^{\pi/2}\frac{\sin^{n-2}(\theta)\,d\theta}{2^n\cos^{2n}(\theta/2)}=2\int_{0}^{\pi/4}\frac{\sin^{n-2}(2\theta)\,d\theta}{2^n\cos^{2n}(\theta)}=\frac{1}{2}\int_{0}^{\pi/4}\frac{\sin^{n-2}(\theta)}{\cos^{n+2}(\theta)}\,d\theta$$
then by substituting $\theta=\arctan t$ we have:
$$ I_n = \frac{1}{2}\int_{0}^{1}t^{n-2}(1+t^2)\,dt =\frac{1}{2}\left(\frac{1}{n-1}+\frac{1}{n+1}\right)=\color{red}{\frac{n}{n^2-1}}.$$
A: Maybe this answer from AOPS is helpful to you:
$I =\int_0 ^\frac{\pi}{2}\frac{\sec^{2}x}{(\sec x+\tan x)^{n}}\ dx = \int_0 ^\frac{\pi}{2}\frac{1}{(\sec x+\tan x)^{n}} \cdot \frac{1}{\cos^{2}x}\ dx$
$I = \int_0 ^\frac{\pi}{2}\frac{1}{\cos x}\cdot \frac{1}{(\sec x+\tan x)^{n}} \cdot \frac{1}{\frac{\sin x +1}{\cos x}}\cdot \frac{\sin x +1}{\cos^{2}x}\ dx$.
Integration by parts: $u =\frac{1}{\cos x}$ and $dv = \frac{1}{(\sec x+\tan x)^{n+1}} \cdot \frac{\sin x +1}{\cos^{2}x}\ dx$,
substitution: $\sec x+\tan x=t$, then $\frac{\sin x +1}{\cos^{2}x}dx =dt$,
so $v = \int t^{-n-1}\ dt$ and $v = \frac{t^{-n}}{-n}$.
$I = \left[\frac{1}{\cos x}\cdot \frac{-1}{n(\sec x+\tan x)^{n}}\right]_0 ^\frac{\pi}{2}+\frac{1}{n}\int_0 ^\frac{\pi}{2}\frac{1}{(\sec x+\tan x)^{n}}\cdot \frac{\sin x}{\cos^{2}x}\ dx$.
$I = \frac{1}{n}+\frac{1}{n}\int_0 ^\frac{\pi}{2}\frac{\sin x + 1 - 1}{(\sec x+\tan x)^{n}\cos^{2}x}\ dx$.
$I = \frac{1}{n}-\frac{1}{n}I +\frac{1}{n}\int_0 ^\frac{\pi}{2}\frac{\sin x + 1}{(\sec x+\tan x)^{n}\cos^{2}x}\ dx$.
The same substitution:
$I = \frac{1}{n}-\frac{1}{n}I +\frac{1}{n}\left[\frac{1}{(1-n)(\sec x+\tan x)^{n-1}}\right]_0 ^\frac{\pi}{2}$.
$n \cdot I = 1-I +\left[\frac{1}{(1-n)(\sec x+\tan x)^{n-1}}\right]_0 ^\frac{\pi}{2}$.
$(n+1)\cdot I = 1 -\frac{1}{n-1}\left[\frac{1}{(\sec x+\tan x)^{n-1}}\right]_0 ^\frac{\pi}{2}$.
$(n+1)\cdot I = 1 +\frac{1}{n-1} = \frac{n}{n-1}$.
$I = \frac{n}{n^{2}-1} $.
