Tutorials › Calculus II › Integrating the Square Root of a^2 + x^2

Trigonometric Substitution · Tutorial 171 of 998

Integrating the Square Root of a^2 + x^2

Use tangent substitution, integration by parts, and a right-triangle diagram to derive and check an antiderivative for the square root of \(a^2+x^2\).

Intermediate 9 min read

What You'll Learn

  • Choose the tangent substitution for a radical of the form square root of \(a^2+x^2\).
  • Derive the needed secant-cubed integral by integration by parts.
  • Use a right triangle to express the trigonometric terms in \(x\) and the radical.
  • State the antiderivative with the parameter condition and logarithm correctly.
  • Differentiate the result to verify it and identify common substitution errors.

Why This Radical Calls for a Tangent Substitution

The expression \(\sqrt{a^2+x^2}\) is positive for every real \(x\) when \(a>0\). Its sum of squares suggests the identity \(1+\tan^2\theta=\sec^2\theta\). Setting \(x=a\tan\theta\) turns the radical into a multiple of \(\sec\theta\), and the differential contributes another factor of \(\sec^2\theta\).

The resulting trigonometric integral involves \(\sec^3\theta\). Integration by parts reduces that integral to a logarithm and an algebraic term. A right triangle then expresses both terms using \(x\) and \(\sqrt{a^2+x^2}\).

Parameter convention: Assume \(a>0\). This keeps the scale factor and logarithm simple. If the parameter is nonzero but may be negative, replace \(a\) in the formula by \(|a|\). The case \(a=0\) is different because the integrand becomes \(|x|\).

Set Up the Tangent Substitution

For \(a>0\), choose

$$ x=a\tan\theta, \qquad -\frac{\pi}{2}<\theta<\frac{\pi}{2}. $$

This interval is useful because \(\sec\theta>0\) throughout it. Differentiating the substitution gives \(dx=a\sec^2\theta\,d\theta\), while the identity \(1+\tan^2\theta=\sec^2\theta\) gives

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

The positive square root is \(a\sec\theta\), rather than \(-a\sec\theta\), because \(a>0\) and \(\sec\theta>0\) on the chosen interval. Therefore, if \(I\) denotes the integral in the new variable,

$$ \int\sqrt{a^2+x^2}\,dx = a^2\int\sec^3\theta\,d\theta. $$

Both factors of \(a\) matter: one comes from the radical and the other from \(dx\).

Derive the Secant-Cubed Integral

To evaluate \(\int\sec^3\theta\,d\theta\), write the integrand as \(\sec\theta\sec^2\theta\) and use integration by parts. Choose \(u=\sec\theta\) and \(dv=\sec^2\theta\,d\theta\). Then \(du=\sec\theta\tan\theta\,d\theta\) and \(v=\tan\theta\). If \(J=\int\sec^3\theta\,d\theta\), integration by parts yields

$$ \begin{aligned} J &=\sec\theta\tan\theta-\int\tan\theta\sec\theta\tan\theta\,d\theta\\ &=\sec\theta\tan\theta-\int\sec\theta\tan^2\theta\,d\theta. \end{aligned} $$

Now use \(\tan^2\theta=\sec^2\theta-1\). The remaining integral becomes \(J-\int\sec\theta\,d\theta\), so

$$ J=\sec\theta\tan\theta-J+\int\sec\theta\,d\theta. $$

Rearranging gives \(2J=\sec\theta\tan\theta+\int\sec\theta\,d\theta\). On the chosen interval, \(\sec\theta+\tan\theta>0\): indeed, \(\sec\theta>|\tan\theta|\) follows from \(\sec^2\theta-\tan^2\theta=1\). Thus the standard logarithmic antiderivative of \(\sec\theta\) can be written without absolute-value bars here. Differentiating \(\ln(\sec\theta+\tan\theta)\) gives \(\sec\theta\), so

$$ \int\sec^3\theta\,d\theta = \frac{1}{2}\left(\sec\theta\tan\theta+ \ln(\sec\theta+\tan\theta)\right)+C. $$
Why the method works: The tangent substitution uses \(1+\tan^2\theta=\sec^2\theta\) to simplify the radical. Integration by parts then converts the power-three secant integral into a secant integral that has a logarithmic antiderivative.

