Tutorials › Calculus II › Deriving the Tangent Substitution for a²+x²

Trigonometric Substitution · Tutorial 158 of 998

Deriving the Tangent Substitution for a²+x²

Learn why \(x=a\tan\theta\) simplifies \(\sqrt{a^2+x^2}\), and how to choose the angle range and transform differentials and limits correctly.

Intermediate 9 min read

What You'll Learn

  • Derive the tangent substitution from the Pythagorean theorem.
  • Explain why the positive square root becomes \(a\sec\theta\).
  • Identify the angle interval that represents every real \(x\) exactly once.
  • Differentiate the substitution and verify its inverse derivative.
  • Convert variables, differentials, and definite-integral limits consistently.
  • Recognize and correct a branch or derivative-factor error.

Why a Tangent Substitution Fits This Radical

The expression \(a^2+x^2\), with \(a>0\), has the form of a sum of two squares. A right triangle relates that sum to the square of its hypotenuse. The tangent function relates the opposite and adjacent sides, while the secant function relates the hypotenuse and adjacent side. These relationships suggest a substitution that simplifies the radical and gives a precise change of variable for real-variable integrals.

The substitution is useful only when its signs and angle range are handled correctly. In particular, a square root is nonnegative, so the angle must be chosen where the secant is positive.

Assumption: Throughout this tutorial, \(a\) is a positive real constant and \(x\) is real. The radical \(\sqrt{a^2+x^2}\) denotes the nonnegative square root.

Deriving the Substitution from a Right Triangle

Suppose first that \(x\geq 0\). Draw a right triangle whose adjacent leg has length \(a\), whose opposite leg has length \(x\), and whose acute angle is \(\theta\). By the Pythagorean theorem, the hypotenuse has length \(\sqrt{a^2+x^2}\). The definitions of tangent and secant then give

$$ \tan\theta=\frac{x}{a}, \qquad \sec\theta=\frac{\sqrt{a^2+x^2}}{a}. $$

Rearranging both relations produces the desired formulas. For negative \(x\), use a triangle with opposite side length \(|x|\) and take \(\theta\) to be negative. The tangent relation then remains \(\tan\theta=x/a\), while the hypotenuse remains positive.

$$ x=a\tan\theta, \qquad \sqrt{a^2+x^2}=a\sec\theta. $$

These identities require an angle range that makes the tangent represent every real \(x\) and keeps the secant positive. We choose

$$ -\frac{\pi}{2}<\theta<\frac{\pi}{2}. $$

On this interval, tangent is strictly increasing and takes every real value exactly once. Also, \(\cos\theta>0\), so \(\sec\theta>0\). Thus the second identity agrees with the nonnegative square root, including when \(x\) is negative.

Definition: For \(a>0\), the tangent substitution for \(\sqrt{a^2+x^2}\) is \(x=a\tan\theta\), with \(-\pi/2<\theta<\pi/2\). On this interval, \(\sqrt{a^2+x^2}=a\sec\theta\).

Complete Justification of the Radical Identity

The triangle motivates the formulas, and a direct calculation proves the radical identity for every real \(\theta\) in the chosen interval. Starting with \(x=a\tan\theta\), square the expression inside the radical and use the trigonometric identity \(1+\tan^2\theta=\sec^2\theta\):

$$ \begin{aligned} \sqrt{a^2+x^2} &=\sqrt{a^2+a^2\tan^2\theta}\\ &=\sqrt{a^2(1+\tan^2\theta)}\\ &=\sqrt{a^2\sec^2\theta}\\ &=a|\sec\theta|. \end{aligned} $$

The absolute value in the last line is necessary because \(\sqrt{u^2}=|u|\). On the chosen interval, \(\cos\theta>0\), so \(\sec\theta>0\) and \(|\sec\theta|=\sec\theta\). Therefore

$$ \sqrt{a^2+x^2}=a\sec\theta. $$

This argument also explains why simply dropping the absolute value without checking the angle would be unsafe. The interval is part of the substitution, not an optional convention.

The Differential and the Inverse Change of Variable

Differentiate \(x=a\tan\theta\) with respect to \(\theta\). Since \(a\) is constant and \(\frac{d}{d\theta}\tan\theta=\sec^2\theta\), the differential is

$$ \frac{dx}{d\theta}=a\sec^2\theta, \qquad dx=a\sec^2\theta\,d\theta. $$

