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:
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.
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.
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\):
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
Integrating on each sign interval gives
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
Compute both parts:
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
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|\).
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
Therefore \(H'(u)=|u|\) for every real \(u\). Applying the chain rule to \(H(g(x))\) gives
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
Evaluate at the endpoints. Since \(g(0)=2\) and \(g(3)=2\),
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
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.
- At which value does \(\sqrt{(x+3)^2}\) change its expression, and what is it for \(x<-3\)?
- Transform \(\int_0^2 |x-1|\,dx\) using \(u=x-1\). At what value of \(u\) should the transformed integral be split?
- Give an antiderivative of \(|x^2-4|\,2x\) that is valid across the zeros of \(x^2-4\).
- Why does a continuous inner expression not necessarily admit a finite partition containing all its zeros?
- State the condition on an integrand that allows the global formula \(\frac12g(x)|g(x)|+C\) to apply.