Return to \(x\) with a Right Triangle

From \(x=a\tan\theta\), we have \(\tan\theta=x/a\). To find \(\sec\theta\), use a right triangle with adjacent side \(a\), opposite side \(|x|\), and hypotenuse \(\sqrt{a^2+x^2}\). The absolute value labels a side length; the sign of \(x\) is retained in \(\tan\theta=x/a\).

$$ \begin{array}{ccc} & \sqrt{a^2+x^2} &\\ & /\!\!| &\\ \theta\ \ &/ \quad | & |x|\\ & / \_\_\_| &\\ &&a \end{array} $$

The triangle gives \(\sec\theta=\sqrt{a^2+x^2}/a\). Consequently,

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

The numerator \(\sqrt{a^2+x^2}+x\) is positive: \(\sqrt{a^2+x^2}>|x|\) when \(a>0\). Substituting these expressions into \(a^2J\) gives the antiderivative.

Antiderivative: For \(a>0\) and every real \(x\), $$ \int\sqrt{a^2+x^2}\,dx = \frac{1}{2}\left( x\sqrt{a^2+x^2} +a^2\ln\left(\frac{x+\sqrt{a^2+x^2}}{a}\right) \right)+C. $$

The ratio inside the logarithm is positive. It is also dimensionless when \(a\) and \(x\) have the same units, as required for the logarithm of a physical quantity.

Worked Examples

Worked Example: Find an Antiderivative of \(\sqrt{9+x^2}\)

Here \(a=3\), so the formula gives

$$ F(x) = \frac{1}{2}\left( x\sqrt{9+x^2} +9\ln\left(\frac{x+\sqrt{9+x^2}}{3}\right) \right)+C. $$

For a substitution check, set \(x=3\tan\theta\), with \(-\pi/2<\theta<\pi/2\). Then \(\sqrt{9+x^2}=3\sec\theta\) and \(dx=3\sec^2\theta\,d\theta\), so the integral becomes \(9\int\sec^3\theta\,d\theta\). Using the derived result gives

$$ \begin{aligned} 9\int\sec^3\theta\,d\theta &=\frac{9}{2}\left(\sec\theta\tan\theta+ \ln(\sec\theta+\tan\theta)\right)+C\\ &=\frac{1}{2}x\sqrt{9+x^2} +\frac{9}{2}\ln\left(\frac{x+\sqrt{9+x^2}}{3}\right)+C. \end{aligned} $$

