Integration of $\sec^4 x$ While practicing for the AP exam, I came across an integral that I found interesting and I attempted to do by hand: $$\int(\sec^4 x)\, dx$$
Eventually I got stuck, but here are the steps I took-
$$\int(\sec^4 x) \,dx$$
$$\int(\sec^2 x)(\sec x)(\sec x)\,dx$$ 
$$\int(\sec^2 x)(\sec x) (\frac{\tan x}{\sin x})\,dx$$
$$\int(\csc x)(\sec^2 x)(\sec x \tan x)\,dx $$
Apply Integration by parts
$$(u=\csc x, dv=\sec^2 x(\sec x\tan x)$$
$$\frac{\sec^3 x}{3\sin x} + \int(\frac{\sec^3 x}{3})(\csc x \cot x) \,dx$$
$$\frac{\sec^3 x}{3\sin x} + {1\over 3}\int(\sec^2 x)(\csc^2 x) \,dx$$
Here is where I get stuck.. I appreciate any help you can offer on where to go from here!

For this problem in particular, I would automatically do what @TheIntegrator did, but in general we can find 
$$I_n=\int\sec^nx\ dx$$
$$I_n=\int\sec^{n-2}x\sec^2x\ dx$$
$$I_n=\int(\tan^2x+1)^{n-2}\sec^2x\ dx$$
Applying the substitution $u=\tan x$ gives
$$I_n=\int(u^2+1)^{n-2}du$$
Assuming that $n\geq2$ is an even integer, we can expand our integrand into a series using the binomial formula:
$$(a+b)^m=\sum_{k=0}^m{m\choose k}a^{m-k}b^k$$
Plugging in $a=u^2$, $b=1$, and $m=n-2$ gives
$$I_n=\int\sum_{k=0}^{n-2}{n-2\choose k}(u^2)^{n-k-2}du$$
$$I_n=\int\sum_{k=0}^{n-2}{n-2\choose k}u^{2n-2k-4}du$$
Cleverly interchanging the $\sum$ and $\int$ signs,
$$I_n=\sum_{k=0}^{n-2}{n-2\choose k}\int u^{2n-2k-4}du$$
Integrating $u^{2n-2k-4}$ and plugging in gives 
$$I_n=\sum_{k=0}^{n-2}{n-2\choose k}\frac{u^{2n-2k-3}}{2n-2k-3}$$
$$I_n=\sum_{k=0}^{n-2}{n-2\choose k}\frac{(\tan x)^{2n-2k-3}}{2n-2k-3}+C$$
Keep in mind that this formula only works for positive even values of $n$. If you want to know a general formula that works for all $n$, I can show you, but it's a bit more involved. 
