5.2 Trigonometric Substitution
Square roots of $a^2-x^2$, $a^2+x^2$ and $x^2-a^2$ disappear when $x$ becomes the side of a right triangle.
What is the area of a circle? Everyone knows the answer is $\pi r^2$, but with Calculus I alone we cannot actually prove it: the area of the upper half of the disc $x^2+y^2\le r^2$ is $\displaystyle\int_{-r}^{r}\sqrt{r^2-x^2}\,dx$, and neither substitution nor integration by parts gets anywhere with this integrand. The same square roots appear when we measure fuel in a cylindrical tank, the length of a hanging cable, the electric field near a charged rod and the orbit of a satellite.
The trick is to run substitution in reverse. Instead of naming a piece of the integrand $u$, we replace $x$ itself by a trigonometric function of a new variable $\theta$, chosen so that a Pythagorean identity swallows the square root. Geometrically, we make $x$ and $a$ two sides of a right triangle — and the square root is simply the third side.
The Three Substitutions
Each of the three Pythagorean identities matches one shape of square root: $$1-\sin^2\theta=\cos^2\theta,\qquad 1+\tan^2\theta=\sec^2\theta,\qquad \sec^2\theta-1=\tan^2\theta.$$ Multiplying by $a^2$, the substitution $x=a\sin\theta$ turns $a^2-x^2$ into $a^2\cos^2\theta$, and so on. The square root of a square is an absolute value, so we restrict $\theta$ to an interval on which the trigonometric factor is non-negative — and on which the substitution can be undone.
| Integrand contains | Substitute | Restriction on $\theta$ | Then |
|---|---|---|---|
| $\sqrt{a^2-x^2}$ | $x=a\sin\theta,\ dx=a\cos\theta\,d\theta$ | $-\tfrac\pi2\le\theta\le\tfrac\pi2$ | $\sqrt{a^2-x^2}=a\cos\theta$ |
| $\sqrt{a^2+x^2}$ | $x=a\tan\theta,\ dx=a\sec^2\theta\,d\theta$ | $-\tfrac\pi2\lt\theta\lt\tfrac\pi2$ | $\sqrt{a^2+x^2}=a\sec\theta$ |
| $\sqrt{x^2-a^2}$, with $x\ge a$ | $x=a\sec\theta,\ dx=a\sec\theta\tan\theta\,d\theta$ | $0\le\theta\lt\tfrac\pi2$ | $\sqrt{x^2-a^2}=a\tan\theta$ |
- Identify the form $a^2-x^2$, $a^2+x^2$ or $x^2-a^2$ (completing the square first if there is a linear term) and read off $a$.
- Substitute for $x$ and for $dx$, and simplify the square root with the matching identity.
- Integrate the trigonometric integral in $\theta$ (the methods of 5.1).
- Return to $x$. Draw the reference triangle from the substitution (e.g. $\sin\theta=\tfrac xa$: opposite $x$, hypotenuse $a$) and read every trigonometric function of $\theta$ off it. For a definite integral you may instead change the limits to $\theta$-values and never go back.
Definite Integrals: Change the Limits
For a definite integral there is no need to return to $x$: since the substitution is one-to-one on the restricted interval, we convert the $x$-limits into $\theta$-limits and evaluate in $\theta$ directly, exactly as with $u$-substitution in Calculus I.
- Forgetting $dx$. $x=a\sin\theta$ also changes $dx$ into $a\cos\theta\,d\theta$; leaving $dx$ unchanged gives nonsense.
- Mixing variables. A final answer containing both $x$ and $\theta$ — or a definite integral with $x$-limits on a $\theta$-integral — is always wrong.
- Wrong sign of the root. $\sqrt{a^2\cos^2\theta}=a|\cos\theta|$; it equals $a\cos\theta$ only because Theorem 5.4 restricts $\theta$. Keep track of that restriction when you change limits.
- Using a sledgehammer. $\displaystyle\int\frac{x\,dx}{\sqrt{1-x^2}}$ is $-\sqrt{1-x^2}+C$ by $u=1-x^2$; trigonometric substitution works but takes four times as long.
Completing the Square First
A quadratic with a linear term, such as $x^2+4x+13$ or $3-2x-x^2$, is not yet in one of the three forms. Completing the square, $x^2+bx+c=\left(x+\tfrac b2\right)^2+\left(c-\tfrac{b^2}{4}\right)$, and then substituting $u=x+\tfrac b2$ fixes this.
Areas of Circles, Ellipses and Segments
With the sine substitution we can finally compute curved areas that geometry alone only states.
Exercises
- 1 $\displaystyle\int\frac{dx}{\sqrt{4-x^2}}$
- 2 $\displaystyle\int\frac{dx}{x^2+9}$
- 3 $\displaystyle\int\sqrt{16-x^2}\,dx$
- 4 $\displaystyle\int\frac{x^2}{\sqrt{1-x^2}}\,dx$
- 5 $\displaystyle\int\frac{dx}{x^2\sqrt{9-x^2}}$
- 6 $\displaystyle\int\frac{dx}{\left(x^2+4\right)^{3/2}}$
- 7 $\displaystyle\int\frac{dx}{\sqrt{x^2+16}}$
- 8 $\displaystyle\int\frac{\sqrt{x^2-4}}{x}\,dx$, $x\gt2$
- 9 $\displaystyle\int x^3\sqrt{1-x^2}\,dx$
- 10 $\displaystyle\int\frac{dx}{\left(x^2-1\right)^{3/2}}$, $x\gt1$
- 11 $\displaystyle\int\frac{x^2}{\sqrt{x^2+1}}\,dx$
- 1 $\displaystyle\int_0^2\sqrt{4-x^2}\,dx$ (then explain the answer geometrically)
- 2 $\displaystyle\int_0^3\frac{dx}{9+x^2}$
- 3 $\displaystyle\int_0^{\sqrt3}\frac{dx}{\left(1+x^2\right)^{3/2}}$
- 4 $\displaystyle\int_0^1\frac{x^3}{\sqrt{x^2+1}}\,dx$
- 5 $\displaystyle\int_1^2\frac{\sqrt{x^2-1}}{x}\,dx$
- 6 $\displaystyle\int_0^1x^2\sqrt{1-x^2}\,dx$
- 7 $\displaystyle\int_0^1\sqrt{1+x^2}\,dx$
- 8 $\displaystyle\int_3^6\frac{dx}{x^2\sqrt{x^2-9}}$
- 1 $\displaystyle\int\frac{dx}{\sqrt{x^2+2x+5}}$
- 2 $\displaystyle\int\frac{dx}{x^2-6x+13}$
- 3 $\displaystyle\int\sqrt{2x-x^2}\,dx$
- 4 $\displaystyle\int\frac{dx}{\sqrt{8+2x-x^2}}$
- 5 $\displaystyle\int\frac{x\,dx}{\sqrt{x^2+4x+8}}$
- 6 $\displaystyle\int_1^3\sqrt{3+2x-x^2}\,dx$
- 1 Applied (landscape design). An ornamental pond is an ellipse with semi-axes $40$ m and $25$ m. Use Example 6 to find its surface area.
- 2 Applied (fuel storage). A horizontal cylindrical diesel tank has radius $1$ m and length $5$ m. The dipstick reads a depth of $0.5$ m. How many litres of diesel are in the tank, and what fraction of capacity is that?
- 3 Find the area of the region of the disc $x^2+y^2\le25$ that lies to the right of the line $x=3$.
- 4 Applied (physics). A thin rod carries uniform charge density $\lambda$ along the $x$-axis from $x=-L$ to $x=L$. The electric field at the point $(0,d)$ has magnitude $E=k\lambda d\displaystyle\int_{-L}^{L}\frac{dx}{\left(x^2+d^2\right)^{3/2}}$. Show that $E=\dfrac{2k\lambda L}{d\sqrt{L^2+d^2}}$, and find its limit as $L\to\infty$.
- 5 Conceptual. Why does Theorem 5.4 restrict $\theta$ to $\left[-\tfrac\pi2,\tfrac\pi2\right]$ for the substitution $x=a\sin\theta$? What would go wrong with $\theta\in[0,\pi]$?
- 6 Conceptual. Evaluate $\displaystyle\int\frac{x\,dx}{\sqrt{1-x^2}}$ twice — by $x=\sin\theta$ and by $u=1-x^2$ — and confirm the answers agree.
Research question. How should the dipstick for a horizontal cylindrical tank be marked, and how wrong is a simple linear scale?
Why it matters. Horizontal cylindrical tanks store fuel at petrol stations, heating oil in European homes, irrigation and drinking water on farms in Africa and Asia, and milk on dairy lorries. Owners and tax authorities need to know the volume from a single depth reading.
What to do.
- Using Example 6, show that a tank of radius $r$ and length $L$ filled to depth $d$ holds $V(d)=L\left[h\sqrt{r^2-h^2}+r^2\sin^{-1}\frac hr+\frac{\pi r^2}{2}\right]$ with $h=d-r$.
- Take a typical farm tank with $r=0.9$ m and $L=3$ m. Find the capacity in litres, then build a calibration table of $V$ every $10$ cm of depth.
- A naive gauge marks volume in proportion to depth: $V_{\text{lin}}=\text{capacity}\times\frac{d}{2r}$. Tabulate the error $V-V_{\text{lin}}$ and find the depth where it is largest (hint: set $V'(d)$ equal to the slope of the linear scale).
- Check one value of your table with a strip sum (as in Interactive 2) in a spreadsheet.
Tools: Calculator, spreadsheet
Hand in: A half-page note with the calibration table, the maximum error of the linear scale, and one practical recommendation.
Going further. Many real tanks have hemispherical or dished ends. How would those change $V(d)$? Look up a manufacturer's calibration chart and compare.
🧪 Self-check quiz
Q1. Which substitution suits $\displaystyle\int\frac{dx}{x\sqrt{16+x^2}}$?
Q2. With $x=3\sin\theta$ and $-\tfrac\pi2\le\theta\le\tfrac\pi2$, $\sqrt{9-x^2}=$
Q3. If $x=2\sec\theta$ with $0\le\theta\lt\tfrac\pi2$, the reference triangle gives $\tan\theta=$
Q4. $\displaystyle\int_0^1\sqrt{1-x^2}\,dx=$
Q5. Completing the square, $x^2+6x+13=$