Tutorials › Calculus II › Absolute Values in Logarithmic Back-Substitution

Trigonometric Substitution · Tutorial 169 of 998

Absolute Values in Logarithmic Back-Substitution

Learn how the secant substitution produces logarithmic antiderivatives and how to back-substitute correctly on both sides of the radical’s domain.

Intermediate 9 min read

What You'll Learn

  • Derive the logarithmic antiderivative of the reciprocal square root of \(x^2-a^2\).
  • Differentiate \(\ln|\sec\theta+\tan\theta|\) to justify the trigonometric integral.
  • Back-substitute separately on the positive and negative branches of the domain.
  • Identify when removing absolute-value bars changes a valid real expression.
  • Verify logarithmic antiderivatives by differentiation.

Why Absolute Values Matter in Back-Substitution

A secant substitution can turn a radical integral into an integral involving \(\sec\theta\). That trigonometric integral has a logarithmic antiderivative. The final step is to express the logarithm in terms of \(x\), while keeping track of which expressions are positive on the domain being considered.

This sign check matters because the real logarithm \(\ln u\) is defined only for \(u>0\). By contrast, \(\ln|u|\) is defined whenever \(u\ne 0\). A correct trigonometric antiderivative can therefore become incorrect if its absolute-value bars are dropped without checking the branch of the substitution.

Convention: Throughout, \(a>0\). The real-valued integrand \(1/\sqrt{x^2-a^2}\) is defined for \(x>a\) and \(x<-a\), but not for \(-a\le x\le a\).

Where the Logarithm Comes From

The relevant trigonometric antiderivative is that of \(\sec\theta\). Wherever \(\sec\theta\) and \(\tan\theta\) are defined, and \(\sec\theta+\tan\theta\ne 0\), differentiate using the chain rule:

$$ \frac{d}{d\theta}\ln|\sec\theta+\tan\theta| = \frac{\sec\theta\tan\theta+\sec^2\theta} {\sec\theta+\tan\theta} = \sec\theta. $$

The last equality follows by factoring the numerator as \(\sec\theta(\tan\theta+\sec\theta)\) and cancelling the nonzero denominator. Thus \(\ln|\sec\theta+\tan\theta|\) is an antiderivative of \(\sec\theta\) on any interval where the expression is defined. The absolute value makes the logarithm valid whether \(\sec\theta+\tan\theta\) is positive or negative.

Now consider the substitution \(x=a\sec\theta\) on the branch \(x>a\), with \(0\le\theta<\pi/2\). On this branch, \(\tan\theta\ge 0\), so

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

Also, \(dx=a\sec\theta\tan\theta\,d\theta\). Therefore the radical cancels in the integral:

$$ \int \frac{dx}{\sqrt{x^2-a^2}} = \int \sec\theta\,d\theta = \ln|\sec\theta+\tan\theta|+C. $$

Since \(\sec\theta=x/a\) and \(\tan\theta=\sqrt{x^2-a^2}/a\) on this branch, the logarithm becomes

$$ \ln\left|\frac{x+\sqrt{x^2-a^2}}{a}\right| = \ln\left|x+\sqrt{x^2-a^2}\right|-\ln a. $$

Because \(a\) is a fixed positive constant, \(-\ln a\) can be absorbed into the arbitrary constant of integration. The resulting formula is \(\ln|x+\sqrt{x^2-a^2}|+C\). On \(x>a\), the quantity inside those absolute-value bars is in fact positive; retaining the bars is nevertheless useful for writing one formula that also works on the negative branch.

The Negative Branch Requires Its Own Sign Check

The substitution \(x=a\sec\theta\) with \(0\le\theta<\pi/2\) covers \(x\ge a\), not \(x\le -a\). To handle the negative branch, let \(x=-a\sec\theta\) with \(0\le\theta<\pi/2\). Then \(\sec\theta=-x/a>0\), and

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

Consequently, the integral becomes \(-\int\sec\theta\,d\theta\), and back-substitution gives

$$ -\ln\left(\sec\theta+\tan\theta\right)+C = -\ln\left(\frac{\sqrt{x^2-a^2}-x}{a}\right)+C. $$

Here \(\sqrt{x^2-a^2}-x>0\) because \(x<-a<0\), so this logarithm needs no absolute-value bars. To compare it with the formula from the positive branch, use

$$ \left(x+\sqrt{x^2-a^2}\right) \left(x-\sqrt{x^2-a^2}\right)=a^2. $$

