Hi

I am trying to solve the integral of tan^3(x) dx but i seem to have made a slight error with the answer.

This is the calculations i made, i can't see where my logic failed me:

The answer seems to be natural log of cos x instead of sec x. But i am not quite getting how ?

Hope some one can spot my error.