Trigonometric Substitution Calculator

Published on: July 18, 2026
Final Answer: Free | Full Steps: Plus

This Trigonometric Substitution Calculator integrates expressions containing a square root of a sum or difference of squares, and shows the working line by line. Replacing x with a trigonometric function lets a Pythagorean identity collapse the root away, which is the whole reason for the substitution. The answer is converted back to x at the end. Following the same pattern every time keeps the substitution matched to the shape of the root.

Step-by-step method

  1. Set up the problem.
  2. Choose the matching trigonometric substitution.
  3. Find dx and simplify the radical with the Pythagorean identity.
  4. Rewrite the whole integral in terms of θ.
  5. Integrate with respect to θ.
  6. Convert back to x and add C.

Formula: Substitution for root(a squared - x squared)

Use x = a sin(theta), so the square root becomes a cos(theta).

\(\sqrt{a^{2} - x^{2}}: \; x = a\sin\left(\theta\right)\)

Formula: Substitution for root(a squared + x squared)

Use x = a tan(theta), so the square root becomes a sec(theta).

\(\sqrt{a^{2} + x^{2}}: \; x = a\tan\left(\theta\right)\)

Formula: Substitution for root(x squared - a squared)

Use x = a sec(theta), so the square root becomes a tan(theta).

\(\sqrt{x^{2} - a^{2}}: \; x = a\sec\left(\theta\right)\)

Useful Tips to Remember

Match the root to the substitution: \(\sqrt{a^2 - x^2}\) uses \(x = a\sin\theta\), \(\sqrt{a^2 + x^2}\) uses \(x = a\tan\theta\), and \(\sqrt{x^2 - a^2}\) uses \(x = a\sec\theta\). Remember to replace \(dx\) as well. After integrating, use a right triangle to change the answer back into terms of \(x\). Add \(+C\) at the end.

Required knowledge

Where Is Trigonometric Substitution Used?

Trigonometric substitution replaces \(x\) with a sine, tangent or secant expression to simplify integrals with square roots like \(\sqrt{a^2 - x^2}\). These roots come from Pythagoras' theorem, so they appear whenever circles, ellipses and distances are involved. The method is used to find the area of a circle or ellipse by integration, the arc length of curves, and the electric field around charged objects. Engineers also use it to work out the volume of liquid in round tanks lying on their side.

  • Finding the area of circles and ellipses by integration
  • Working out the liquid in a horizontal cylindrical tank
  • Calculating the arc lengths of curves
  • Finding electric and gravitational fields in physics
  • Integrating expressions with \(\sqrt{a^2 - x^2}\) or \(\sqrt{x^2 + a^2}\)

Trigonometric Substitution Practice Problems

Example 1 integrates \(\sqrt{9 - x^2}\) with a sine substitution, and Example 2 integrates \(\frac{1}{\sqrt{x^2 + 4}}\) with a tangent substitution. Try choosing the substitution yourself first. For two more free worked examples, check out the Trigonometric Substitution Notes.

The worked examples below go through the same pattern from start to finish, so you can compare every step with your own working. For more practice, the notes page goes further with extra worked examples and fuller explanations of the ideas behind each step. Use them together to check your answers and to understand why each step works.

See Example 1 Hide Example 1

Problem

\(\int \sqrt{9 - x^{2}}\, dx\)

Approach

Step-by-step method

  1. Set up the problem.
  2. Choose the matching trigonometric substitution.
  3. Find dx and simplify the radical with the Pythagorean identity.
  4. Rewrite the whole integral in terms of θ.
  5. Integrate with respect to θ.
  6. Convert back to x and add C.

Formula

Formula: Substitution for root(a squared - x squared)

Use x = a sin(theta), so the square root becomes a cos(theta).

\(\sqrt{a^{2} - x^{2}}: \; x = a\sin\left(\theta\right)\)

Step 1

Step 1 - Set up the problem.

In this problem: The integrand contains the radical form \(\sqrt{9 - x^{2}}\) with \(a = 3\).

\(\int \sqrt{9 - x^{2}}\, dx\)

Step 2

Step 2 - Choose the matching trigonometric substitution.

In this problem: Match the radical to one of the three standard forms and substitute.

\(\sqrt{a^{2} - x^{2}}: \; x = a\sin\left(\theta\right)\)

Step 3

Step 3 - Find dx and simplify the radical with the Pythagorean identity.

In this problem: Differentiate \(x = 3 \sin{\left(\theta \right)}\) to get dx. With this substitution the radical collapses through the Pythagorean identity.

