Skip to content
ihateDesmos

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.

−22−550
Open in calculator
y=|x|
in blue and its integral
y=x|x|2
(with C = 0) in red.

How to integrate |x|

Method: splitting the domain.

  1. 1
    Split the function: |x| = x for x ≥ 0, and |x| = −x for x < 0.
  2. 2
    For x ≥ 0, ∫x dx = x²/2.
  3. 3
    For x < 0, ∫(−x) dx = −x²/2.
  4. 4
    Both match at x = 0, and both are captured by x|x|/2.
  5. 5
    So 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.

−4−3−2−11234−6−4−2246

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.

Checking the integral
x|x|Slope of the answer
−333
−111
000.000005
111
333

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.

Open the integral calculator