Integrating the Secant Cubed

An unlikely duplication

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

∫sec⁡3x 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

∫cos⁡3x dx=∫(cos⁡x)(cos⁡2x) dxint cos^3{x} dx = int (cos{x})(cos^2{x}) dx

Then using sin⁡2x=1−cos⁡2x\sin^2{x} = 1 - \cos^2{x} we get

=∫(cos⁡x)(1−sin⁡2x) dx=∫cos⁡x−sin⁡2xcos⁡x 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 sin⁡x\sin{x}-s up into sin⁡x\sin{x} and cos⁡x\cos{x}, giving us an expanded product with parts that we can individually integrate.

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

 ∫sec⁡3x dx= ∫(sec⁡x)(sec⁡2x) dx= ∫(sec⁡x)(tan⁡2x+1) dx= ∫sec⁡xtan⁡2x+sec⁡x 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 sec⁡xtan⁡2x\sec{x} \tan^2{x} might look like it should work perfectly – but actually, there’s no inverse chain rule going on here! sec⁡2x\sec^2{x} is the derivative of tan⁡x\tan{x}, but here it’s tan⁡x\tan{x} that’s been squared, not sec⁡x\sec{x}. Trying to split it up we get

sec⁡xtan⁡2x=(sec⁡xtan⁡x)(tan⁡x)sec{x} an^2{x} = (sec{x} an{x})( an{x})

But again, we’re left with tan⁡x\tan{x}, not the sec⁡x\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 sec⁡xtan⁡x\sec{x} \tan{x} to give sec⁡x\sec{x}, and differentiate tan⁡x\tan{x} to give sec⁡2x\sec^2{x}. Hence

 ∫(sec⁡xtan⁡x)(tan⁡x) dx= (sec⁡x)(tan⁡x)−∫(sec⁡x)(sec⁡2x) dx= sec⁡xtan⁡x−∫sec⁡3x 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 sec⁡3x\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:

∫sec⁡3x dx=∫sec⁡xtan⁡2x+sec⁡x dx=∫sec⁡xtan⁡2x dx+∫sec⁡x dx=sec⁡xtan⁡x−∫sec⁡3x dx+∫sec⁡x 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 sec⁡3x\sec^3{x} over:

2∫sec⁡3x dx=sec⁡xtan⁡x+∫sec⁡x dx=sec⁡xtan⁡x+ln⁡∣sec⁡x+tan⁡x∣egin{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,

∫sec⁡3x dx=12sec⁡xtan⁡x+12ln⁡∣sec⁡x+tan⁡x∣−cint 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 sec⁡3x\sec^3{x} as sec⁡x\sec{x} and sec⁡2x\sec^2{x}.

∫sec⁡3x dx=∫(sec⁡x)(sec⁡2x) dxegin{align*} int sec^3{x} dx &= int (sec{x})(sec^2{x}) dx end{align*}

Then apply parts, integrating sec⁡2x\sec^2{x} to tan⁡x\tan{x} and differentiating sec⁡x\sec{x} to sec⁡xtan⁡x\sec{x} \tan{x}.

=(sec⁡x)(tan⁡x)−∫(sec⁡xtan⁡x)(tan⁡x) dx=sec⁡xtan⁡x−∫sec⁡xtan⁡2x 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

=sec⁡xtan⁡x−(sec⁡xtan⁡x−∫sec⁡3x dx)=∫sec⁡3x 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 tan⁡2x\tan^2{x} as sec⁡2x−1\sec^2{x} - 1.

 sec⁡xtan⁡x−∫sec⁡xtan⁡2x dx= sec⁡xtan⁡x−∫(sec⁡x)(sec⁡2x−1) 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 sec⁡3x\sec^3{x}.

=sec⁡xtan⁡x−∫sec⁡3x−sec⁡x dx=sec⁡xtan⁡x−∫sec⁡3x dx+∫sec⁡x 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.

2∫sec⁡3x dx=sec⁡xtan⁡x+∫sec⁡x dx∫sec⁡3x dx=12sec⁡xtan⁡x+12ln⁡∣sec⁡x+tan⁡x∣−cegin{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.↩

See an oversight or error? Drop an issue on GitHub↗.