For \(x<-a\), both factors on the left are negative. It follows that \(\left|x+\sqrt{x^2-a^2}\right|=a^2/(\sqrt{x^2-a^2}-x)\). Taking logarithms shows that the two branch formulas differ only by a constant. Thus one antiderivative formula works on both connected parts of the domain.

Theorem: For \(a>0\), an antiderivative of \(1/\sqrt{x^2-a^2}\) on either interval \(x>a\) or \(x<-a\) is $$ \ln\left|x+\sqrt{x^2-a^2}\right|+C. $$ The constant \(C\) may be chosen independently on the two intervals.

Worked Examples

Worked Example: Back-Substitute on the Positive Branch

Find an antiderivative of \(1/\sqrt{x^2-9}\) for \(x>3\) using a secant substitution, then check it.

Set \(x=3\sec\theta\), with \(0\le\theta<\pi/2\). Then

$$ dx=3\sec\theta\tan\theta\,d\theta, \qquad \sqrt{x^2-9}=3\tan\theta. $$

Substituting into the integral gives

$$ \int\frac{dx}{\sqrt{x^2-9}} = \int\frac{3\sec\theta\tan\theta} {3\tan\theta}\,d\theta = \int\sec\theta\,d\theta = \ln|\sec\theta+\tan\theta|+C. $$

On this branch, \(\sec\theta=x/3\), \(\tan\theta=\sqrt{x^2-9}/3\), and \(x+\sqrt{x^2-9}>0\). Hence

$$ \ln|\sec\theta+\tan\theta| = \ln\left(\frac{x+\sqrt{x^2-9}}{3}\right) = \ln\left(x+\sqrt{x^2-9}\right)+C_1. $$

