Tutorials › Calculus I › Absolute Values And Sign Changes In Substitution

Substitution and Reversing the Chain Rule · Tutorial 1150 of 1495

Absolute Values And Sign Changes In Substitution

Use zeros and sign intervals to handle absolute values introduced by substitution, and recognize when a global antiderivative avoids splitting.

Intermediate 9 min read

What You'll Learn

  • Explain why the square root of a squared expression becomes an absolute value.
  • Find the zeros that divide an interval into regions where an inner expression has constant sign.
  • Evaluate definite integrals by splitting at sign changes and transforming the bounds.
  • Write piecewise antiderivatives that agree across zeros.
  • Use a global antiderivative for an absolute value multiplied by the derivative of its inner function.
  • Avoid assuming that an inner function has only finitely many zeros.

Why Absolute Values Appear in Substitution

A substitution can reveal a familiar expression and still leave an important sign question. For example, the real square root of a square is not always the expression inside the square:

$$ \sqrt{u^2}=|u|. $$

The absolute value is necessary because a square root is nonnegative, while \(u\) may be negative. When \(u=g(x)\), deciding whether \(|g(x)|\) equals \(g(x)\) or \(-g(x)\) depends on the sign of \(g\) on the interval being considered.

This matters in both indefinite and definite integrals. A sign error can change an antiderivative on part of its domain, or change the value of a definite integral. The reliable approach is to find the zeros of the inner expression and determine its sign between them.

Key identity: For every real number \(u\), \(\sqrt{u^2}=|u|\). If \(u\ge 0\), then \(|u|=u\); if \(u<0\), then \(|u|=-u\).

Zeros Divide the Interval into Sign Regions

Let \(g\) be continuous on an interval. If \(g\) has no zero on a subinterval, then it cannot change sign there: a change from positive to negative would, by the intermediate value theorem, require a zero in between. Thus, once the zeros are known, the sign on each interval between consecutive zeros can be determined by testing one point.

Sign-interval procedure: When \(g\) has finitely many zeros in the interval of interest, list those zeros in order. They divide the interval into finitely many subintervals. Determine the sign of \(g\) on each subinterval, then replace \(|g|\) by \(g\) where \(g\ge 0\) and by \(-g\) where \(g<0\).

The finite-zero condition in this statement matters. A continuous function need not have finitely many zeros on a bounded interval. The sign-interval procedure is useful when its zeros are finite and can be located; it is not a reason to assume that every continuous inner function has a finite sign chart.

Worked Example: An Indefinite Integral with One Sign Change

Worked Example: An Indefinite Integral with One Sign Change

Evaluate \(\int \sqrt{(x-2)^2}\,dx\), giving an expression valid on the whole real line.

First use \(\sqrt{u^2}=|u|\), with \(u=x-2\):

$$ \sqrt{(x-2)^2}=|x-2|. $$

The inner expression \(x-2\) is zero at \(x=2\). It is negative for \(x<2\) and positive for \(x>2\). Therefore the integrand has the piecewise form

$$ |x-2|= \begin{cases} 2-x, & x<2,\\ x-2, & x\ge 2. \end{cases} $$

Integrating on each sign interval gives

$$ \int |x-2|\,dx= \begin{cases} 2x-\dfrac{x^2}{2}+C_1, & x<2,\\[4pt] \dfrac{(x-2)^2}{2}+C_2, & x>2. \end{cases} $$

For a single antiderivative across \(x=2\), choose the constants so the formulas join. The expression \(\frac12(x-2)|x-2|+C\) does this. Indeed, for \(x<2\) it equals \(-\frac12(x-2)^2+C\), which differs from \(2x-\frac12x^2\) by a constant; for \(x>2\) it equals \(\frac12(x-2)^2+C\).

Check by differentiation on each side of \(2\): the derivative is \(-(x-2)=2-x=|x-2|\) when \(x<2\), and \(x-2=|x-2|\) when \(x>2\). At \(x=2\), the derivative of \(\frac12(x-2)|x-2|\) is also \(0\), equal to the integrand there. Thus the result is valid on the whole real line.

Definite Integrals: Split at the Zero, Then Substitute

Suppose substitution produces an integral involving \(|u|\) and the transformed interval crosses \(u=0\). The sign of \(u\) is different on the two sides of zero, so split the integral there. For instance, on \([-1,8]\), \(|u|=-u\) from \(-1\) to \(0\), and \(|u|=u\) from \(0\) to \(8\).

Worked Example: Substitution Across a Sign Change

Evaluate \(\int_0^3 |x^2-1|\,2x\,dx\).

Set \(u=x^2-1\), so \(du=2x\,dx\). Transform the endpoints: when \(x=0\), \(u=-1\); when \(x=3\), \(u=8\). The integral becomes

$$ \int_{-1}^{8}|u|\,du = \int_{-1}^{0}(-u)\,du+\int_0^8 u\,du. $$

Compute both parts:

$$ \int_{-1}^{0}(-u)\,du = \left[-\frac{u^2}{2}\right]_{-1}^{0} = 0-\left(-\frac12\right) = \frac12, $$
$$ \int_0^8u\,du = \left[\frac{u^2}{2}\right]_0^8 = \frac{64}{2}-0 = 32. $$

Adding the contributions gives \(\frac12+32=\frac{65}{2}\).