This factor is positive throughout the chosen interval, because \(a>0\) and \(\sec^2\theta>0\). Hence increasing \(\theta\) corresponds to increasing \(x\), which preserves the order of endpoints when changing limits in a definite integral.

The inverse relation is \(\theta=\arctan(x/a)\), where \(\arctan\) takes values in \((-\pi/2,\pi/2)\). Differentiating it gives a useful check:

$$ \frac{d\theta}{dx} = \frac{1}{1+(x/a)^2}\cdot\frac{1}{a} = \frac{a}{a^2+x^2}. $$

From \(\tan\theta=x/a\), we also have \(\sec^2\theta=1+x^2/a^2=(a^2+x^2)/a^2\). Therefore \(dx/d\theta=a\sec^2\theta=(a^2+x^2)/a\), the reciprocal of \(d\theta/dx\), as required.

Applying the Substitution Consistently

When an integral contains \(\sqrt{a^2+x^2}\), replacing the radical alone is not enough. Every occurrence of \(x\) must be rewritten using \(a\tan\theta\), the radical using \(a\sec\theta\), and the differential using \(a\sec^2\theta\,d\theta\). For a definite integral, the endpoints must also be translated using \(\theta=\arctan(x/a)\).

1
Choose the angle.
Set \(\theta=\arctan(x/a)\), so \(-\pi/2<\theta<\pi/2\).
2
Replace the variable and radical.
Use \(x=a\tan\theta\) and \(\sqrt{a^2+x^2}=a\sec\theta\).
3
Replace the differential.
Use \(dx=a\sec^2\theta\,d\theta\).
4
Translate any limits.
For each endpoint \(x=c\), use \(\theta=\arctan(c/a)\), keeping the angle in the stated interval.

Worked Examples

Worked Example: A Negative Value of \(x\)

Let \(a=8\) and \(x=-6\). Find the corresponding angle relation, evaluate the radical using the substitution, and check the differential factor at that angle.

First, \(\tan\theta=x/a=-6/8=-3/4\). The angle is \(\theta=\arctan(-3/4)\), which lies in \((-\pi/2,\pi/2)\). A triangle with adjacent side \(8\) and opposite side length \(6\) has hypotenuse

$$ \sqrt{8^2+6^2}=\sqrt{64+36}=\sqrt{100}=10. $$

Because the angle is negative, \(\tan\theta=-3/4\), while \(\sec\theta\) is positive. The triangle gives \(\sec\theta=10/8=5/4\). Thus the substitution predicts

$$ a\sec\theta=8\cdot\frac54=10 =\sqrt{8^2+(-6)^2}. $$

The differential factor at this angle is

$$ \frac{dx}{d\theta} =8\sec^2\theta =8\left(\frac54\right)^2 =8\cdot\frac{25}{16} =\frac{25}{2}. $$

As a check, the inverse derivative is \(d\theta/dx=8/(64+36)=8/100=2/25\). Its reciprocal is \(25/2\), matching \(dx/d\theta\). The radical and derivative are therefore consistent.

Worked Example: Transforming a Differential Expression

Take \(a=5\) and \(x=12\). Express \(\sqrt{a^2+x^2}\,dx\) in terms of \(\theta\), then check both factors.

Here \(\tan\theta=12/5\), so \(\theta=\arctan(12/5)\) lies in the required interval. The triangle has hypotenuse

$$ \sqrt{5^2+12^2}=\sqrt{25+144}=\sqrt{169}=13. $$

Thus \(\sec\theta=13/5\), and the radical becomes \(5\sec\theta=5(13/5)=13\). Also,

$$ dx=5\sec^2\theta\,d\theta =5\left(\frac{13}{5}\right)^2d\theta =\frac{169}{5}\,d\theta. $$

Multiplying the transformed factors gives

$$ \sqrt{25+144}\,dx =13\cdot\frac{169}{5}\,d\theta =\frac{2197}{5}\,d\theta. $$

To check, \(d\theta/dx=5/(25+144)=5/169\), so \(dx/d\theta=169/5\), as used. The radical check is \(5\sec\theta=5(13/5)=13=\sqrt{169}\).

Worked Example: Converting Definite-Integral Limits

For \(a=3\), convert the limits \(x=-3\) and \(x=3\) to angle limits. Then state the corresponding general substitution for an integrand \(H(x,\sqrt{9+x^2})\), where \(H\) is any function for which the integral exists.

