Calculus Integration Techniques: Trigonometric Substitution

Some square roots refuse every integration trick you know. Here's how swapping x for an angle turns a nasty radical into a clean trig expression, and why the swap is always reversible.

By Petrus Sheya

August 6, 2026 · 6 min read

Try to integrate 9x2dx\int \sqrt{9 - x^2}\, dx.

Go on, try your usual moves. U-substitution needs a derivative of the inside sitting outside, and there isn't one. Power rule doesn't apply to a square root of a difference. Even the reverse chain rule stalls out immediately.

Nothing works. And that's strange, because 9x2\sqrt{9-x^2} isn't some exotic function. It's just the top half of a circle.

That's the clue. Circles, right triangles, and the Pythagorean theorem all speak the same language. If we can translate our square root into that language, the problem should get easier. That's exactly what trigonometric substitution does.


Why does a circle equation break every rule you know?

Here's the thing about 9x2\sqrt{9-x^2}: it comes from the circle equation x2+y2=9x^2 + y^2 = 9, solved for yy. And circles are built out of angles, not out of xx and yy directly. Every point on a circle of radius 3 can be written as (3cosθ,3sinθ)(3\cos\theta, 3\sin\theta) for some angle θ\theta.

So if xx is really a stand-in for an angle in disguise, our integral is fighting the wrong variable. Swap it out. Let x=3sinθx = 3\sin\theta instead of treating xx as free.

That one substitution is the entire idea behind trig substitution. When you see a square root shaped like a circle, an ellipse-ish expansion, or a hyperbola, replace xx with the trig function that matches that shape, and the square root collapses.


The fix: let the Pythagorean identity do the work

Watch what happens when x=3sinθx = 3\sin\theta. Substitute directly into the radical:

9x2=99sin2θ=9(1sin2θ)9 - x^2 = 9 - 9\sin^2\theta = 9(1 - \sin^2\theta)

And here's the payoff: 1sin2θ1 - \sin^2\theta is just cos2θ\cos^2\theta. That's the Pythagorean identity, the same one you memorized in trig class, now doing real work for us.

9x2=9cos2θ=3cosθ\sqrt{9 - x^2} = \sqrt{9\cos^2\theta} = 3\cos\theta

The square root is gone. No radical, just a plain cosine. That's not a coincidence and it's not a party trick. It's true for every value of θ\theta, and you can check it yourself.

Drag θ around the semicircle. The point's height and the value of √(9−x²) computed directly stay locked together the entire time.

x = 1.502.60(3sinθ, 3cosθ)
direct: √(9−x²)2.5981
via identity: 3cosθ2.5981
difference0.0e+0

Drag θ\theta anywhere on that semicircle. The point's height, computed two completely different ways, one from the raw square root and one from 3cosθ3\cos\theta, never disagrees by more than a rounding error. The identity isn't an approximation. It's exact, always.


Three shapes, three substitutions

9x2\sqrt{9-x^2} is one shape. But radicals come in three flavors, and each one matches a different Pythagorean identity:

  • a2x2\sqrt{a^2 - x^2} calls for x=asinθx = a\sin\theta, because 1sin2θ=cos2θ1 - \sin^2\theta = \cos^2\theta
  • a2+x2\sqrt{a^2 + x^2} calls for x=atanθx = a\tan\theta, because 1+tan2θ=sec2θ1 + \tan^2\theta = \sec^2\theta
  • x2a2\sqrt{x^2 - a^2} calls for x=asecθx = a\sec\theta, because sec2θ1=tan2θ\sec^2\theta - 1 = \tan^2\theta

You don't need to memorize these as separate rules. Each one comes from a right triangle with sides aa, xx, and the radical. Once you draw that triangle, the substitution falls out on its own.

Pick the shape of the radical you're stuck on. Each one builds a different right triangle, and the triangle tells you exactly which substitution to use.

θ√(9−x²)xa = 3x = 3 sinθdx = 3 cosθ dθ1 − sin²θ = cos²θ√(9 − x²) simplifies to a single trig term
x1.72
radical value2.46
hypotenuse3.00

Notice that all three triangles have the exact same skeleton: an adjacent side, an opposite side, a hypotenuse, and θ\theta sitting at the same corner. The only thing that changes is which side is aa, which is xx, and which is the radical. Match the radical in front of you to one of these three shapes, and you already know which substitution to use.


Does swapping variables actually preserve the area?

This is the part that should bother you a little. We just replaced xx with θ\theta, a completely different variable with a completely different range. Is the integral we're computing after the swap still measuring the same area we started with?

Yes. And you can watch it happen instead of taking it on faith.

Same integral, two different shapes. Watch both Riemann sums climb toward the exact same number as n grows.

