Integral of Secant to an Even Power As I was working on some trig integration practice problems I came across a very interesting pattern with regards to the integral of secant when its power was an even integer greater than or equal to two:
$$\int sec^n(x)dx\\ n\ge 2\\ n\ \% \ \text{(modulo)} \ 2 = 0$$
Looking at the different integration's of the following I was able to determine the pattern.
$$ \int sec^2(x)dx = (1)\frac{tan(x)}{1} + C$$
$$ \int sec^4(x)dx = (1)\frac{tan^3(x)}{3} + (1)\frac{tan(x)}{1} + C$$
$$ \int sec^6(x)dx = (1)\frac{tan^5(x)}{5} + (2)\frac{tan^3(x)}{3} + (1)\frac{tan^1(x)}{1} + C$$
$$ \int sec^8(x)dx = (1)\frac{tan^7(x)}{7} + (3)\frac{tan^5(x)}{5} + (3)\frac{tan^3(x)}{3} + (1)\frac{tan^1(x)}{1} + C$$
$$...$$
Notice how the integrals evaluate to tangent every time. Also notice how the exponent of each tangent are the odd numbers that preceed the given exponent in the integral. Finally, notice how the coefficients of each fraction are consistent with those found in Pascal's triangle. The row number (of the triangle) is determined by n/2.
With these observations I set out to create a general formula to compute the integral for any integer 'n' that is cleanly divisible by two, and is equal to or greater than two.
First lets re-create Pascals triangle with the following formula. We will be able to pass in two parameters, one being the row we would like to look in, and the other being the column.
$$C_n,_k = \frac{n!}{(n-k)!*k!}$$
Next, we can see that the basis for each integration result listed above is being added, therefore we will use a summation to produce our desired results.
$$\sum_{i=0}^{n/2} {(C_{\frac{n}{2},i}) \frac{tan^{2i+1}(x)}{2i+1}} $$
So, now our formula can produce the results for any 'n' we choose, as long as it adheres to our given restrictions.
$$\int sec^n(x)dx = \sum_{i=0}^{n/2} {(C_{\frac{n}{2},i}) \frac{tan^{2i+1}(x)}{2i+1}} $$
$$\\ \\$$
Example usage:
$$\int sec^{12}(x)dx = $$
Let's take the 6th row of Pascal's triangle according to n/2 -> 12/2=6:
$$\text{1, 5, 10, 10, 5, 1}$$
Next, let's plug in accordingly:
$$ \int sec^{12}(x)dx = (1)\frac{tan^{11}(x)}{11} + (5)\frac{tan^{9}(x)}{9} + (10)\frac{tan^{7}(x)}{7} + (10)\frac{tan^{5}(x)}{5} + (5)\frac{tan^3(x)}{3} + (1)\frac{tan(x)}{1} + C$$
I have not been able to find any official documentation of this phenomena, but if anyone has more information please contribute. Thank you!
 A: We have $\sec^2{x}=1+\tan^2{x}$ and $\tan'=\sec^2$. Thus:
$$ \begin{align}
\int \sec^{2n+2}{x} \, dx &= \int \sec^2{x} (1+\tan^2{x})^n \, dx \\ 
&= \int (1+t^2)^n \, dt,
\end{align}$$
using the substitution $t=\tan{x}$. Now for $n$ an integer we can expand the bracket:
$$ \int (1+t^2)^n \, dt = \sum_{k=0}^n \binom{n}{k} \int t^{2k} \, dt = \sum_{k=0}^n \frac{1}{2k+1}\binom{n}{k} t^{2k+1}+C =\sum_{k=0}^n \frac{1}{2k+1}\binom{n}{k} \tan^{2k+1}{x}+C, $$
substituting back, so we find the general result
$$ \int \sec^{2n+2}{x} \, dx = \sum_{k=0}^n \frac{1}{2k+1}\binom{n}{k} \tan^{2k+1}{x}+C. $$
A: Here is a recursion derived from integrating by parts:
$$
\begin{align}
\int\sec^n(x)\,\mathrm{d}x
&=\int\sec^{n-2}(x)\,\mathrm{d}\tan(x)\tag{1}\\
&=\tan(x)\sec^{n-2}(x)-(n-2)\int\tan^2(x)\sec^{n-2}(x)\,\mathrm{d}x\tag{2}\\
&=\tan(x)\sec^{n-2}(x)-(n-2)\int\sec^n(x)\,\mathrm{d}x+(n-2)\int\sec^{n-2}(x)\,\mathrm{d}x\tag{3}\\
&=\frac1{n-1}\tan(x)\sec^{n-2}(x)+\frac{n-2}{n-1}\int\sec^{n-2}(x)\,\mathrm{d}x\tag{4}\\
&=\frac1{n-1}\tan(x)(\tan^2(x)+1)^{\frac{n-2}2}+\frac{n-2}{n-1}\int\sec^{n-2}(x)\,\mathrm{d}x\tag{5}\\
\end{align}
$$
Explanation:
$(1)$: prepare for integration by parts
$(2)$: integration by parts
$(3)$: $\tan^2(x)=\sec^2(x)-1$
$(4)$: add $\frac1{n-1}$ times $(3)$ to $\frac{n-2}{n-1}$ times the left side of $(1)$
$(5)$: $\sec^2(x)=\tan^2(x)+1$