To check by differentiation, write \(R=\sqrt{9+x^2}\), so \(R'=x/R\) and \(\frac{d}{dx}\ln\!\left(\frac{x+R}{3}\right)=\frac1R\). Then

$$ \begin{aligned} F'(x) &=\frac{1}{2}\left(R+\frac{x^2}{R}\right)+\frac{9}{2}\cdot\frac{1}{R}\\ &=\frac{1}{2}\cdot\frac{R^2+x^2+9}{R}\\ &=\frac{1}{2}\cdot\frac{2(9+x^2)}{R}=\frac{R^2}{R}=R. \end{aligned} $$

Thus \(F'(x)=R=\sqrt{9+x^2}\), as required.

Worked Example: Integrate \(\sqrt{16+x^2}\) and Check It

Now \(a=4\). An antiderivative is

$$ F(x)=\frac{1}{2}\left( x\sqrt{16+x^2} +16\ln\left(\frac{x+\sqrt{16+x^2}}{4}\right) \right)+C. $$

Check the back-substitution at \(x=3\). The radical is \(\sqrt{16+9}=5\), and the triangle has adjacent side \(4\), opposite side \(3\), and hypotenuse \(5\). Thus \(\tan\theta=3/4\), \(\sec\theta=5/4\), and \(\sec\theta+\tan\theta=2\). The trigonometric expression \(16J\) gives

$$ \frac{16}{2}\left(\frac{5}{4}\cdot\frac{3}{4}+\ln 2\right) = \frac{15}{2}+8\ln 2. $$

The formula in \(x\) gives the same value:

$$ F(3)-C = \frac{1}{2}\left(3\cdot5+16\ln\left(\frac{3+5}{4}\right)\right) = \frac{15}{2}+8\ln 2. $$

For the derivative check, let \(R=\sqrt{16+x^2}\), so \(R'=x/R\). Then \(\frac{d}{dx}\ln((x+R)/4)=1/R\), and

$$ F'(x) = \frac{1}{2}\left(R+\frac{x^2}{R}+\frac{16}{R}\right) = \frac{1}{2}\cdot\frac{R^2+x^2+16}{R} = \frac{1}{2}\cdot\frac{2(16+x^2)}{R} =R. $$

Since \(R^2=16+x^2\), the numerator \(R^2+x^2+16\) equals \(2(16+x^2)=2R^2\). Therefore \(F'(x)=R=\sqrt{16+x^2}\), which confirms the formula for \(a=4\).

A Reliable Derivative Check

The examples illustrate why it is useful to verify an antiderivative independently. For general \(a>0\), let \(R=\sqrt{a^2+x^2}\) and differentiate the proposed formula. Since \(R'=x/R\) and

$$ \frac{d}{dx}\ln\left(\frac{x+R}{a}\right) = \frac{1+x/R}{x+R} = \frac{1}{R}, $$

we obtain

$$ \begin{aligned} \frac{d}{dx}\left[ \frac{1}{2}\left(xR+a^2\ln\left(\frac{x+R}{a}\right)\right) \right] &=\frac{1}{2}\left(R+\frac{x^2}{R}+\frac{a^2}{R}\right)\\ &=\frac{1}{2}\left(R+\frac{x^2+a^2}{R}\right)\\ &=\frac{1}{2}(R+R)=R. \end{aligned} $$

This confirms the antiderivative. It also confirms that the logarithm coefficient must be \(a^2\), not \(a\), and that the factor \(1/2\) applies to both terms.

Common Pitfalls

Dropping a factor of \(a\). The radical contributes \(a\sec\theta\), and the differential contributes \(a\sec^2\theta\,d\theta\). Their product is \(a^2\sec^3\theta\,d\theta\), not \(a\sec^3\theta\,d\theta\). For \(a=4\), the multiplier is \(16\), as the second example shows.

Using \(|x|\) instead of \(x\) in the tangent ratio. A triangle side is a nonnegative length, so its opposite side can be labelled \(|x|\). But the substitution says \(\tan\theta=x/a\), including when \(x<0\). Replacing that signed ratio with \(|x|/a\) loses the sign needed to recover \(x\).

Taking the wrong square-root branch. The identity gives \(\sqrt{a^2\sec^2\theta}=a|\sec\theta|\) in general. The chosen range \(-\pi/2<\theta<\pi/2\) ensures \(\sec\theta>0\), so the radical is \(a\sec\theta\). The range is part of the justification, not just a convenience.

When This Result Is Useful

The formula is useful whenever an integral contains precisely the radical \(\sqrt{a^2+x^2}\) as its integrand. Its structure records the two main contributions: an algebraic term \(x\sqrt{a^2+x^2}\) and a logarithmic term. Keeping the parameter \(a\) visible helps track the scaling and prevents losing a factor of \(a^2\).

For a quick check, differentiate the result rather than relying only on the substitution steps. In particular, the derivative of the logarithm is \(1/\sqrt{a^2+x^2}\), and the algebraic term supplies the remaining part needed to recover the radical. The logarithm's argument is positive for all real \(x\) when \(a>0\), so no absolute value is needed in this formula.

Check Your Understanding

Use the substitution and verification steps in the derivation to answer these questions.

  1. With \(x=a\tan\theta\), what expressions do \(dx\) and \(\sqrt{a^2+x^2}\) become on the chosen interval?
  2. In the triangle used for back-substitution, why is the opposite side labelled \(|x|\), while \(\tan\theta=x/a\)?
  3. Show how integration by parts reduces \(\int\sec^3\theta\,d\theta\) to \(\int\sec\theta\,d\theta\).
  4. Why is \((x+\sqrt{a^2+x^2})/a\) positive for every real \(x\) if \(a>0\)?
  5. Differentiate the stated antiderivative and identify where the identity \(a^2+x^2=R^2\) is used.

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