x-space: √(9−x²)sum ≈ 7.1207θ-space: 9cos²θsum ≈ 7.0686
x-space sum7.1207
θ-space sum7.0686
exact: 9π/47.0686

The left panel is 039x2dx\int_0^3 \sqrt{9-x^2}\, dx, computed the ordinary way, rectangle by rectangle, in xx. The right panel is what that same integral turns into after the substitution: 0π/29cos2θdθ\int_0^{\pi/2} 9\cos^2\theta\, d\theta, rectangles in θ\theta. Hit play and watch both sums climb toward 9π/49\pi/4, the exact area of a quarter circle of radius 3. Different variable, different-looking curve, same number. That's what makes the substitution legal, not just convenient.


Finishing the problem without leaving an angle in your answer

Now let's actually solve 9x2dx\int \sqrt{9-x^2}\, dx. With x=3sinθx = 3\sin\theta and dx=3cosθdθdx = 3\cos\theta\, d\theta:

9x2dx=3cosθ3cosθdθ=9cos2θdθ\int \sqrt{9-x^2}\, dx = \int 3\cos\theta \cdot 3\cos\theta\, d\theta = 9\int \cos^2\theta\, d\theta

That's a standard integral. Using the identity cos2θ=1+cos2θ2\cos^2\theta = \frac{1+\cos 2\theta}{2}:

9cos2θdθ=9θ2+94sin2θ+C=9θ2+92sinθcosθ+C9\int \cos^2\theta\, d\theta = \frac{9\theta}{2} + \frac{9}{4}\sin 2\theta + C = \frac{9\theta}{2} + \frac{9}{2}\sin\theta\cos\theta + C

We've got an antiderivative. But it's written in θ\theta, and the original problem was written in xx. We need to translate back, and this is exactly where that right triangle earns its keep. From x=3sinθx = 3\sin\theta, we know sinθ=x/3\sin\theta = x/3. The other two sides of the triangle give us cosθ\cos\theta directly, no extra algebra required.

Once you've integrated in θ, you still owe an answer in x. Drag x/a and read every ratio straight off the triangle you already built.

θ√(9−x²) = 2.40x = 1.80a = 3sinθ = x/a = 0.600cosθ = √(9−x²)/a = 0.800tanθ = x/√(9−x²) = 0.750θ = arcsin(x/3) = 36.9°
x1.80
θ (rad)0.644
θ (deg)36.9°

Drag x/ax/a and watch every ratio update at once: sinθ\sin\theta, cosθ\cos\theta, tanθ\tan\theta, and θ\theta itself. That's the whole back-substitution step. You're not solving anything new here, just reading numbers off a triangle you already built.

Plugging sinθ=x/3\sin\theta = x/3 and cosθ=9x2/3\cos\theta = \sqrt{9-x^2}/3 back in:

9x2dx=92arcsin(x3)+x9x22+C\int \sqrt{9-x^2}\, dx = \frac{9}{2}\arcsin\left(\frac{x}{3}\right) + \frac{x\sqrt{9-x^2}}{2} + C

No angle left anywhere. Just xx, exactly as the original problem asked.


The other two triangles, briefly

The tan\tan and sec\sec cases follow the identical playbook, just with a different triangle. For dxx2+4\int \frac{dx}{\sqrt{x^2+4}}, you'd spot the a2+x2\sqrt{a^2+x^2} shape, set x=2tanθx = 2\tan\theta, and the identity 1+tan2θ=sec2θ1+\tan^2\theta=\sec^2\theta turns the radical into 2secθ2\sec\theta. For dxxx216\int \frac{dx}{x\sqrt{x^2-16}}, you'd spot x2a2\sqrt{x^2-a^2}, set x=4secθx=4\sec\theta, and sec2θ1=tan2θ\sec^2\theta - 1 = \tan^2\theta does the collapsing.

Same three moves every time: match the shape, substitute, simplify with the identity, integrate, then read the answer back off the triangle.


The short version

A square root of a2x2a^2 - x^2, a2+x2a^2+x^2, or x2a2x^2-a^2 resists ordinary integration because it's secretly a circle, a hyperbola, or an ellipse-shaped identity wearing algebra as a disguise. Trig substitution unmasks it: replace xx with asinθa\sin\theta, atanθa\tan\theta, or asecθa\sec\theta to match the shape, and the corresponding Pythagorean identity collapses the radical into a single clean trig term. The substitution doesn't just simplify the symbols, it preserves the actual area, which you can verify numerically by comparing Riemann sums before and after. And when you're done integrating in θ\theta, the same right triangle that motivated the substitution hands you every ratio you need to write the final answer back in terms of xx.

The whole technique is really just one triangle, built once, used twice: once going in, once coming back out.


All visualizations are interactive React components running entirely in your browser, computed live with no lookup tables. The area comparison uses midpoint Riemann sums with up to 90 rectangles per side. No libraries beyond React.