Evaluating $\int \frac{\sec^2 x}{(\sec x + \tan x )^{{9}/{2}}}\,\mathrm dx$ How do I evaluate
$$\int \frac{\sec^2 x}{(\sec x + \tan x )^{{9}/{2}}}\,\mathrm dx$$
I've started doing this problem by taking $u=\tan x$.

There are already 7 nice solutions.  I want to generalize the result further, by rationalization and substitutions, of the given integral to $$
I(m ,n):=\int \frac{\sec ^m x}{(\sec x+\tan x)^{n}} d x= \int \frac{\sec ^{m} x(\sec x-\tan x)^{n}}{\left(\sec ^{2} x-\tan ^{2} x\right)^{n}} d x=\int \frac{(1-\sin x)^{n}}{\cos ^{m+n} x} d x
$$
Letting $y=\frac{\pi}{2}-x$ transforms the integral into
$$
I(m, n)=-\int \frac{\left(2\sin ^{2} \frac{y}{2}\right)^{n}}{2 ^{m+n}  \sin ^{m+n} \frac{y}{2} \cos ^{m+n} \frac{y}{2}} d x$$
Letting $z=2y$ transforms the integral into
$$I(m,n) =-\frac{1}{2^{m-1}} \int \tan ^{n-m}z \sec ^{2m}z d z$$
Letting $t=\tan z$ transforms the integral into
$$
\begin{aligned}
I(m, n)&=-\frac{1}{2^{m-1}} \int^{n} t^{n-m}\left(1+t^{2}\right)^{m-1} d t \\
&=-\frac{1}{2^{m-1}} \sum_{\substack{k=0}}^{m-1} \int t^{n-m+2 k} d t\\ &=-\frac{1}{2^{m-1}} \sum_{k=0}^{m-1} \frac{t^{n-m+2 k+1}}{n-m+2 k+1}+C \\ &=-\frac{1}{2^{m-1}} \sum_{k=0}^{m-1} \frac{(\sec x-\tan x)^{n-m+2 k+1}}{n-m+2 k+1}+C
\end{aligned}
$$
$$\boxed{I(m, n)=-\frac{1}{2^{m-1}} \sum_{k=0}^{m-1} \frac{(\sec x-\tan x)^{n-m+2 k+1}}{n-m+2 k+1}+C}$$
as $t=\tan \left(\frac{\pi}{4}-\frac{x}{2}\right)=\frac{1-\tan \frac{x}{2}}{1+\tan \frac{x}{2}}=\frac{\cos \frac{x}{2}-\sin \frac{x}{2}}{\cos \frac{x}{2}+\sin \frac{x}{2}}=\frac{\left(\cos \frac{x}{2}-\sin \frac{x}{2}\right)^{2}}{\cos ^{2} \frac{x}{2}-\sin ^{2} \frac{x}{2}}=\sec x-\tan x.$
Back to our original integral, putting $m=2$ and $n=\frac 92$ yields $$\begin{aligned} 
\int \frac{\sec^2 x}{(\sec x + \tan x )^{{9}/{2}}}\,\mathrm dx&=-\frac{1}{7} (\sec x-\tan x) ^{\frac{7}{2}}-\frac{1}{11} (\sec x-\tan x) ^{\frac{11}{2}}+C
\end{aligned}
$$
