An error here: [itex]tan^2(x)= sec^2(x)- 1[/itex], not [itex]1- sec^2(x)[/itex]
Remember that sin^2(x)+ cos^2(x)= 1 and you are dividing by cos^2(x) to get tan^2(x)+ 1= sec^2(x).
u = secx
du = secxtanx dx
because you can write the integral as
S (sec^2(x)- 1)^2 )(sec^3(x))(tan(x)sec(x)dx)
and those become
(u^2- 1)^2(u^3)(du)
S (1-u^2)*u^3
Three errors- you want u^2- 1, not 1- u^2, you forgot the square on that, and you forgot the "du".
Correcting those "typos", it will be completely correct and very clever!