How do I derive the secant reduction formula? Am I asking this question wrong?

Integrate: (sec x)^n dx

I(n) = Integral of dx/cos^n(x)

1/cos^n(x) = cos^2(x)/cos^(n+2)(x) =

[1-sin^2(x)]/cos^(n+2)(x).

So, I(n) = I(n+2) -
Integral of sin^(2)(x)/cos^(n+2)(x) dx

Integral of sin^(2)(x)/cos^(n+2)(x) dx =

-Integral of sin(x)/cos^(n+2)(x)dcos(x) = (Partial integration)

1/(n+1) sin(x)/cos^(n+1)(x)-

Integral of 1/(n+1) 1/cos^(n)(x)dx

The last integral was found as follows. We are integrating over cos(x) not x, so we need to differentiate the factor sin(x) w.r.t. cos(x) (not x).

dsin(x)/dcos(x) = dsin(x)/dx dx/dcos(x)

= cos(x) dx/dcos(x)

So, we see that:

I(n) = I(n+2) -
1/(n+1) sin(x)/cos^(n+1)(x) +I(n)/(n+1)

---------->

I(n+2) = n/(n+1)I(n) +
1/(n+1) sin(x)/cos^(n+1)(x)

Or

I(n) = (n-2)/(n-1)I(n-2) +
1/(n-1) sin(x)/cos^(n-1)(x)