On this page
When you first learn calculus, the modulus function f(x) = |x| looks like a roadblock. Because its graph has a sharp V-shaped corner at the origin, you are taught to break the function apart before integrating it. But there is a much faster way.
The integral of the absolute value function |x| can be expressed as a single unified formula: ∫ |x| dx = x|x|/2 + C.
This single expression wraps both the positive and negative sides of the curve into one neat package. Using it saves you time and reduces algebraic errors when evaluating definite integrals or finding antiderivatives in exam settings.
How to integrate mod x?
To understand where this time-saving shortcut comes from, look at the standard piecewise definition. As Cuemath explains, the absolute value of x is defined by two distinct cases:
|x| = x when x ≥ 0
|x| = -x when x < 0
If you integrate each piece on its own, you get:
For x ≥ 0, ∫ x dx = x²/2 + C
For x < 0, ∫ -x dx = -x²/2 + C
Rather than writing out a curly brace every time you need the antiderivative, you can use the property that x|x| reproduces these exact signs. When x is positive, x|x| becomes x², matching the first case. When x is negative, x|x| becomes -x², perfectly matching the second case.
If you are brushing up on your calculus foundations, you can explore this function's behaviour and other core topics in the Fermi Concept Library.
How do we verify it by differentiating?
In calculus, integration and differentiation are reverse processes. If x|x|/2 is truly the antiderivative of |x|, then differentiating it should bring us right back to |x|.
The simplest way to prove this is to take the derivative of the piecewise version of x|x|/2.
For x > 0, the function is x²/2. Its derivative is exactly x, which matches |x| for positive numbers.
For x < 0, the function is -x²/2. Its derivative is -x, which perfectly matches |x| for negative numbers.
But what if we want to differentiate x|x|/2 without splitting it? We can use the product rule. Let u = x and v = |x|. The derivative of x is 1. The derivative of |x| is |x|/x, which evaluates to 1 for positive numbers and -1 for negative numbers.
Applying the product rule to x|x|:
Derivative of the first part: 1 × |x| = |x|
Derivative of the second part: x × (|x|/x) = |x|
Summing them together: |x| + |x| = 2|x|
Since our original formula was divided by 2, we divide this result by 2. The twos cancel out, leaving us with exactly |x|. This algebraic check proves that our single formula is mathematically solid.
Why does x|x|/2 work?
The formula works because it naturally handles the way area accumulates under the curve. The graph of y = |x| sits entirely above the x-axis, so any definite integral must evaluate to a positive number if the upper limit is greater than the lower limit.
When you plug a negative number into x|x|/2, the two negative signs cancel out the area correctly, ensuring the geometry matches the algebra. This is much like how equations and inequalities with modulus require careful tracking of signs to avoid losing solutions.
If you struggle to picture how these areas accumulate, Fermi's AI tutor can draw the figure and check your understanding as it goes, deciding whether to explain the geometry or ask you to take the next step.
How to integrate mod x in definite integrals?
The standard textbook method for definite integrals is to split the interval at x = 0. While this is a robust technique, using the x|x|/2 formula is often much cleaner.
Worked Example: ∫ |x| dx from -2 to 3
Method 1: Splitting the integral Break the integral at the origin:
From -2 to 0: ∫ -x dx = [-x²/2] from -2 to 0 = 0 - (-2) = 2
From 0 to 3: ∫ x dx = [x²/2] from 0 to 3 = 4.5 - 0 = 4.5
Total Area = 2 + 4.5 = 6.5
Method 2: Using the x|x|/2 Formula Apply the limits directly to the single antiderivative:
F(x) = x|x|/2
Upper limit: F(3) = 3|3|/2 = 9/2 = 4.5
Lower limit: F(-2) = -2|-2|/2 = -4/2 = -2
Evaluate F(3) - F(-2) = 4.5 - (-2) = 6.5
Both methods yield exactly 6.5. This algebraic shortcut proves especially valuable in physics problems. For example, when you calculate the distance travelled by an object with a changing velocity that crosses zero, you integrate the absolute value of the velocity function. Keeping the modulus wrapped up in a single algebraic term allows you to manipulate the equations further without getting lost in multiple cases. It makes your exam working much cleaner and easier to check for mistakes.
If you find yourself making sign errors during these evaluations, the Fermi Problem Library offers a step-by-step solver that explains the reasoning behind each algebra step rather than just printing an answer.
For more practice with integration techniques, you might explore integrals of √(a² − x²) and √(x² ± a²) or see how geometry connects to calculus by finding area using horizontal strips.



