Ever tried to integrate |x| and felt the math suddenly turn into a maze?
You’re not alone. The absolute‑value function looks innocent enough—just a V‑shape on a graph—but once you start asking for its antiderivative, the rules you’ve relied on for smooth curves start to wobble.
In practice, the trick is less about memorizing a formula and more about understanding why the answer splits into pieces. Once that clicks, the rest falls into place, and you’ll actually enjoy those “aha!” moments instead of dreading the next calculus quiz.
What Is the Antiderivative of the Absolute Value of x
When we talk about the antiderivative (or indefinite integral) of |x|, we’re asking: “Which function, when differentiated, gives me |x| again?”
In plain English, we want a function F(x) such that F′(x) = |x|.
Because |x| behaves differently on the left and right side of zero, the antiderivative can’t be a single polynomial that works everywhere. Instead, we treat the domain in two chunks:
- For x ≥ 0, |x| = x.
- For x < 0, |x| = –x.
So the antiderivative is essentially the “glue” that stitches together the integrals of x and –x, plus the ever‑present constant of integration C Small thing, real impact..
Piecewise definition in a nutshell
[ F(x)=\begin{cases} \displaystyle \frac{x^{2}}{2}+C_{1}, & x\ge 0\[6pt] \displaystyle -\frac{x^{2}}{2}+C_{2}, & x<0 \end{cases} ]
Because the two constants can be merged into a single C (they differ only by a constant shift), the most common compact form is
[ \boxed{,\displaystyle \int |x|,dx = \frac{x|x|}{2}+C,} ]
That compact expression hides the piecewise logic, but it’s exactly what you get when you simplify the two cases.
Why It Matters / Why People Care
You might wonder, “Why bother with this one‑line integral?” The answer is twofold.
First, absolute values pop up in physics (think of distance traveled vs. Consider this: displacement) and economics (cost functions that penalize overshoot). Whenever you need the area under a V‑shaped curve, you’re integrating |x|, either directly or after a substitution.
Second, the absolute‑value integral is a textbook example of piecewise integration, a skill that shows up again and again—think of step functions, piecewise‑defined probability density functions, or any scenario where a rule changes at a breakpoint. Mastering the antiderivative of |x| builds intuition for handling those breakpoints cleanly.
If you skip the piecewise reasoning, you’ll end up with a “wrong” answer that fails the derivative test at x = 0. In real‑world modeling, that could mean a sudden, impossible jump in velocity or cost—something no sensible model should have.
How It Works (or How to Do It)
Let’s walk through the process step by step, so you can repeat it without staring at the board for five minutes.
1. Identify the breakpoints
Absolute value changes sign at x = 0. That’s your only breakpoint for |x|, so split the integral at that point.
2. Write the integral as two separate pieces
[ \int |x|,dx = \int_{-\infty}^{0} (-x),dx ;+; \int_{0}^{\infty} x,dx ]
Since we’re after the indefinite integral, we just treat the two regions separately:
- For x < 0, replace |x| with –x.
- For x ≥ 0, replace |x| with x.
3. Integrate each piece
When x ≥ 0:
[ \int x,dx = \frac{x^{2}}{2}+C_{1} ]
When x < 0:
[ \int (-x),dx = -\frac{x^{2}}{2}+C_{2} ]
4. Re‑assemble the piecewise antiderivative
Combine the two results, remembering that C₁ and C₂ are just constants. You can write a single constant C that works for the whole function because adding a constant to one side and subtracting the same constant from the other leaves the derivative unchanged.
[ F(x)=\begin{cases} \displaystyle \frac{x^{2}}{2}+C, & x\ge 0\[6pt] \displaystyle -\frac{x^{2}}{2}+C, & x<0 \end{cases} ]
5. Collapse into a compact formula
Notice that x·|x| equals x² when x ≥ 0 and –x² when x < 0. Divide by 2, and you have the tidy expression:
[ \int |x|,dx = \frac{x|x|}{2}+C ]
That’s the “one‑liner” most textbooks show, and it works because the absolute value already encodes the sign change And that's really what it comes down to..
6. Verify by differentiating
Take the derivative of (\frac{x|x|}{2}):
If x > 0: (|x| = x), so (\frac{x|x|}{2} = \frac{x^{2}}{2}). Derivative → x = |x|.
If x < 0: (|x| = -x), so (\frac{x|x|}{2} = -\frac{x^{2}}{2}). Derivative → –x = |x| Worth keeping that in mind. Nothing fancy..
At x = 0 the derivative is undefined, which matches the fact that |x| isn’t differentiable there. The antiderivative is still perfectly valid; it’s just a cusp in the original function Simple as that..
Common Mistakes / What Most People Get Wrong
-
Forgetting the piecewise split – Trying to treat |x| as a single “x” and writing (\frac{x^{2}}{2}+C) for all x. That works only for x ≥ 0 and gives the wrong sign on the left side.
-
Dropping the constant on one side – Some students write (F(x)=\frac{x^{2}}{2}) for x ≥ 0 and (-\frac{x^{2}}{2}) for x < 0, forgetting that a single constant C should sit on both branches. The derivative test still passes, but the function isn’t truly an antiderivative of the same original function across the whole line.
-
Mis‑applying the power rule – The absolute value isn’t a power of x, so you can’t just do (\int |x|dx = \frac{|x|^{2}}{2}+C). That would give (\frac{x^{2}}{2}) for all x, ignoring the sign flip And that's really what it comes down to..
-
Assuming differentiability at 0 – The antiderivative is fine at 0, but the original |x| isn’t differentiable there. If you try to apply the Fundamental Theorem of Calculus across a point where the integrand isn’t smooth, you need to split the interval first.
-
Confusing definite vs. indefinite integrals – When you compute a definite integral of |x| from a negative to a positive bound, you must split the limits. Skipping that step yields a wrong area (often half the true value) The details matter here..
Practical Tips / What Actually Works
-
Always sketch the graph before integrating. Seeing that V‑shape makes the breakpoint obvious Most people skip this — try not to. That alone is useful..
-
Write |x| as a piecewise function first: (|x| = \begin{cases} x, & x\ge0 \ -x, & x<0\end{cases}). Then integrate each piece That alone is useful..
-
Use the compact formula (\frac{x|x|}{2}+C) for quick work, but keep the piecewise version handy for checking.
-
When evaluating a definite integral, split the limits at 0 (or any other breakpoint). Example:
[ \int_{-3}^{4} |x|,dx = \int_{-3}^{0} (-x),dx + \int_{0}^{4} x,dx = \left[-\frac{x^{2}}{2}\right]{-3}^{0} + \left[\frac{x^{2}}{2}\right]{0}^{4}= \frac{9}{2} + \frac{16}{2}= \frac{25}{2}. ]
-
Check your work by differentiating the result. If you get back |x| (except at the cusp), you’re good.
-
Remember the constant of integration. In a piecewise context, you can absorb any differences into a single C, but don’t forget to add it at all Easy to understand, harder to ignore..
-
Practice with variations: try (\int |x-2|dx) or (\int |3x+1|dx). The same steps apply—shift the breakpoint, adjust the sign, and integrate.
FAQ
Q1: Why can’t I just write (\frac{|x|^{2}}{2}+C) as the antiderivative?
A: (|x|^{2}=x^{2}) for every x, so (\frac{|x|^{2}}{2}) simplifies to (\frac{x^{2}}{2}). Its derivative is x, not |x|, because the sign information is lost. The correct antiderivative must retain the sign change, which the compact (\frac{x|x|}{2}) does.
Q2: Is the antiderivative continuous at x = 0?
A: Yes. Both pieces evaluate to 0 at x = 0, so the function (\frac{x|x|}{2}+C) is continuous there. The derivative, however, jumps from –0 to +0, reflecting the cusp in |x| It's one of those things that adds up..
Q3: How do I integrate (|x|^{n}) for n ≠ 1?
A: Split at 0 again. For x ≥ 0, (|x|^{n}=x^{n}); for x < 0, (|x|^{n}=(-x)^{n}=(-1)^{n}x^{n}). Then integrate each piece: (\int x^{n}dx = \frac{x^{n+1}}{n+1}) and (\int (-x)^{n}dx = \frac{(-1)^{n}x^{n+1}}{n+1}). Combine with a single constant.
Q4: Can I use substitution to integrate |x|?
A: Substitution isn’t necessary because the absolute value already tells you the sign. If you have something like (\int |3x+2|dx), let u = 3x+2, then du = 3dx, and you still need to split at u = 0 (i.e., x = –2/3) It's one of those things that adds up..
Q5: Does the antiderivative formula change if I’m working with complex numbers?
A: The real‑valued absolute value |x| is defined only for real x. In the complex plane you’d use the modulus, which isn’t differentiable in the complex sense, so the whole calculus framework shifts. For real‑valued integrals, the piecewise approach stays the same It's one of those things that adds up..
So there you have it: the antiderivative of |x| isn’t a mysterious new function, just a clever way of remembering that the V‑shape flips its slope at zero. Keep the piecewise mindset, use the compact (\frac{x|x|}{2}+C) when you need speed, and you’ll never get stuck on that “absolute‑value integral” again. Happy integrating!
Not obvious, but once you see it — you'll see it everywhere.