Graph of y = |x − 2| (Shifted absolute value)

· How we calculate · Free, no sign-up

Quick answer

The graph of y = |x − 2| is a V-shape with its vertex at (2, 0). Domain: All real numbers (−∞, ∞); range: y ≥ 0, i.e. [0, ∞). x-intercept: x = 2; y-intercept: y = 2. It is neither even nor odd.

Functiony = |x − 2|
DomainAll real numbers (−∞, ∞)
Rangey ≥ 0, i.e. [0, ∞)
x-intercept(s)x = 2
y-intercepty = 2
Derivative−1 for x < 2, 1 for x > 2 (undefined at 2)
Graph of y = |x − 2| for −3 ≤ x ≤ 7−3−2−101234567−2−10123456
Graph of y = |x − 2| for −3 ≤ x ≤ 7, −2 ≤ y ≤ 6. Dots mark intercepts.
Zoom, pan and trace y = |x − 2| next to y = |x| in the interactive grapher.Open the Graphing Calculator →

What the graph of y = |x − 2| looks like

y = |x − 2| measures how far x is from 2, so it is 0 at x = 2 and grows by 1 for every unit you move away in either direction. Graphically it is y = |x| slid 2 units to the right, with its corner at (2, 0) and a y-intercept of |0 − 2| = 2.

Inequalities like |x − 2| < 1 can be read straight off the graph: the curve is below height 1 between x = 1 and x = 3, so the solution is 1 < x < 3.

Key features of y = |x − 2|

Key features of y = |x − 2|
PropertyValue
Functiony = |x − 2| (Shifted absolute value)
FamilyAbsolute value
DomainAll real numbers (−∞, ∞)
Rangey ≥ 0, i.e. [0, ∞)
x-intercept(s)x = 2
y-intercepty = 2
SymmetryNeither even nor odd (symmetric about the vertical line x = 2)
AsymptotesNone
PeriodNot periodic
Increasing on[2, ∞)
Decreasing on(−∞, 2]
Key pointsVertex (corner) at (2, 0)
Derivative f′(x)−1 for x < 2, 1 for x > 2 (undefined at 2)
Antiderivative ∫ f(x) dx(x − 2)|x − 2|/2 + C

Symmetry: Neither even nor odd (symmetric about the vertical line x = 2). For example f(2) = 0 but f(−2) = 4, which is neither the same value nor its negative. Intercepts: the graph meets the x-axis at x = 2 and the y-axis at y = 2.

Table of values for y = |x − 2|

Values of y = |x − 2|
xy = |x − 2|Slope f′(x)
−35−1
−24−1
−13−1
02−1
11−1
20undefined
311

How to sketch y = |x − 2| by hand

Plot the points from the table — (−3, 5), (−2, 4), (−1, 3), (0, 2), (1, 1), (2, 0) — on axes running from about −3 to 7 horizontally. There are no asymptotes to draw. Then join the points with a smooth curve. As a check on the shape — increasing: [2, ∞); decreasing: (−∞, 2].

Derivative, tangent line and area

The derivative of y = |x − 2| is −1 for x < 2, 1 for x > 2 (undefined at 2), which gives the slope of the curve at each point (the third column of the table). At x = 1 the curve is at height 1 and its slope is f′(1) = −1, so the tangent line there is y = −x + 2.

The signed area under the curve from x = 0 to x = 4 is 4, found using the antiderivative (x − 2)|x − 2|/2 + C.

Related graphs and transformations

Browse all graphs of common functions by family, or open the graphing calculator.

Frequently asked questions

What is the domain and range of y = |x − 2|?

Domain: All real numbers (−∞, ∞). Range: y ≥ 0, i.e. [0, ∞).

What are the intercepts of y = |x − 2|?

x-intercept(s): x = 2. y-intercept: y = 2.

What is the derivative of y = |x − 2|?

f′(x) = −1 for x < 2, 1 for x > 2 (undefined at 2). At x = 1 the curve is at height 1 and its slope is f′(1) = −1, so the tangent line there is y = −x + 2.

Is y = |x − 2| even, odd or neither?

Neither even nor odd (symmetric about the vertical line x = 2). For example f(2) = 0 but f(−2) = 4, which is neither the same value nor its negative.

Does y = |x − 2| have asymptotes?

None.