At the lower endpoint, \(\tan\theta=-3/3=-1\), so \(\theta=-\pi/4\). At the upper endpoint, \(\tan\theta=3/3=1\), so \(\theta=\pi/4\). The transformed variable increases from \(-\pi/4\) to \(\pi/4\), in agreement with \(dx/d\theta=3\sec^2\theta>0\).

Substitute \(x=3\tan\theta\), \(\sqrt{9+x^2}=3\sec\theta\), and \(dx=3\sec^2\theta\,d\theta\). The definite integral becomes

$$ \int_{-3}^{3} H\!\left(x,\sqrt{9+x^2}\right)\,dx = \int_{-\pi/4}^{\pi/4} H(3\tan\theta,3\sec\theta)\,3\sec^2\theta\,d\theta. $$

At \(\theta=-\pi/4\), \(x=3(-1)=-3\); at \(\theta=\pi/4\), \(x=3(1)=3\). These checks confirm both endpoint conversions. Also \(\sec(\pm\pi/4)=\sqrt{2}>0\), consistent with the positive square root.

A Common Mistake: Ignoring the Angle Range

A frequent error is to write \(\sqrt{a^2+a^2\tan^2\theta}=a\sec\theta\) for any angle. The calculation actually gives \(a|\sec\theta|\). For example, let \(a=2\) and \(\theta=2\pi/3\). Then \(\tan\theta=-\sqrt{3}\), so \(x=2\tan\theta=-2\sqrt{3}\). The radical is

$$ \sqrt{2^2+(-2\sqrt{3})^2} =\sqrt{4+12} =4. $$

But \(\sec(2\pi/3)=-2\), so \(a\sec\theta=2(-2)=-4\), which cannot equal a nonnegative square root. The correction is to use the principal angle \(\theta=\arctan(x/a)=-\pi/3\), which is in \((-\pi/2,\pi/2)\). Then \(\sec\theta=2\), and \(a\sec\theta=4\), as required.

Another error is to omit the factor \(a\) when differentiating. If \(x=3\tan\theta\), for instance, then \(dx/d\theta=3\sec^2\theta\), not merely \(\sec^2\theta\). The constant multiplier in the substitution must remain in the differential.

Why the Substitution Matters

The substitution turns the quadratic radical into a trigonometric expression whose sign is controlled by the angle interval. Its derivative supplies the exact factor needed to change variables, and the one-to-one correspondence between real \(x\) and angles in \((-\pi/2,\pi/2)\) makes endpoint conversion unambiguous. These features make it a reliable tool for integrals involving \(a^2+x^2\), provided the radical, differential, and limits are all transformed together.

Key takeaway: For \(a>0\) and real \(x\), choose \(\theta=\arctan(x/a)\). Then \(x=a\tan\theta\), \(\sqrt{a^2+x^2}=a\sec\theta\), and \(dx=a\sec^2\theta\,d\theta\), with \(-\pi/2<\theta<\pi/2\).

Check Your Understanding

Use the angle interval and sign conditions carefully in each question.

  1. For \(a=7\) and \(x=-24\), find \(\tan\theta\), the hypotenuse length, and \(\sec\theta\).
  2. Why does \(\sqrt{a^2+a^2\tan^2\theta}\) initially simplify to \(a|\sec\theta|\), rather than automatically to \(a\sec\theta\)?
  3. Find \(dx/d\theta\) when \(x=6\tan\theta\), and state why this derivative is positive on the chosen angle interval.
  4. Under the substitution with \(a=4\), convert the endpoints \(x=0\) and \(x=4\) to angle limits.
  5. Identify the error in replacing \(dx\) by \(\sec^2\theta\,d\theta\) when \(x=5\tan\theta\).

Test yourself: Calculus II final exam practice

Ready to check what you know? Work a full-length practice final, then open the complete worked solutions.

Want all 1,114 practice problems?

This tutorial covers one topic. Calc Pass covers the full Calculus AB & BC curriculum (the core of Calculus I and II): full review, every practice question, and step-by-step solutions to each one.

QR code to download the Calc Pass app

Get the Calc Pass App

Scan to download and practice on the go, with instant scoring.

Calc Pass Volume 1: 1,114 Practice Questions book cover

Vol. 1: 1,114 Questions

The complete practice question bank, organized by AB & BC topic.

View on Amazon
Calc Pass Volume 2: Solutions Manual book cover

Vol. 2: Solutions Manual

Fully worked solutions to every question in Volume 1.

View on Amazon