Check in the original variable. The zero of \(x^2-1\) in \([0,3]\) is \(x=1\), and \(x^2-1\) is negative on \([0,1)\) and positive on \((1,3]\). Thus

$$ \int_0^1(1-x^2)2x\,dx = \left[x^2-\frac{x^4}{2}\right]_0^1 = \frac12, $$
$$ \int_1^3(x^2-1)2x\,dx = \left[\frac{x^4}{2}-x^2\right]_1^3 = \left(\frac{81}{2}-9\right)-\left(\frac12-1\right) = \frac{63}{2}+\frac12 = 32. $$

The original-variable calculation also gives \(\frac12+32=\frac{65}{2}\), as required.

A Global Antiderivative for a Matched Substitution

Sometimes the absolute value is multiplied by the derivative of its inner expression. Then a single formula handles every sign change, even if there are infinitely many zeros. The formula is based on the function \(H(u)=\frac12u|u|\).

Theorem: If \(g\) is differentiable on an interval, then
$$ \int |g(x)|g'(x)\,dx = \frac12 g(x)|g(x)|+C. $$

This does not require \(g\) to have finitely many zeros or to be monotone.

Why the Global Formula Works

For \(u>0\), \(H(u)=\frac12u^2\), so \(H'(u)=u=|u|\). For \(u<0\), \(H(u)=-\frac12u^2\), so \(H'(u)=-u=|u|\). At \(u=0\), the derivative is also \(0\), because

$$ \lim_{h\to0}\frac{H(h)-H(0)}{h} = \lim_{h\to0}\frac{\frac12h|h|}{h} = \lim_{h\to0}\frac12|h| = 0. $$

Therefore \(H'(u)=|u|\) for every real \(u\). Applying the chain rule to \(H(g(x))\) gives

$$ \frac{d}{dx}H(g(x)) = H'(g(x))g'(x) = |g(x)|g'(x). $$

This proves the formula. In particular, the proof does not divide the interval into sign regions, so infinitely many zeros do not cause a problem for this matched integrand.

Worked Example: Several Zeros and an Inner Function That Turns

Evaluate \(\int_0^3 |x^2-3x+2|(2x-3)\,dx\).

Let \(g(x)=x^2-3x+2=(x-1)(x-2)\). Then \(g'(x)=2x-3\). Its zeros are \(1\) and \(2\); \(g\) is positive on \([0,1)\), negative on \((1,2)\), and positive on \((2,3]\). The global antiderivative is

$$ H(g(x))=\frac12 g(x)|g(x)|. $$

Evaluate at the endpoints. Since \(g(0)=2\) and \(g(3)=2\),

$$ \int_0^3 |g(x)|g'(x)\,dx = H(g(3))-H(g(0)) = \frac12(2)(2)-\frac12(2)(2) = 2-2 = 0. $$

The sign intervals show the contributions explicitly. At \(x=1\) and \(x=2\), \(g(x)=0\), so \(H(g(x))=0\). From \(0\) to \(1\), the contribution is \(0-2=-2\); from \(1\) to \(2\), it is \(0-0=0\); and from \(2\) to \(3\), it is \(2-0=2\). Their sum is \(-2+0+2=0\).

Check by differentiating: wherever \(g(x)\) is positive, the derivative of \(\frac12g(x)^2\) is \(g(x)g'(x)=|g(x)|g'(x)\). Wherever \(g(x)\) is negative, the expression is \(-\frac12g(x)^2\), whose derivative is \(-g(x)g'(x)=|g(x)|g'(x)\). At the zeros, both sides are zero. Thus the antiderivative and the definite value are consistent.

When There Are Infinitely Many Zeros

A finite sign chart is not available for every continuous inner expression. For example, define \(g(0)=0\) and \(g(x)=x^4\sin(1/x^2)\) for \(0<x\le1\). This function is differentiable on \([0,1]\) and has infinitely many zeros accumulating at \(0\). No finite partition can include every zero.

For an integral of the matched form \(|g(x)|g'(x)\), the global antiderivative just proved applies without any partition. For a different integrand containing \(|g(x)|\), do not claim that a finite list of zeros captures every sign change. Use a method justified for that integral, or establish a limiting argument before summing contributions from sign intervals.

A Common Mistake: Dropping the Absolute Value

A frequent error is to replace \(\sqrt{g(x)^2}\) by \(g(x)\) without checking the sign. For \(x<2\), the incorrect calculation

$$ \sqrt{(x-2)^2}=x-2 $$

gives a negative value, even though a real square root cannot be negative. The correction is \(\sqrt{(x-2)^2}=|x-2|=2-x\) on \(x<2\), and \(|x-2|=x-2\) on \(x\ge2\). Locate the zeros first; then use the sign on each interval.

Check Your Understanding

For each question, identify the relevant sign information before evaluating or simplifying.

  1. At which value does \(\sqrt{(x+3)^2}\) change its expression, and what is it for \(x<-3\)?
  2. Transform \(\int_0^2 |x-1|\,dx\) using \(u=x-1\). At what value of \(u\) should the transformed integral be split?
  3. Give an antiderivative of \(|x^2-4|\,2x\) that is valid across the zeros of \(x^2-4\).
  4. Why does a continuous inner expression not necessarily admit a finite partition containing all its zeros?
  5. State the condition on an integrand that allows the global formula \(\frac12g(x)|g(x)|+C\) to apply.

Test yourself: Calculus I 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