6. Trigonometric Substitution
≪ 5. Indeterminate Forms and L'Hôpital's Rule | Table of Contents | 7. Integration by Parts ≫Two weeks ago, we described how to take derivatives of inverse trigonometric functions. For instance, one can find (after a finite amount of time) that \[\frac{d}{dx}\arctan(x) = \frac{1}{1+x^2}. \] From this, it stands to reason that the indefinite integral \[\int \frac{1}{1+x^2} dx = \arctan(x) + C.\] This is one integral in a class of trigonometric integrals. One way to approach these is to simply remember the derivatives of all six inverse trig functions, then “look up” what the integral of one of their derivatives are. Chances are, however, that you have a finite memory, like myself.
Our goal is to develop a systematic method of determining these integrals. You’ll find that just like there was a magic triangle popping up to help us take inverse trig derivatives, we’ll be leveraging a triangle as an intermediary to determine our funky integrals.
The Trigonometric Substitution
Let’s start by approaching the integral \[\int \frac 1{\sqrt{1-x^2}} dx.\] Unfortunately for us, there aren’t any standard \(u\)-substitutions that can help us here, as nothing cancels out in our favour.
The quantity \(\sqrt{1-x^2}\) does look like a quantity that might appear on a triangle, however, and one might draw the following right triangle:

I’ve labeled one of the acute angles as \(\theta \). Then, it’s not hard to see that \[\cos \theta = \sqrt{1 - x^2},\] and we may express \[\int \frac 1{\sqrt{1-x^2}} dx = \int \frac 1{\cos(\theta )} dx.\] The advantage here is that we know the integral of \(\cos \theta \)! Rewriting our integral in terms of \(\theta \) has turned this nasty squarerooted quantity into something much more familiar.
However, as with standard \(u\)-substitution, we’re not quite ready to integrate — we need to rewrite \(dx\) in terms of \(d \theta \). We need to use implicit differentiation again. Looking back at the triangle, we have the fortunate relationship \[\sin \theta = x.\] Differentiating both sides with respect to \(x\), we get \[\cos( \theta ) \frac{d \theta }{ dx } = 1 \implies dx = \cos \theta d \theta .\] Now we substitute this in and watch the cosines melt away: \[\int \frac{1}{\sqrt{1-x^2}} dx = \int \frac{1}{\cos \theta } \cdot \cos \theta \ d \theta = \int 1\ d \theta = \theta +C.\] Finally, we need to rewrite \(\theta \) in terms of \(x\). Returning to \(\sin \theta = x\), we can isolate \(\theta \) as \(\theta = \arcsin x\), hence \[\int \frac{1}{\sqrt{1-x^2}} dx = \arcsin x + C.\]
To recap, we solved the integral by using the following steps:
- We identified the integrand as part of a right triangle, then rewrote it in terms of one of the angles, \(\theta \).
- We rewrote \(dx\) in terms of \(d \theta \) using the relations from the triangle and some implicit differentiation.
- We integrated and finally rewrote our answer in terms of \(x\) again.
I should add that it does not matter how you set up the triangle! There is often more than one choice for which angle you call \(\theta \), and it will not affect your final answer.
Some Algebraic Tricks
Sometimes, you may confronted with a quantity that does not appear at first glance to come from a triangle. For instance, consider the integral \[\int \frac{1}{10+2x+x^2} dx.\] A \(u\)-substitution is again not an option. For those of you in the know, we cannot perform a partial fraction decomposition on this either, as the denominator is irreducible. (We may discuss this technique at a later date.)
Instead, we need to complete the square. One might recognise that \(x^2+2x+1 = \left( x+1 \right)^2\), and we just need to “borrow” and \(1\) from the \(10\): \[10 + 2x + x^2 = 9 + \left( 1+2x+x^2 \right) = 9 + \left( x+1 \right)^2.\] This now is a quantity that looks like something out of a triangle! Specifically, we can draw the triangle

