# Absolute Value Function |x|: Graph, Derivative, Integral and Corner

> The absolute value function |x|: its V-shaped graph, why it is continuous but not differentiable at 0, its derivative x/|x|, and its integral.

Source: https://practicecalculus.com/functions/absolute-value-function
Updated: 2026-11-03

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

## At a glance

- **Domain:** $(-\infty, \infty)$
- **Range:** $[0, \infty)$
- **Derivative:** $\frac{x}{|x|}$
- **Integral:** $\frac{x|x|}{2} + C$
- **Not differentiable at:** $x = 0$ (a corner)
- **Symmetry:** Even: $|-x| = |x|$

## Key takeaways

- The absolute value $|x|$ is the distance from $x$ to $0$, so it is never negative and its graph is a V.
- It is continuous everywhere but not differentiable at $x = 0$, where the graph has a sharp corner.
- For $x \ne 0$ its derivative is $\frac{x}{|x|}$, which is $1$ for $x > 0$ and $-1$ for $x < 0$.
- To integrate $|x|$ over an interval containing $0$, split the integral at $0$.

The **absolute value function** $f(x) = |x|$ gives the distance from $x$ to $0$ on the number line, so it removes any negative sign: $|3| = 3$ and $|-3| = 3$. Its V-shaped graph is the classic example of a function that is continuous everywhere but has a point where the derivative does not exist.

## Formula

$$|x| = \begin{cases} x & x \ge 0 \\ -x & x < 0 \end{cases}$$

It is a [piecewise function](/functions/piecewise-functions) built from two [linear functions](/functions/linear-function). Equivalently, $|x| = \sqrt{x^2}$, which links it to the [square root function](/functions/square-root-function).

## Graph of |x|

```graph
title: 'Graph of the absolute value function y = |x|'
caption: 'The graph is a V with its vertex at the origin. The slope is $-1$ on the left and $1$ on the right, so there is a corner at $x = 0$.'
x: [-4, 4]
y: [-1, 4]
functions:
  - expr: abs(x)
    label: y = |x|
points:
  - [0, 0, 'corner (0, 0)']
```

The general form $y = a|x - h| + k$ is a V with vertex $(h, k)$, opening up if $a > 0$ and down if $a < 0$, with side slopes $\pm a$.

## Key properties

- **Domain** all reals; **range** $[0, \infty)$.
- **Even function:** $|-x| = |x|$, symmetric about the $y$-axis.
- **Continuous everywhere**, including at $0$.
- **Absolute minimum** of $0$ at $x = 0$, which is a critical point because $f'(0)$ does not exist.
- **Triangle inequality:** $|a + b| \le |a| + |b|$.
- **Products split, sums do not:** $|ab| = |a||b|$, but $|a + b|$ is usually not $|a| + |b|$.

## Derivative of |x|

For $x \ne 0$:

$$\frac{d}{dx}|x| = \frac{x}{|x|} = \begin{cases} 1 & x > 0 \\ -1 & x < 0 \end{cases}$$

At $x = 0$ the one-sided limits of the difference quotient are

$$\lim_{h \to 0^+}\frac{|h|}{h} = 1, \qquad \lim_{h \to 0^-}\frac{|h|}{h} = -1$$

They disagree, so $f'(0)$ does not exist. This is the textbook case of [when derivatives fail](/blog/limit-definition-of-the-derivative): a corner. With the [chain rule](/rules/chain-rule), $\frac{d}{dx}|g(x)| = \frac{g(x)}{|g(x)|}g'(x)$ wherever $g(x) \ne 0$.

## Integral of |x|

$$\int |x|\,dx = \frac{x|x|}{2} + C$$

Check it piece by piece: for $x > 0$ it is $\frac{x^2}{2}$, with derivative $x = |x|$; for $x < 0$ it is $-\frac{x^2}{2}$, with derivative $-x = |x|$. For a definite integral, split at the point where the inside changes sign.

## Worked examples

**Example 1: definite integral.** Evaluate $\int_{-1}^{2}|x|\,dx$ by splitting at $0$:

$$\int_{-1}^{0}(-x)\,dx + \int_{0}^{2}x\,dx = \frac{1}{2} + 2 = \frac{5}{2}$$

Geometrically, these are two triangles with areas $\frac{1}{2}$ and $2$.

**Example 2: a shifted absolute value.** $g(x) = |x - 3|$ has derivative $1$ for $x > 3$ and $-1$ for $x < 3$, and is not differentiable at $x = 3$.

**Example 3: chain rule.** For $x \ne 2$, $\frac{d}{dx}|2x - 4| = \frac{2x - 4}{|2x - 4|} \cdot 2$, which is $2$ for $x > 2$ and $-2$ for $x < 2$.

**Example 4: a limit.** $\lim_{x \to 0}\frac{|x|}{x}$ does not exist, because it is $1$ from the right and $-1$ from the left.

## Common mistakes

1. **Saying $|x|$ is not continuous at $0$.** It is continuous; it is only not differentiable there.
2. **Writing $|{-x}| = -|x|$.** Absolute value is never negative: $|-x| = |x|$.
3. **Integrating across $0$ without splitting.** $\int_{-1}^{2}|x|\,dx$ is not $\frac{2^2}{2} - \frac{(-1)^2}{2}$.
4. **Forgetting it is a critical point.** When looking for extrema, include points where the derivative does not exist, like the vertex of a V.

## How it connects

Absolute values appear in $\int \frac{1}{x}\,dx = \ln|x| + C$, in the epsilon-delta definition of a limit, and in absolute convergence of series in [convergence tests](/blog/convergence-tests). For more on corners and other places where derivatives fail, see the [continuity](/blog/continuity) guide.

## Frequently asked questions

### What is the derivative of |x|?

For $x \ne 0$, $\frac{d}{dx}|x| = \frac{x}{|x|}$, which equals $1$ when $x > 0$ and $-1$ when $x < 0$. At $x = 0$ the derivative does not exist.

### Why is |x| not differentiable at 0?

The slope from the right is $1$ and the slope from the left is $-1$. Since the one-sided limits of the difference quotient disagree, the derivative at $0$ does not exist, and the graph shows a sharp corner.

### Is the absolute value function continuous?

Yes. $|x|$ is continuous at every real number, including $0$, where both one-sided limits equal $0 = |0|$. It shows that continuity does not imply differentiability.

### What is the integral of |x|?

An antiderivative is $\frac{x|x|}{2}$, so $\int |x|\,dx = \frac{x|x|}{2} + C$. For definite integrals it is usually easier to split at $0$, for example $\int_{-1}^{2}|x|\,dx = \frac{1}{2} + 2 = \frac{5}{2}$.
