Trig Substitution: The Three Cases, Triangles and Examples
Learn trigonometric substitution: which of the three substitutions to use, how to build the reference triangle, and how to convert the answer back to x.
By the PracticeCalculus team Published 7 min read
On this page
- What is trig substitution?
- The three trig substitutions
- The reference triangles, described in words
- The trig substitution method in five steps
- Worked example 1: the sine substitution
- Worked example 2: area of a quarter circle
- Worked example 3: the tangent substitution
- Worked example 4: the secant substitution
- Worked example 5: converting a double angle back to x
- Completing the square first
- When not to use trig substitution
- Common trig substitution mistakes
- Practice the three cases until they click
The integral \int \sqrt{4 - x^2}\,dx looks innocent, yet u-substitution fails (there is no x outside the root to absorb du) and integration by parts goes nowhere. Trig substitution removes the square root entirely by replacing x with a trig function, and it is the standard way to integrate expressions involving \sqrt{a^2 - x^2}, \sqrt{a^2 + x^2} and \sqrt{x^2 - a^2}.
What is trig substitution?
Trigonometric substitution replaces x with a\sin\theta, a\tan\theta or a\sec\theta so that a Pythagorean identity collapses the square root into a single term. For example, with x = 2\sin\theta:
The root is gone, and you are left with a trig integral. At the end you use a right triangle to rewrite the answer in terms of x.
The three trig substitutions
| Expression | Substitution | dx | Identity used | Root becomes |
|---|---|---|---|---|
| \sqrt{a^2-x^2} | x = a\sin\theta | a\cos\theta\,d\theta | 1-\sin^2\theta = \cos^2\theta | a\cos\theta |
| \sqrt{a^2+x^2} | x = a\tan\theta | a\sec^2\theta\,d\theta | 1+\tan^2\theta = \sec^2\theta | a\sec\theta |
| \sqrt{x^2-a^2} | x = a\sec\theta | a\sec\theta\tan\theta\,d\theta | \sec^2\theta-1 = \tan^2\theta | a\tan\theta |
A quick way to remember: minus x^2 means sine, plus means tangent, and x^2 minus means secant.
The substitutions come with restricted angle ranges (-\frac{\pi}{2} \le \theta \le \frac{\pi}{2} for sine, -\frac{\pi}{2} < \theta < \frac{\pi}{2} for tangent, and 0 \le \theta < \frac{\pi}{2} for secant when x \ge a). On these ranges \cos\theta, \sec\theta and \tan\theta are nonnegative, which is why the square roots simplify without absolute values.
The reference triangles, described in words
To convert back to x, draw a right triangle with angle \theta and label two sides straight from your substitution. The third side comes from the Pythagorean theorem, and it is always the square root from the problem.
- Sine case, x = a\sin\theta. Since \sin\theta = \frac{x}{a} = \frac{\text{opposite}}{\text{hypotenuse}}, put x on the side opposite \theta and a on the hypotenuse. The adjacent side is \sqrt{a^2 - x^2}.
- Tangent case, x = a\tan\theta. Since \tan\theta = \frac{x}{a} = \frac{\text{opposite}}{\text{adjacent}}, put x opposite and a adjacent. The hypotenuse is \sqrt{a^2 + x^2}.
- Secant case, x = a\sec\theta. Since \sec\theta = \frac{x}{a} = \frac{\text{hypotenuse}}{\text{adjacent}}, put x on the hypotenuse and a adjacent. The opposite side is \sqrt{x^2 - a^2}.
Once the triangle is labeled, any trig function of \theta is a ratio of two sides. For instance, in the sine triangle \cot\theta = \frac{\text{adjacent}}{\text{opposite}} = \frac{\sqrt{a^2-x^2}}{x}.
The trig substitution method in five steps
- Identify the form and choose the substitution from the table.
- Substitute for x, dx and the root.
- Simplify and integrate the trig integral in \theta.
- Build the triangle from your substitution.
- Convert back to x using the triangle (and \theta = \arcsin\frac{x}{a} or similar for any bare \theta).
Worked example 1: the sine substitution
Evaluate \int \frac{dx}{x^2\sqrt{9-x^2}}.
Step 1. Identify the form. \sqrt{9 - x^2} is \sqrt{a^2 - x^2} with a = 3, so let x = 3\sin\theta.
Step 2. Substitute. dx = 3\cos\theta\,d\theta, x^2 = 9\sin^2\theta and \sqrt{9 - x^2} = 3\cos\theta:
Step 3. Integrate. \int\csc^2\theta\,d\theta = -\cot\theta, so the result is -\frac19\cot\theta + C.
Step 4. Build the triangle. \sin\theta = \frac{x}{3}: opposite x, hypotenuse 3, adjacent \sqrt{9 - x^2}.
Step 5. Convert back. \cot\theta = \frac{\sqrt{9-x^2}}{x}, so
Worked example 2: area of a quarter circle
Evaluate \int_0^2 \sqrt{4 - x^2}\,dx.
The curve y = \sqrt{4 - x^2} is the top half of the circle of radius 2, so this integral should equal a quarter of the circle's area, \frac14\pi(2)^2 = \pi. Let's confirm it.
Step 1. Let x = 2\sin\theta, so dx = 2\cos\theta\,d\theta and \sqrt{4 - x^2} = 2\cos\theta.
Step 2. Change the bounds. When x = 0, \sin\theta = 0, so \theta = 0. When x = 2, \sin\theta = 1, so \theta = \frac{\pi}{2}.
Step 3. Substitute.
Step 4. Use the half-angle identity \cos^2\theta = \frac{1 + \cos 2\theta}{2}:
Because we changed the bounds, there was no need to convert back to x.
Worked example 3: the tangent substitution
Evaluate \int \frac{dx}{\sqrt{x^2+4}}.
Step 1. The form is \sqrt{a^2 + x^2} with a = 2. Let x = 2\tan\theta.
Step 2. dx = 2\sec^2\theta\,d\theta and \sqrt{x^2 + 4} = \sqrt{4\tan^2\theta + 4} = 2\sec\theta:
Step 3. \int\sec\theta\,d\theta = \ln|\sec\theta + \tan\theta| + C.
Step 4. Triangle. \tan\theta = \frac{x}{2}: opposite x, adjacent 2, hypotenuse \sqrt{x^2 + 4}. So \sec\theta = \frac{\sqrt{x^2+4}}{2}.
Step 5. Convert back.
The -\ln 2 is a constant, so it merges into C:
Worked example 4: the secant substitution
Evaluate \int \frac{\sqrt{x^2-1}}{x}\,dx for x > 1.
Step 1. The form is \sqrt{x^2 - a^2} with a = 1. Let x = \sec\theta with 0 \le \theta < \frac{\pi}{2}.
Step 2. dx = \sec\theta\tan\theta\,d\theta and \sqrt{x^2 - 1} = \tan\theta:
Step 3. Use \tan^2\theta = \sec^2\theta - 1:
Step 4. Triangle. \sec\theta = x: hypotenuse x, adjacent 1, opposite \sqrt{x^2-1}. So \tan\theta = \sqrt{x^2-1}, and \theta = \operatorname{arcsec} x.
Step 5.
Worked example 5: converting a double angle back to x
Evaluate \int \frac{x^2}{\sqrt{1-x^2}}\,dx.
Step 1. The form is \sqrt{a^2 - x^2} with a = 1. Let x = \sin\theta.
Step 2. dx = \cos\theta\,d\theta and \sqrt{1 - x^2} = \cos\theta:
Step 3. Use \sin^2\theta = \frac{1 - \cos 2\theta}{2}:
Step 4. Rewrite the double angle. The triangle only gives you functions of \theta, not 2\theta, so use \sin 2\theta = 2\sin\theta\cos\theta:
Step 5. Convert back. The triangle for \sin\theta = x has opposite x, hypotenuse 1 and adjacent \sqrt{1-x^2}, so \cos\theta = \sqrt{1 - x^2}. And \theta = \arcsin x.
Tip: whenever your \theta-answer contains \sin 2\theta or \cos 2\theta, expand it with a double-angle identity before using the triangle.
Completing the square first
If the root holds a general quadratic, complete the square to reach one of the three forms. For \int \frac{dx}{\sqrt{x^2 + 2x + 5}}:
Let u = x + 1 (so du = dx). The integral becomes \int \frac{du}{\sqrt{u^2 + 4}}, which is exactly example 3:
When not to use trig substitution
Always check for a simpler method first. In \int \frac{x}{\sqrt{9 - x^2}}\,dx, the factor x is (up to a constant) the derivative of 9 - x^2, so u-substitution with u = 9 - x^2 gives -\sqrt{9 - x^2} + C in two lines. Trig substitution would work, but it is the long way around. Similarly, a rational function with no root is usually a job for partial fractions.
Common trig substitution mistakes
- Picking the wrong substitution. \sqrt{x^2 - 9} needs secant, not sine. Match the sign pattern carefully.
- Forgetting to substitute dx. dx becomes a\cos\theta\,d\theta (or the matching expression), not d\theta.
- Leaving the answer in \theta. An indefinite integral must end in x. Use the triangle.
- Mislabeling the triangle. Write the defining ratio (\sin\theta = \frac{x}{a}, for example) and place sides from it, rather than from memory.
- Using old bounds. For definite integrals, convert the bounds to \theta values, or convert back to x before evaluating.
Practice the three cases until they click
Trig substitution has a lot of moving parts, but every problem follows the same five steps. The fastest way to get comfortable is to do several problems in a row so the triangles become automatic. The interactive lesson below gives you instant feedback on each substitution and shows the triangle whenever you get stuck.
Practice it now
Trig substitution
Solve real problems on this topic with instant feedback, hints and a step-by-step walkthrough for every answer. Free, no sign-up needed to start.
Practice this lesson