Skip to main content

Integrals involving absolute values

2026-10-22 huynhvietkhanh Comments: 0

Split the interval according to the sign of the integrand, evaluate each part, and check the result using nonnegativity.

High schoolAntiderivatives & Integrals

Updated: October 22, 2026

Taking the absolute value makes every function value nonnegative. To evaluate an integral involving an absolute value, first determine the sign of the function on the interval of integration, then choose the appropriate antiderivatives.

Objectives: split the interval according to the sign of the function, evaluate each part, and check the result using nonnegativity.

Prerequisites: definite integrals (English lesson); signs of polynomials and basic antiderivatives.

In this lesson: Idea · Method · Examples · Practice · Further study

1. The sign of the function determines how to remove the absolute value

For every real number $u$, $|u|=u$ if $u\ge0$, and $|u|=-u$ if $u<0$. Applying this at each point $x$, we obtain

$$|f(x)|=\begin{cases}f(x),&f(x)\ge0,\\-f(x),&f(x)<0.\end{cases}$$

Suppose that $a<b$ and $f$ is continuous on $[a;b]$. Then $|f|$ is continuous, so its integral exists and is nonnegative. If $f$ is not identically $0$, continuity also ensures that the integral is positive: near a point where $|f|>0$, the function has a positive lower bound on a small subinterval.

2. Split the interval and determine the signs

  1. Find the roots of $f(x)=0$ in $[a;b]$ and determine the sign on each interval between consecutive roots. Only roots in the interval can become breakpoints.
  2. Use additivity over intervals to split the integral. Where $f\ge0$, keep $f$; where $f\le0$, replace it with $-f$.
  3. Evaluate the integrals and add their values. Each part is nonnegative when its limits are written in increasing order.

If there is a finite partition $a=t_0<t_1<\cdots<t_m=b$ such that $f$ has a constant sign on each subinterval, then

$$\int_a^b|f(x)|\,dx=\sum_{j=1}^m\varepsilon_j\int_{t_{j-1}}^{t_j}f(x)\,dx,\qquad \varepsilon_j\in\{1,-1\},$$

where $\varepsilon_j$ is chosen so that $\varepsilon_j f\ge0$ on the corresponding subinterval. A root at which the sign does not change does not require a split, although splitting there is still valid. This finite procedure applies directly to the examples below. A general continuous function may have infinitely many roots, so a finite set of breakpoints must not be assumed in every case.

3. Worked examples

Example 1. A linear function with one sign change

Evaluate $I=\int_0^2|x-1|\,dx$. On $[0;1]$, $x-1\le0$; on $[1;2]$, $x-1\ge0$. Hence

$$\begin{aligned}I&=\int_0^1(1-x)\,dx+\int_1^2(x-1)\,dx\\&=\left[x-\frac{x^2}{2}\right]_0^1+\left[\frac{x^2}{2}-x\right]_1^2\\&=\frac12+\frac12=1.\end{aligned}$$

In the second integral, the value of the antiderivative at $2$ is $0$, and its value at $1$ is $-1/2$, so the difference is $1/2$. The two parts also correspond to triangles whose bases and heights are all $1$, which confirms the result.

Example 2. Use evenness after determining the signs

Evaluate $J=\int_{-2}^2|x^2-1|\,dx$. The integrand is even. On $[0;1]$, use $1-x^2$; on $[1;2]$, use $x^2-1$. It follows that

$$\begin{aligned}J&=2\left(\int_0^1(1-x^2)\,dx+\int_1^2(x^2-1)\,dx\right)\\&=2\left(\frac23+\frac43\right)=4.\end{aligned}$$

Evenness reduces the number of intervals to evaluate, but it does not replace sign analysis. By comparison, the signed integral $\int_{-2}^2(x^2-1)\,dx=4/3$ is less than $4$ because the positive and negative contributions partly cancel.

Example 3. A trigonometric function

On $[0;\pi/2]$, $\cos x\ge0$; on $[\pi/2;\pi]$, $\cos x\le0$. Therefore

$$\int_0^\pi|\cos x|\,dx=[\sin x]_0^{\pi/2}-[\sin x]_{\pi/2}^{\pi}=1+1=2.$$

4. Practice exercises

  1. Evaluate $\int_{-1}^1|x|\,dx$.
  2. Evaluate $\int_0^3|2x-2|\,dx$.
  3. Evaluate $\int_{-2}^2|x^2|\,dx$. Is it necessary to split at $0$?
Show answers and hints
  1. The integrand is even, so $2\int_0^1x\,dx=1$.
  2. Split at $1$. The two parts have values $1$ and $4$, respectively, with sum $5$.
  3. Since $x^2\ge0$ throughout the interval, remove the absolute value to obtain $16/3$. There is no need to split at $0$ because the sign does not change.

5. Common mistakes

  • Assuming that $\int_a^b|f|=|\int_a^b f|$. In Example 1, the two sides are $1$ and $0$, respectively.
  • Replacing $|f|$ with a single formula even though $f$ changes sign within the interval.
  • Subtracting the two area contributions instead of adding them.
  • Forgetting that reversing the limits changes the sign: the nonnegativity stated above uses the assumption $a<b$.

6. Related lessons

Original exercise resource on Scribd.

Leave a Reply

Your email address will not be published. Required fields are marked *