Trigonometric Substitution in Integrals
Some integrals look harmless until a square root of a quadratic shows up. Expressions like \sqrt{4-x^2} or \sqrt{x^2+9} resist ordinary algebra, but a well-chosen trigonometric substitution turns the root into a simple trigonometric expression. This article covers when the method applies, how to pick the substitution, and how to return to x at the end.
If you want to check your own work along the way, the integral calculator shows each step of the solution. For the overall workflow of choosing a method, see How to Solve Integrals Step by Step.
When Trigonometric Substitution Applies
Look for one of these three radicals, where a>0 is a constant:
\sqrt{a^2-x^2}, \qquad \sqrt{a^2+x^2}, \qquad \sqrt{x^2-a^2}
Each one pairs with a Pythagorean identity. The substitution is chosen so that the expression under the root becomes a perfect square.
| Radical | Substitution | Identity used | Root becomes |
|---|---|---|---|
| \sqrt{a^2-x^2} | x=a\sin\theta | 1-\sin^2\theta=\cos^2\theta | a\cos\theta |
| \sqrt{a^2+x^2} | x=a\tan\theta | 1+\tan^2\theta=\sec^2\theta | a\sec\theta |
| \sqrt{x^2-a^2} | x=a\sec\theta | \sec^2\theta-1=\tan^2\theta | a\tan\theta (for x\ge a) |
The derivatives you need are dx=a\cos\theta\,d\theta, dx=a\sec^2\theta\,d\theta, and dx=a\sec\theta\tan\theta\,d\theta respectively.
Two details make the table correct:
- For x=a\sin\theta we take -\frac{\pi}{2}\le\theta\le\frac{\pi}{2}, so \cos\theta\ge 0 and \sqrt{\cos^2\theta}=\cos\theta.
- For x=a\tan\theta we take -\frac{\pi}{2}<\theta<\frac{\pi}{2}, so \sec\theta>0.
The third case needs extra care, and we come back to it in the section on common mistakes.
The substitution is a last resort, not a first move. If the integrand contains the root only through an expression like x\,dx, ordinary Integration by Substitution is much shorter.
Example 1: \int \dfrac{dx}{\sqrt{4-x^2}}
Here a=2, so we use x=2\sin\theta. Then dx=2\cos\theta\,d\theta and
\sqrt{4-x^2}=\sqrt{4-4\sin^2\theta}=\sqrt{4\cos^2\theta}=2\cos\theta.
Substitute:
\int \frac{2\cos\theta\,d\theta}{2\cos\theta}=\int d\theta=\theta+C.
Since \sin\theta=\frac{x}{2} and \theta lies in [-\frac{\pi}{2},\frac{\pi}{2}], we get \theta=\arcsin\frac{x}{2}:
\int \frac{dx}{\sqrt{4-x^2}}=\arcsin\frac{x}{2}+C.
Check. \dfrac{d}{dx}\arcsin\dfrac{x}{2}=\dfrac{1/2}{\sqrt{1-x^2/4}}=\dfrac{1}{\sqrt{4-x^2}}. ✓
This one is also a table-lookup integral, but the substitution shows where the formula comes from.
Returning to x with a Right Triangle
After integrating, the answer is in terms of \theta. A right triangle converts it back to x without memorizing inverse-function formulas. Draw the triangle from your substitution:
| Substitution | Triangle sides |
|---|---|
| x=a\sin\theta, so \sin\theta=\frac{x}{a} | opposite =x, hypotenuse =a, adjacent =\sqrt{a^2-x^2} |
| x=a\tan\theta, so \tan\theta=\frac{x}{a} | opposite =x, adjacent =a, hypotenuse =\sqrt{a^2+x^2} |
| x=a\sec\theta, so \sec\theta=\frac{x}{a} | hypotenuse =x, adjacent =a, opposite =\sqrt{x^2-a^2} |
The third side comes from the Pythagorean theorem. Once you have all three sides, any trigonometric function of \theta can be read off as a ratio.
Example 2: \int \sqrt{4-x^2}\,dx
Use x=2\sin\theta again. Then dx=2\cos\theta\,d\theta and \sqrt{4-x^2}=2\cos\theta, so
\int \sqrt{4-x^2}\,dx=\int 2\cos\theta\cdot 2\cos\theta\,d\theta=4\int\cos^2\theta\,d\theta.
Apply the half-angle identity \cos^2\theta=\frac{1+\cos 2\theta}{2}:
4\int\frac{1+\cos 2\theta}{2}\,d\theta=2\theta+\sin 2\theta+C=2\theta+2\sin\theta\cos\theta+C.
Now use the triangle for \sin\theta=\frac{x}{2}: the hypotenuse is 2, the opposite side is x, and the adjacent side is \sqrt{4-x^2}. Therefore
\sin\theta=\frac{x}{2},\qquad \cos\theta=\frac{\sqrt{4-x^2}}{2},\qquad \theta=\arcsin\frac{x}{2}.
Then 2\sin\theta\cos\theta=2\cdot\frac{x}{2}\cdot\frac{\sqrt{4-x^2}}{2}=\frac{x\sqrt{4-x^2}}{2}, and
\int \sqrt{4-x^2}\,dx=2\arcsin\frac{x}{2}+\frac{x}{2}\sqrt{4-x^2}+C.
Check. Differentiate each term:
\frac{d}{dx}\left(2\arcsin\frac{x}{2}\right)=\frac{2}{\sqrt{4-x^2}},
\frac{d}{dx}\left(\frac{x}{2}\sqrt{4-x^2}\right)=\frac{1}{2}\sqrt{4-x^2}-\frac{x^2}{2\sqrt{4-x^2}}.
Put everything over 2\sqrt{4-x^2}:
\frac{4+(4-x^2)-x^2}{2\sqrt{4-x^2}}=\frac{8-2x^2}{2\sqrt{4-x^2}}=\frac{4-x^2}{\sqrt{4-x^2}}=\sqrt{4-x^2}. ✓
You can check this step by step in the integral calculator.
Example 3: \int \dfrac{dx}{\sqrt{x^2+9}}
This is the tangent case with a=3. Let x=3\tan\theta, so dx=3\sec^2\theta\,d\theta and
\sqrt{x^2+9}=\sqrt{9\tan^2\theta+9}=3\sec\theta.
Substitute:
\int\frac{3\sec^2\theta\,d\theta}{3\sec\theta}=\int\sec\theta\,d\theta=\ln|\sec\theta+\tan\theta|+C.
(The antiderivative of \sec\theta is covered in Trigonometric Integrals.)
From the triangle, \tan\theta=\frac{x}{3} and \sec\theta=\frac{\sqrt{x^2+9}}{3}, so
\ln\left|\frac{\sqrt{x^2+9}+x}{3}\right|+C=\ln\left(x+\sqrt{x^2+9}\right)-\ln 3+C.
The constant -\ln 3 is absorbed into C:
\int\frac{dx}{\sqrt{x^2+9}}=\ln\left(x+\sqrt{x^2+9}\right)+C.
The absolute value is dropped because x+\sqrt{x^2+9}>0 for every real x.
Check.
\frac{d}{dx}\ln\left(x+\sqrt{x^2+9}\right)=\frac{1+\frac{x}{\sqrt{x^2+9}}}{x+\sqrt{x^2+9}}=\frac{\frac{\sqrt{x^2+9}+x}{\sqrt{x^2+9}}}{x+\sqrt{x^2+9}}=\frac{1}{\sqrt{x^2+9}}. ✓
Definite Integrals and Limits
For a definite integral you have two options:
- Find the antiderivative in x (as above) and plug in the original limits.
- Convert the limits to \theta and never return to x.
The second option is often shorter. Compute each new limit from the substitution, and make sure it lies in the allowed range of \theta.
Example. Evaluate \displaystyle\int_0^2\sqrt{4-x^2}\,dx.
With x=2\sin\theta:
- x=0 gives \sin\theta=0, so \theta=0.
- x=2 gives \sin\theta=1, so \theta=\frac{\pi}{2}.
The integral becomes
4\int_0^{\pi/2}\cos^2\theta\,d\theta=\Big[2\theta+\sin 2\theta\Big]_0^{\pi/2}=\pi+0-0=\pi.
This matches the geometry: the integral is the area of a quarter of a circle of radius 2, which is \frac{\pi\cdot 2^2}{4}=\pi.
Using the antiderivative from Example 2 gives the same value: 2\arcsin 1+\frac{2}{2}\sqrt{0}-0=\pi. ✓
To check this definite integral and see the area on a graph, open it in the integral calculator.
If you change the limits, do not substitute back to x afterward. Mixing the two approaches is a common source of wrong answers.
Common Mistakes
Dropping the sign of the root. The identity \sqrt{\cos^2\theta}=|\cos\theta| holds in general. It equals \cos\theta only because we restricted \theta to [-\frac{\pi}{2},\frac{\pi}{2}]. In the secant case, \sqrt{\tan^2\theta}=|\tan\theta| equals \tan\theta only for x\ge a. For x\le -a the angle lies in (\frac{\pi}{2},\pi], where \tan\theta\le 0, and the root equals -a\tan\theta. Always check which interval of x your integral lives on.
Ignoring the domain. The integrand \frac{1}{\sqrt{4-x^2}} exists only for -2<x<2, and \sqrt{x^2-a^2} requires |x|\ge a. A definite integral whose limits leave the domain is either undefined or needs a different treatment.
Forgetting dx. The factor a\cos\theta, a\sec^2\theta, or a\sec\theta\tan\theta from dx must appear in the new integrand. Leaving it out is the most frequent slip.
Not returning to x. An indefinite integral must be answered in the original variable. Use the triangle, and remember that \theta=\arcsin\frac{x}{a} or \theta=\arctan\frac{x}{a} when a bare \theta remains.
Using the method when it is not needed. The integral \int\frac{x\,dx}{\sqrt{4-x^2}} looks like a trigonometric case, but u=4-x^2 solves it in one line and gives -\sqrt{4-x^2}+C. Try Integration by Substitution first.
Forgetting +C. Every indefinite result needs it, and differentiating your answer is the quickest way to catch an error.
Quick Summary
- Match the radical to the table: sine for a^2-x^2, tangent for a^2+x^2, secant for x^2-a^2.
- Replace x, dx, and the root, then integrate in \theta.
- Use a right triangle to return to x, or convert the limits for a definite integral.
- Check by differentiating, and watch the sign of the root in the secant case.
For the bigger picture of how this method fits with the others, return to How to Solve Integrals Step by Step.