Then, we have \[\sin^2(\theta ) = \frac{9}{9+\left( x+1 \right)^2} \implies \frac{1}{9+\left( x+1 \right)^2} = \frac{1}{9}\sin^2(\theta ).\] To rewrite \(d \theta \) in terms of \(dx\), we may differentiate the equation \(\cot \theta = \frac{x+1}{3}\) to get \[-\csc^2(\theta ) \frac{d \theta }{dx} = \frac{1}{3} \implies dx = -3\csc^2(\theta ) d \theta = \frac{-3}{\sin^2(\theta )} d \theta .\] Putting this in, we get \[\int \frac{1}{10+2x+x^3} dx = \int \frac{1}{9}\sin^2( \theta ) \cdot \frac{-3}{\sin^2 ( \theta )} d \theta = -\frac{1}{3}\int 1\ d \theta = -\frac{1}{3} \theta + C.\] Finally, if \(\cot(\theta ) = \frac{x+1}{3}\), then \(\theta = \operatorname{arccot} \left( \frac{x+1}{3} \right)\), and we get the final answer of \[\int \frac{1}{10+2x+x^2} dx = -\frac{1}{3}\operatorname{arccot} \left( \frac{x+1}{3} \right) + C. \]
Supplement: Integrals of Products of Trigonometric Functions
When performing the above techniques on the integral \[\int \sqrt{1-x^2} dx,\] one eventually ends up with the integral \[\int \cos^2(\theta ) d \theta .\] I’ll leave the triangle business as an exercise (it’s the same triangle as our first example). But how does one handle an integral such as this one? Again, we don’t have any obvious \(u\)-substitutions to leverage.
For integrals like this, you’ll need to remember the Pythagorean identity \[\cos^2 \theta +\sin^2 \theta = 1\] and the double angle identities \[\begin{align*} \cos(2 \theta ) = \cos^2(\theta ) - \sin^2 (\theta) && \textrm{and} && \sin(2 \theta ) = 2\sin( \theta ) \cos(\theta ).\end{align*} \] By using the Pythagorean identity together with the double-angle formula for cosine, we can get the alternative formulae \[\cos(2 \theta ) = \cos^2(\theta ) - \sin^2(\theta ) = \left( 1-\sin^2(\theta ) \right) - \sin^2 \theta = 1 - 2\sin^2 \theta\] and \[\cos(2 \theta ) = \cos^2(\theta ) - \sin^2(\theta ) = \cos^2( \theta) - \left( 1- \cos^2(\theta ) \right) = 2\cos^2(\theta ) - 1. \] We can leverage this bottom equation to rewrite the two powers of cosine \(\cos^2(\theta )\) in terms of only a single power of cosine: \[\cos(2 \theta ) = 2\cos^2(\theta ) - 1 \implies \cos^2(\theta ) = \frac{1}{2}\left( 1+\cos(2 \theta ) \right).\] Thus, our integral becomes \[\int \cos^2(\theta ) d \theta = \int \frac{1}{2}\left( 1+\cos(2 \theta ) \right) d \theta = \frac{1}{2} \theta - \frac{1}{4}\sin(2 \theta ) + C. \]
Essentially, the double angle formulae give us a way to trade two trig functions (i.e. two cosines, two sines, or one of each) for a single trig function; once there’s only one trig function left, it’s easy sailing.
On the other hand, integrals such as \(\int \sin(\theta )\cos ^{18234}(\theta ) d \theta \) can be handled by a \(u\)-substitution. More broadly, whenever there’s only one \(\sin\) or one \(\cos\), you can just do a \(u\)-substitution, regardless of how many powers of the other there are.
To tackle integrals like \(\int \sin ^{7}(\theta ) \cos ^8 (\theta ) d \theta \), one can use the Pythagorean identity to rewrite \(\sin^2\) in terms of \(\cos^2\). Since \(\sin^7(\theta ) = \sin(\theta ) \cdot \left( \sin^2(\theta ) \right)^3\), you can wrangle this into an expression involving only one \(\sin\) and many cosines, from which a \(u\)-substitution will handle the rest.