How to Integrate Odd Powers of Tangents with Secants
You can integrate odd powers of tangents with secants. To integrate tan^{m} x sec^{n} x when m is odd — for example, tan^{7} x sec^{9} x — you would follow these steps:

Peel off a tan x and a sec x and place them next to the dx:

Use the trig identity tan^{2}x = sec^{2}x – 1 to express the remaining tangent factors in terms of secants:

Use the variable substitution u = sec x and du = sec x tan x dx:
At this point, the integral is a polynomial, and you can evaluate it.