For the check, write \(r=\sqrt{x^2-9}\), so \(r'=x/r\). Then

$$ \frac{d}{dx}\ln(x+r) = \frac{1+r'}{x+r} = \frac{1+x/r}{x+r} = \frac{(r+x)/r}{x+r} = \frac{1}{r} = \frac{1}{\sqrt{x^2-9}}. $$

This agrees with the integrand.

Worked Example: Back-Substitute on the Negative Branch

Find an antiderivative of \(1/\sqrt{x^2-4}\) for \(x<-2\), and compare it with the single-logarithm formula.

Use \(x=-2\sec\theta\), where \(0\le\theta<\pi/2\). Then

$$ dx=-2\sec\theta\tan\theta\,d\theta, \qquad \sqrt{x^2-4}=2\tan\theta. $$

The integral becomes

$$ \int\frac{dx}{\sqrt{x^2-4}} = -\int\sec\theta\,d\theta = -\ln(\sec\theta+\tan\theta)+C = -\ln\left(\frac{\sqrt{x^2-4}-x}{2}\right)+C. $$

The logarithm’s argument is positive because \(\sqrt{x^2-4}>0\) and \(-x>0\). To express the answer using \(x+\sqrt{x^2-4}\), set \(r=\sqrt{x^2-4}\). Since \((r-x)(r+x)=r^2-x^2=-4\), we have \(|x+r|=4/(r-x)\). Therefore

$$ \ln|x+r| = \ln 4-\ln(r-x), \qquad -\ln\left(\frac{r-x}{2}\right) = \ln 2-\ln(r-x). $$

These expressions differ by the constant \(\ln 2\), so they represent the same family of antiderivatives. Check the branch-specific form directly:

$$ \frac{d}{dx}\left[-\ln(r-x)\right] = -\frac{x/r-1}{r-x} = -\frac{(x-r)/r}{r-x} = \frac{1}{r} = \frac{1}{\sqrt{x^2-4}}. $$

The derivative matches the integrand on \(x<-2\).

Worked Example: Keep the Scaling Inside the Logarithm

Find an antiderivative of \(1/\sqrt{9x^2-4}\) for \(x>2/3\) by a secant substitution, and verify the result.

Set \(3x=2\sec\theta\), with \(0\le\theta<\pi/2\). Then

$$ x=\frac{2}{3}\sec\theta, \qquad dx=\frac{2}{3}\sec\theta\tan\theta\,d\theta, \qquad \sqrt{9x^2-4}=2\tan\theta. $$

Thus

$$ \int\frac{dx}{\sqrt{9x^2-4}} = \int\frac{(2/3)\sec\theta\tan\theta}{2\tan\theta}\,d\theta = \frac{1}{3}\int\sec\theta\,d\theta = \frac{1}{3}\ln|\sec\theta+\tan\theta|+C. $$

Since \(\sec\theta=3x/2\) and \(\tan\theta=\sqrt{9x^2-4}/2\),

$$ \frac{1}{3}\ln|\sec\theta+\tan\theta| = \frac{1}{3}\ln\left(\frac{3x+\sqrt{9x^2-4}}{2}\right) = \frac{1}{3}\ln\left(3x+\sqrt{9x^2-4}\right)+C_1. $$

For verification, let \(r=\sqrt{9x^2-4}\), so \(r'=9x/r\). Then

$$ \frac{d}{dx}\left[\frac{1}{3}\ln(3x+r)\right] = \frac{1}{3}\frac{3+9x/r}{3x+r} = \frac{1}{3}\frac{3(r+3x)}{r(3x+r)} = \frac{1}{r} = \frac{1}{\sqrt{9x^2-4}}. $$

The factor \(1/3\) is required: it comes from the change of variable, and the derivative check confirms it.

A Common Mistake: Dropping Bars Without Checking the Domain

On the negative branch, \(x+\sqrt{x^2-a^2}<0\). Therefore \(\ln(x+\sqrt{x^2-a^2})\) is not a real-valued expression there. For example, at \(x=-2\) and \(a=1\), the quantity inside the logarithm is \(-2+\sqrt{3}<0\).

A tempting but invalid step is to write

$$ \ln|x+\sqrt{x^2-a^2}| = \ln(x+\sqrt{x^2-a^2}) \qquad\text{for }x<-a. $$

The equality is false: the right-hand side is not defined as a real logarithm on that interval. The correction is to keep the absolute value, or to use the positive branch-specific expression from the substitution, \(-\ln((\sqrt{x^2-a^2}-x)/a)\). Absolute values are not decorative; they specify the real logarithm’s argument.

How to Choose the Correct Form

The same antiderivative can have different-looking expressions depending on the branch. The following summary separates the sign facts from the formula:

DomainSign of \(x+\sqrt{x^2-a^2}\)Valid logarithmic form
\(x>a\)Positive\(\ln(x+\sqrt{x^2-a^2})+C\), or \(\ln|x+\sqrt{x^2-a^2}|+C\)
\(x<-a\)Negative\(\ln|x+\sqrt{x^2-a^2}|+C\)

The expression \(x+\sqrt{x^2-a^2}\) never equals zero on either interval. If it were zero, then \(\sqrt{x^2-a^2}=-x\); squaring would give \(x^2-a^2=x^2\), contradicting \(a>0\). Thus the absolute-value logarithm is defined throughout both intervals.

Why the Branch Check Matters

Trigonometric substitution is not only a way to simplify a radical. It also selects a range of angles, and that range determines the signs of the trigonometric expressions. On the positive branch, \(x=a\sec\theta\) with \(0\le\theta<\pi/2\) makes both \(\sec\theta\) and \(\tan\theta\) nonnegative. On the negative branch, \(x=-a\sec\theta\) on the same angle range makes \(x\) negative while the radical remains positive.

Keeping these branches distinct prevents sign errors in \(dx\), in the radical, and in the logarithm. It also explains why a compact formula with absolute-value bars can be correct on both intervals even though a particular substitution may cover only one of them. As always, the intervals are disconnected, so the constants of integration on the two intervals need not be equal.

Check Your Understanding

Answer each question by checking both the substitution and the sign of the logarithm’s argument.

  1. For \(x>a\), what are \(\sec\theta\) and \(\tan\theta\) when \(x=a\sec\theta\) and \(\sqrt{x^2-a^2}=a\tan\theta\)?
  2. Why is \(\ln|\sec\theta+\tan\theta|\) an antiderivative of \(\sec\theta\)?
  3. On \(x<-a\), is \(x+\sqrt{x^2-a^2}\) positive or negative? What does that imply about the real logarithm?
  4. Show that \(\ln|x+\sqrt{x^2-a^2}|\) and \(-\ln((\sqrt{x^2-a^2}-x)/a)\) differ by a constant on \(x<-a\).
  5. Differentiate \(\ln(x+\sqrt{x^2-a^2})\) on \(x>a\) and verify that the result is \(1/\sqrt{x^2-a^2}\).

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