\(\begin{gathered} x = 3\sin\left(\theta\right),\quad dx = 3\cos\left(\theta\right)\, d\theta \\ \sqrt{9 - x^{2}} = 3\cos\left(\theta\right) \end{gathered}\)

Step 4

Step 4 - Rewrite the whole integral in terms of θ.

In this problem: Replace x with \(3 \sin{\left(\theta \right)}\), dx with \(3 \cos{\left(\theta \right)} \, d\theta\) and the radical with \(3 \cos{\left(\theta \right)}\), then simplify.

\(\int \sqrt{9 - x^{2}}\, dx = \int 9 \cos^{2}{\left(\theta \right)}\, d\theta\)

Step 5

Step 5 - Integrate with respect to θ.

In this problem: Integrate with respect to θ.

\(\int 9 \cos^{2}{\left(\theta \right)}\, d\theta = \frac{9 \theta}{2} + \frac{9 \sin{\left(2 \theta \right)}}{4} + C\)

Step 6

Step 6 - Convert back to x and add C.

In this problem: From \(\sin\left(\theta\right) = \frac{x}{3}\), draw the right triangle: it gives every trig function of θ in terms of x, and \(\theta = \arcsin{\left(\frac{x}{3} \right)}\).

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

Final Answer

\(\int \sqrt{9 - x^{2}}\, dx = \frac{x \sqrt{9 - x^{2}}}{2} + \frac{9 \arcsin{\left(\frac{x}{3} \right)}}{2} + C\)
See Example 2 Hide Example 2

Problem

\(\int \frac{1}{\sqrt{x^{2} + 4}}\, dx\)

Approach

Step-by-step method

  1. Set up the problem.
  2. Choose the matching trigonometric substitution.
  3. Find dx and simplify the radical with the Pythagorean identity.
  4. Rewrite the whole integral in terms of θ.
  5. Integrate with respect to θ.
  6. Convert back to x and add C.

Formula

Formula: Substitution for root(a squared + x squared)

Use x = a tan(theta), so the square root becomes a sec(theta).

\(\sqrt{a^{2} + x^{2}}: \; x = a\tan\left(\theta\right)\)

Step 1

Step 1 - Set up the problem.

In this problem: The integrand contains the radical form \(\sqrt{x^{2} + 4}\) with \(a = 2\).

\(\int \frac{1}{\sqrt{x^{2} + 4}}\, dx\)

Step 2

Step 2 - Choose the matching trigonometric substitution.

In this problem: Match the radical to one of the three standard forms and substitute.

\(\sqrt{a^{2} + x^{2}}: \; x = a\tan\left(\theta\right)\)

Step 3

Step 3 - Find dx and simplify the radical with the Pythagorean identity.

In this problem: Differentiate \(x = 2 \tan{\left(\theta \right)}\) to get dx. With this substitution the radical collapses through the Pythagorean identity.

\(\begin{gathered} x = 2\tan\left(\theta\right),\quad dx = 2\sec^{2}\left(\theta\right)\, d\theta \\ \sqrt{4 + x^{2}} = 2\sec\left(\theta\right) \end{gathered}\)

Step 4

Step 4 - Rewrite the whole integral in terms of θ.

In this problem: Replace x with \(2 \tan{\left(\theta \right)}\), dx with \(2 \sec^{2}{\left(\theta \right)} \, d\theta\) and the radical with \(2 \sec{\left(\theta \right)}\), then simplify.

\(\int \frac{1}{\sqrt{x^{2} + 4}}\, dx = \int \sec{\left(\theta \right)}\, d\theta\)

Step 5

Step 5 - Integrate with respect to θ.

In this problem: Integrate with respect to θ.

\(\int \sec{\left(\theta \right)}\, d\theta = \ln\left|\sec\left(\theta\right) + \tan\left(\theta\right)\right| + C\)

Step 6

Step 6 - Convert back to x and add C.

In this problem: From \(\tan\left(\theta\right) = \frac{x}{2}\), draw the right triangle: it gives every trig function of θ in terms of x, and \(\theta = \arctan{\left(\frac{x}{2} \right)}\). The constant \(- \ln\left(2\right)\) that comes out is part of C.

\(\int \frac{1}{\sqrt{x^{2} + 4}}\, dx = \ln\left|x + \sqrt{x^{2} + 4}\right| + C\)

Final Answer

\(\int \frac{1}{\sqrt{x^{2} + 4}}\, dx = \ln\left|x + \sqrt{x^{2} + 4}\right| + C\)

Notes and Practice Mode

Example Problems

Click one to load it into the box and solve it.