You need to use reduction formula to integrate the function, such that:

`int sec^n x dx = int sec^(n-2) x* sec^2 x dx`

You need to use integration by parts, such that:

`int udv = uv - int vdu`

`u = sec^(n-2) x => du = (n-2)*sec^(n-3) x tan(x)`

`dv = sec^2 x => v = tan x`

`int sec^(n-2) x* sec^2 x dx = tan x*sec^(n-2) x - (n-2)*int sec^(n-3) x*tan x dx`

`int sec^(n-2) x* sec^2 x dx = tan x*sec^(n-2) x - (n-2)*int sec^(n-2) x*tan^2 x dx`

You need to replace `sec^2 x - 1` for `tan^2 x` , such that:

`int sec^(n-2) x* sec^2 x dx = tan x*sec^(n-2) x - (n-2)*int sec^(n-2) x*(sec^2 x - 1) dx`

`int sec^(n-2) x* sec^2 x dx = tan x*sec^(n-2) x - (n-2)*int (sec^n x- sec^(n-2) x) dx `

You need to put `I_n = int sec^n x dx,` such that:

`I_n = tan x*sec^(n-2) x - (n-2)*I_n + (n-2)*int sec^(n-2) x dx`

`I_n + (n-2)*I_n = tan x*sec^(n-2) x + (n-2)*int sec^(n-2) x dx `

`I_n*(n - 2 + 1) = tan x*sec^(n-2) x + (n-2)*int sec^(n-2) x dx `

Put `int sec^(n-2) x dx = I_(n-2)`

`(n-1)*I_n = tan x*sec^(n-2) x + (n-2)*I_(n-2)`

`I_n = 1/(n-1)* tan x*sec^(n-2) x + (n-2)/(n-1)*I_(n-2)`

**Hence, evaluating the given integral, using reduction formula yields `I_n = 1/(n-1)* tan x*sec^(n-2) x + (n-2)/(n-1)*I_(n-2).` **