Integral of |x|
Updated 6 November 2026 · Checked numerically by the ihateDesmos engine
The integral of |x|
∫
|x|
dx =x|x|2+C
The integral of |x| is x|x|/2 + C. That is x²/2 for positive x and −x²/2 for negative x, joined smoothly at zero.
y=|x|
in blue and its integral y=x|x|2
(with C = 0) in red.How to integrate |x|
Method: splitting the domain.
- 1Split the function: |x| = x for x ≥ 0, and |x| = −x for x < 0.
- 2For x ≥ 0, ∫x dx = x²/2.
- 3For x < 0, ∫(−x) dx = −x²/2.
- 4Both match at x = 0, and both are captured by x|x|/2.
- 5So the integral is x|x|/2 + C.
What it means
The area under the V shape from −a to a is two triangles, each of area a²/2, for a total of a². Definite integrals of |x| are often easiest to do by splitting at 0.
The integral from −2 to 3
Using the antiderivative: F(3) − F(−2) = 13/2, which is about 13/2. A direct numerical integration of |x| gives 13/2, which agrees.
Check by differentiating
The derivative of the answer should give back the original function. The last column measures that slope directly from the answer, and it matches.
| x | |x| | Slope of the answer |
|---|---|---|
| −3 | 3 | 3 |
| −1 | 1 | 1 |
| 0 | 0 | 0.000005 |
| 1 | 1 | 1 |
| 3 | 3 | 3 |
Common mistakes
- Writing x²/2 for all x, which gives the wrong slope for negative x.
- Forgetting to split a definite integral at x = 0.
Frequently asked questions
What is the integral of |x|?
The integral of |x| is x|x|/2 + C.
What is the integral of |x| from −2 to 3?
13/2, which is about 13/2.
Keep going
Integrate any function
Type your own function into the integral calculator for the steps, the answer and a graph.