Integrating the Secant Cubed

An unlikely duplication

Here’s a particularly nontrivial power-of-a-trig-function integral:

sec3x dxint sec^3{x} dx

So, how are we dealing with this?

If this were any other trigonometric function cubed we’d pull out a trigonometric identity. For instance

cos3x dx=(cosx)(cos2x) dxint cos^3{x} dx = int (cos{x})(cos^2{x}) dx

Then using sin2x=1cos2x\sin^2{x} = 1 - \cos^2{x} we get

=(cosx)(1sin2x) dx=cosxsin2xcosx dxegin{align*} &= int (cos{x})(1 - sin^2{x}) dx \ &= int cos{x} - sin^2{x} cos{x} dx end{align*}

and the rest is easy to integrate – inverse chain rule takes care of the right. So the strategy here was to break the product of sinx\sin{x}-s up into sinx\sin{x} and cosx\cos{x}, giving us an expanded product with parts that we can individually integrate.

Let’s try the same thing for secx\sec{x}. We’ll split it into secx\sec{x} and sec2x\sec^2{x}, then use the trigonometric identity tan2x+1=sec2x\tan^2{x} + 1 = \sec^2{x} (also part of your standard arsenal), giving

 sec3x dx= (secx)(sec2x) dx= (secx)(tan2x+1) dx= secxtan2x+secx dxegin{align*} & int sec^3{x} dx \ =& int (sec{x})(sec^2{x}) dx \ =& int (sec{x})( an^2{x} + 1) dx \ =& int sec{x} an^2{x} + sec{x} dx end{align*}

Now secxtan2x\sec{x} \tan^2{x} might look like it should work perfectly – but actually, there’s no inverse chain rule going on here! sec2x\sec^2{x} is the derivative of tanx\tan{x}, but here it’s tanx\tan{x} that’s been squared, not secx\sec{x}. Trying to split it up we get

secxtan2x=(secxtanx)(tanx)sec{x} an^2{x} = (sec{x} an{x})( an{x})

But again, we’re left with tanx\tan{x}, not the secx\sec{x} we want.

Okay, but we seem to have a derivative, so maybe some alarm bells in your head are ringing for integration by parts. Well, let’s try it.

We’ll integrate secxtanx\sec{x} \tan{x} to give secx\sec{x}, and differentiate tanx\tan{x} to give sec2x\sec^2{x}. Hence

 (secxtanx)(tanx) dx= (secx)(tanx)(secx)(sec2x) dx= secxtanxsec3x dxegin{align*} & int (sec{x} an{x})( an{x}) dx \ =& (sec{x})( an{x}) - int (sec{x})(sec^2{x}) dx \ =& sec{x} an{x} - int sec^3{x} dx end{align*}

And what’d’y’know, our original integral of sec3x\sec^3{x} has popped up again! Sometimes this can be an indication of parts gone wrong,1 but here it’s a beautiful sight to behold, because it’s solved the integral for us.

We can now put what we’ve just found into our original integral:

sec3x dx=secxtan2x+secx dx=secxtan2x dx+secx dx=secxtanxsec3x dx+secx dxegin{align*} int sec^3{x} dx &= int sec{x} an^2{x} + sec{x} dx \ &= int sec{x} an^2{x} dx + int sec{x} dx \ &= sec{x} an{x} - int sec^3{x} dx + int sec{x} dx end{align*}

Moving the duplicate integral of sec3x\sec^3{x} over:

2sec3x dx=secxtanx+secx dx=secxtanx+lnsecx+tanxegin{align*} 2 int sec^3{x} dx &= sec{x} an{x} + int sec{x} dx \ &= sec{x} an{x} + lnleft| sec{x} + an{x} ight| end{align*}

And so finally,

sec3x dx=12secxtanx+12lnsecx+tanxcint sec^3{x} dx = rac{1}{2} sec{x} an{x} + rac{1}{2} lnleft| sec{x} + an{x} ight| - c

Crazy, right?

And actually, you can derive the same result by starting with parts. Again, split sec3x\sec^3{x} as secx\sec{x} and sec2x\sec^2{x}.

sec3x dx=(secx)(sec2x) dxegin{align*} int sec^3{x} dx &= int (sec{x})(sec^2{x}) dx end{align*}

Then apply parts, integrating sec2x\sec^2{x} to tanx\tan{x} and differentiating secx\sec{x} to secxtanx\sec{x} \tan{x}.

=(secx)(tanx)(secxtanx)(tanx) dx=secxtanxsecxtan2x dxegin{align*} &= (sec{x})( an{x}) - int (sec{x} an{x})( an{x}) dx \ &= sec{x} an{x} - int sec{x} an^2{x} dx end{align*}

This gives us the same integral that we had above! But of course we can’t do parts again, since that would just cancel out…2

=secxtanx(secxtanxsec3x dx)=sec3x dxright back where we started!egin{align*} &= sec{x} an{x} - left(sec{x} an{x} - int sec^3{x} dx ight) \ &= int sec^3{x} dx qquad ext{right back where we started!} end{align*}

Instead, we can do what we did above, but backwards – using the identity to write tan2x\tan^2{x} as sec2x1\sec^2{x} - 1.

 secxtanxsecxtan2x dx= secxtanx(secx)(sec2x1) dxegin{align*} & sec{x} an{x} - int sec{x} an^2{x} dx \ =& sec{x} an{x} - int (sec{x})(sec^2{x} - 1) dx end{align*}

Then we can expand and separate the integral, once again giving us a duplicate integral of sec3x\sec^3{x}.

=secxtanxsec3xsecx dx=secxtanxsec3x dx+secx dxegin{align*} &= sec{x} an{x} - int sec^3{x} - sec{x} dx \ &= sec{x} an{x} - int sec^3{x} dx + int sec{x} dx end{align*}

And we know the drill from there.

2sec3x dx=secxtanx+secx dxsec3x dx=12secxtanx+12lnsecx+tanxcegin{align*} 2 int sec^3{x} dx &= sec{x} an{x} + int sec{x} dx \ int sec^3{x} dx &= rac{1}{2} sec{x} an{x} + rac{1}{2} lnleft| sec{x} + an{x} ight| - c end{align*}

I find it pretty cool how both methods apply the same 2 methods – ‘morphing’ trig with parts, and ‘splitting’ trig with identities – yet apply them in different orders to lead to the same result. Just goes to show how powerful and important flexibility with your trigonometric algebra is. Not only in integration, but maths as a whole!


  1. This only occurs if you’ve done parts twice but ended up doing the reverse of the first parts in the second iteration. It’s an easy trap to fall into!
  2. This is where getting the same thing through parts is not what you want.