Shifting a graph up, down, left and right
If you already know the graph of a function, can you get the graph of the same rule with a number added, outside or inside, without plotting it all again?
Where you are 7 in Transformations of functions
When you reach for it
You know the parent graphs: y = x^2 and y = x^3, \displaystyle y = \sqrt{x} and \displaystyle y = \frac{1}{x}. A great many functions are one of these with a number added somewhere: x^2 + 4, \displaystyle \sqrt{x - 3}, (x + 1)^3. Each of their graphs is the parent graph slid, with its shape unchanged, to a new place. A slide like this is called a translation.
Reach for this skill when a rule is a parent with a constant added to its output or to its input and you want the graph without plotting from scratch, or when a graph has a parent’s exact shape in a new position and you want its rule. You have met the idea in geometry as translating a figure and for parabolas in vertex form. Here it works for every function at once.
The procedure
Adding to the output: a vertical shift
Take a function f and a constant k, and define
For each input, g does exactly what f does and then adds k. So at every x the graph of g is k higher than the graph of f: a point (a, b) on the graph of f becomes the point (a, b + k) on the graph of g. A positive k moves the graph up, a negative k moves it down, and since the input is untouched, nothing moves sideways.
Changing the input: a horizontal shift
Now take a constant h and define
This is f evaluated at the expression x - h: g first subtracts h from its input and only then hands the result to f. Suppose (a, b) is on the graph of f, so f(a) = b. Which input makes g give the same output b? g must hand f the number a, so its own input has to be a + h:
So (a + h, b) is on the graph of g. Every point slides h to the right when h is positive and to the left when h is negative. Nothing else appears either: if (c, d) is on the graph of g, then f(c - h) = d, so (c - h, d) was already a point of the graph of f.
This is why a horizontal shift looks reversed. The minus sign in f(x - h) does not mean “move left”. It means the input must be h larger than before to produce the same output, so every height arrives h later along the x-axis. A plus sign inside, as in f(x + 1), is f(x - (-1)), so h = -1 and the shift is 1 to the left.
Both at once
The rule
moves every point (a, b) to (a + h, b + k): h across and k up. This is a translation by the vector \langle h, k \rangle. The two slides can be done in either order with the same result, because adding h to the first coordinate and adding k to the second do not interfere. (Order does start to matter once flips and stretches join in; that is Combining transformations and the general form.)
So the number outside, k, moves the graph the way its sign says. The number inside, read from the form x - h, moves the graph the opposite way to the sign printed beside x.
Naming a translation from a graph
To read a translation off a graph, follow one point the parent is known by, its anchor:
| Parent | Anchor |
|---|---|
| y = x^2 | the vertex (0, 0) |
| y = x^3 | the center (0, 0), where the curve flattens and changes the way it bends |
| \displaystyle y = \sqrt{x} | the starting point (0, 0) |
| \displaystyle y = \frac{1}{x} | the point (0, 0) where the two asymptotes cross |
If the anchor has moved to (h, k), the translation is h across and k up, and the rule is y = f(x - h) + k. Then test one more point: the parent’s (1, 1) must land on (1 + h, 1 + k). If it does not, the shape has changed, and a translation alone cannot describe the graph.
Worked examples
Up four, down six
Compare the graphs of g(x) = x^2 + 4 and p(x) = x^2 - 6 with the graph of f(x) = x^2.
Solutiong(x) = f(x) + 4, so each output of f grows by 4 while the input stays put:
| x | -2 | -1 | 0 | 1 | 2 |
|---|---|---|---|---|---|
| f(x) = x^2 | 4 | 1 | 0 | 1 | 4 |
| g(x) = x^2 + 4 | 8 | 5 | 4 | 5 | 8 |
Every point rises 4, so the graph of g is the parabola moved up 4, with its vertex at (0, 4), as in the first figure. Its domain is still all real numbers, and its least output is 4 instead of 0.
p(x) = x^2 - 6 = f(x) + (-6), so k = -6: the parabola moves down 6 and its vertex is (0, -6). Check one point: p(2) = 4 - 6 = -2, which is f(2) = 4 moved down 6.
Why the minus sign moves it right
Describe the graph of \displaystyle g(x) = \sqrt{x - 3} compared with the graph of \displaystyle f(x) = \sqrt{x}, and explain the direction.
Solutiong(x) = f(x - 3), so h = 3. Choose inputs that make x - 3 a perfect square, so the roots come out whole:
| x | 3 | 4 | 7 | 12 |
|---|---|---|---|---|
| x - 3 | 0 | 1 | 4 | 9 |
| g(x) | 0 | 1 | 2 | 3 |
The parent passes through (0, 0), (1, 1), (4, 2) and (9, 3). The graph of g passes through (3, 0), (4, 1), (7, 2) and (12, 3): the same heights, each reached 3 further right. The reason is in the middle row. To output 2, g must hand f the number 4, and because g subtracts 3 first, its own input has to be 7. The graph starts at (3, 0) because x - 3 must not be negative, so the domain is x \geq 3.
A plus sign inside
Describe the graph of g(x) = (x + 1)^3 compared with the graph of f(x) = x^3. Where does the center (0, 0) go?
SolutionWrite the inside in the form x - h: x + 1 = x - (-1), so g(x) = f(x - (-1)) and h = -1. The graph moves 1 to the left, and the center goes to (-1, 0).
Check with the formula rather than the sign rule alone. g(-1) = 0^3 = 0, so (-1, 0) is on the graph. The parent’s (1, 1) should go to (0, 1), and g(0) = 1^3 = 1. The parent’s (-1, -1) should go to (-2, -1), and g(-2) = (-1)^3 = -1. Every point has moved 1 left.
Both moves on the reciprocal
Describe the graph of \displaystyle g(x) = \frac{1}{x + 1} - 6 compared with the graph of \displaystyle f(x) = \frac{1}{x}, including its asymptotes.
Solutiong(x) = f(x - (-1)) + (-6), so h = -1 and k = -6: every point moves 1 left and 6 down, from (a, b) to (a - 1, b - 6).
The asymptotes move with the graph. The parent has the vertical asymptote x = 0, because \displaystyle \frac{1}{x} cannot divide by zero; for g the forbidden input is where x + 1 = 0, so the vertical asymptote is x = -1. The parent has the horizontal asymptote y = 0, because \displaystyle \frac{1}{x} is never 0; \displaystyle \frac{1}{x + 1} is never 0 either, so g never takes the value -6, and the horizontal asymptote is y = -6.
Two points confirm the slide. The parent’s (1, 1) goes to (0, -5), and \displaystyle g(0) = \frac{1}{1} - 6 = -5. The parent’s (-1, -1) goes to (-2, -7), and \displaystyle g(-2) = \frac{1}{-1} - 6 = -7.
Naming a translation from its graph
The figure shows the graph of \displaystyle y = \sqrt{x} after a translation. Name the translation and write the equation.
The anchor of \displaystyle y = \sqrt{x} is its starting point (0, 0). Here the starting point is (-1, 4), so the graph moved 1 left and 4 up: h = -1 and k = 4. The rule is
Test a second point. The parent’s (1, 1) should land on (1 - 1, 1 + 4) = (0, 5), which is marked, and the formula agrees: \displaystyle \sqrt{0 + 1} + 4 = 5. The parent’s (4, 2) should land on (3, 6), and \displaystyle \sqrt{3 + 1} + 4 = 6. From its start the curve goes 1 across and 1 up, then 4 across and 2 up, exactly as the parent does, so nothing was stretched.
Setting off later on the water slide
Dunya rides down a water slide. Her height above the splash pool t seconds after she sets off is H(t) meters:
| t | 0 | 1 | 2 | 3 | 4 |
|---|---|---|---|---|---|
| H(t) | 12 | 11 | 8 | 3 | 0 |
Abelard sets off 3 seconds after Dunya and rides exactly as she did. Counting t from Dunya’s start, write Abelard’s height A(t) in terms of H, make his table, and find his height when t = 5.
SolutionAt time t, Abelard has been riding for t - 3 seconds, so he is wherever Dunya was at time t - 3:
His table starts at t = 3, when t - 3 = 0:
| t | 3 | 4 | 5 | 6 | 7 |
|---|---|---|---|---|---|
| A(t) | 12 | 11 | 8 | 3 | 0 |
So A(5) = H(2) = 8: Abelard is 8 meters up. His graph is Dunya’s moved 3 to the right, the same heights each 3 seconds later, and the minus sign counts back to the moment Dunya was in the same place. The rule H(t) - 3 would mean something else: a rider always 3 meters lower than Dunya, finishing below the water’s surface.
Boundaries
- The amount added must be a constant. f(x) + x adds a different amount at each input, so it bends the graph rather than sliding it.
- The shift reads straight off the inside only when x appears there alone, with coefficient 1. \displaystyle \sqrt{2x - 6} is not \displaystyle \sqrt{x} moved 6 right: it is \displaystyle \sqrt{2(x - 3)}, a squeeze followed by a shift of 3, which belongs to Stretches and compressions and Combining transformations and the general form.
- A translation never changes shape. A graph that is steeper, flatter or upside down compared with its parent cannot come from translations alone; see Reflecting a graph across the axes.
- A vertical shift leaves the domain alone and moves the range by k; a horizontal shift moves the domain by h and leaves the range alone. Graphing by transforming a parent graph uses this in full, with domains read from graphs.
Where this goes next
Translations are the first of the moves a parent graph can make. Reflections flip it and stretches pull it, and Combining transformations and the general form puts every move into the single form a\,f(b(x - h)) + k, where h and k keep exactly the meaning they have here. With that, Graphing by transforming a parent graph draws a graph by moving its parent, and Finding the rule of a transformed graph or table runs the anchor method backwards from any graph or table. The same x - h returns when the absolute value graph is moved, in the circle with center (h, k) when conics are translated, in the midline of a wave and in the phase shift of trigonometry. It even appears away from graphs: adding one number to every value of a data set moves its center by that number.
Exercises
Reading the move from the equation
Describe how each graph is moved from its parent graph.
- y = x^2 - 5
- \displaystyle y = \sqrt{x + 4}
- y = (x - 2)^3
- \displaystyle y = \frac{1}{x} + 3, and give its horizontal asymptote.
- \displaystyle y = \sqrt{x - 5} - 2
- \displaystyle y = \frac{1}{x + 2} + 7, and give its asymptotes.
Writing the equation
- Move y = x^3 up 2.
- Move \displaystyle y = \sqrt{x} left 5.
- Move \displaystyle y = \frac{1}{x} right 4 and down 1, and give the asymptotes of the result.
- Move y = x^2 right 2 and up 7, and give the vertex.
- Let f(x) = x^3 and g(x) = f(x + 2) - 3. Write g(x) as a formula in x and give the center of its graph.
Points, tables and graphs
Exercises 12 and 13 use this table of a function f.
| x | -2 | 0 | 2 | 4 |
|---|---|---|---|---|
| f(x) | 5 | 1 | -3 | 0 |
- Make a table of values for g(x) = f(x + 2), and say which way the graph moves.
- Let p(x) = f(x - 1) + 3. Find p(3) and p(5).
- The point (2, 8) lies on y = x^3. Where does it land on the graph of y = (x - 1)^3 + 5? Check with the formula.
Exercise 15 uses this figure.
- The figure shows the graph of \displaystyle y = \frac{1}{x} after a translation, with its asymptotes dashed. Name the translation and write the equation.
- The graph of \displaystyle y = \sqrt{x} is moved so that its starting point is (-3, -2). Write the equation, and find where the parent’s point (9, 3) lands.
- The graph of y = x^3 is translated so that its point (1, 1) lands on (-1, 5). Write the equation of the new graph and give its center.
On the water slide
Narges rides a shorter slide. Her height above the water t seconds after she sets off is N(t) meters:
| t | 0 | 1 | 2 | 3 |
|---|---|---|---|---|
| N(t) | 9 | 8 | 5 | 0 |
- Habib sets off down the same slide 2 seconds before Narges and rides exactly as she does. Counting t from Narges’s start, write Habib’s height B(t) in terms of N, find B(-2), B(0) and B(1), and say which way the graph moves.
- Eluned, the lifeguard, measures heights from the floor of the splash pool, 1 meter below the water’s surface. Write Narges’s height above the pool floor, F(t), in terms of N, find F(2), and say which way the graph moves.
Explaining
- Without plotting anything, explain why the graph of \displaystyle y = \sqrt{x - 8} begins at x = 8 and not at x = -8.
- Show that moving the line y = x up 2 gives the same graph as moving it left 2. Is the same true for y = x^2? Justify your answer.
- Use the center (0, 0) of y = x^3 to decide which way the graph of y = (x + 3)^3 is moved, and explain why a plus sign inside the brackets moves a graph the opposite way to a plus sign outside.
- Starting from any function f, show with formulas that moving its graph up 5 and then left 2 gives the same graph as moving it left 2 and then up 5.
- Ottilie says y = (x - 3)^2 and y = x^2 - 3 have the same graph, since both subtract 3. Find a point on one graph that is not on the other, and say what each subtraction does.
Answers
- Down 5. The rule is x^2 + (-5), so every output is 5 less and the vertex goes to (0, -5).
- Left 4. x + 4 = x - (-4), so h = -4, and the starting point goes to (-4, 0).
- Right 2. Here h = 2, so the center goes to (2, 0).
- Up 3. Every output of \displaystyle \frac{1}{x} grows by 3, so the horizontal asymptote becomes y = 3.
- Right 5 and down 2. The starting point goes from (0, 0) to (5, -2).
- Left 2 and up 7. The asymptotes are x = -2, where x + 2 = 0, and y = 7, since \displaystyle \frac{1}{x + 2} is never 0.
- y = x^3 + 2, since the 2 is added to every output.
- \displaystyle y = \sqrt{x + 5}. Left 5 means h = -5, and x - (-5) = x + 5.
- \displaystyle y = \frac{1}{x - 4} - 1, with asymptotes x = 4 and y = -1.
- y = (x - 2)^2 + 7, with vertex (2, 7).
- g(x) = (x + 2)^3 - 3. Here h = -2 and k = -3, so the center is (-2, -3).
- g reaches each output of f at an input 2 smaller: g(-4) = f(-2) = 5, g(-2) = f(0) = 1, g(0) = f(2) = -3 and g(2) = f(4) = 0. The graph moves 2 left.
- p(3) = f(2) + 3 = -3 + 3 = 0 and p(5) = f(4) + 3 = 0 + 3 = 3.
- (3, 13). Here h = 1 and k = 5, so (2, 8) goes to (2 + 1, 8 + 5). Check: (3 - 1)^3 + 5 = 8 + 5 = 13.
- Right 2 and up 1: the asymptotes now cross at (2, 1) instead of (0, 0). The equation is \displaystyle y = \frac{1}{x - 2} + 1. Check with the marked points: at x = 3, \displaystyle \frac{1}{1} + 1 = 2, and at x = 1, \displaystyle \frac{1}{-1} + 1 = 0.
- \displaystyle y = \sqrt{x + 3} - 2. The start moved 3 left and 2 down, so (9, 3) lands on (6, 1); check: \displaystyle \sqrt{6 + 3} - 2 = 1.
- h = -1 - 1 = -2 and k = 5 - 1 = 4, so y = (x + 2)^3 + 4, with center (-2, 4). Check: (-1 + 2)^3 + 4 = 5.
- B(t) = N(t + 2), since at time t Habib has been riding for t + 2 seconds. B(-2) = N(0) = 9, B(0) = N(2) = 5 and B(1) = N(3) = 0. The graph moves 2 left: everything happens 2 seconds sooner.
- F(t) = N(t) + 1, so F(2) = 5 + 1 = 6 meters. The graph moves up 1, and the times do not change.
- The square root needs x - 8 \geq 0, which holds exactly when x \geq 8. At x = 8 the inside is 0, the parent’s starting input; at x = -8 the inside is -16, which has no real square root.
- Up 2 gives y = x + 2. Left 2 replaces x by x + 2, which also gives y = x + 2: the same rule, so the same graph. For y = x^2 it fails: up 2 gives x^2 + 2, which is 2 at x = 0, while left 2 gives (x + 2)^2, which is 4 at x = 0.
- (x + 3)^3 = 0 when x = -3, so the center is (-3, 0) and the graph moved 3 left. A number outside is added after f has worked, so it raises every output. A number inside is added before f works, so the input must be that much smaller to hand f the same number, and every height arrives that much sooner, further left.
- Up 5 gives f(x) + 5; moving that left 2 replaces x by x + 2, giving f(x + 2) + 5. Left 2 first gives f(x + 2), and adding 5 gives f(x + 2) + 5. The rules agree, so the graphs agree: either way (a, b) goes to (a - 2, b + 5).
- (0, 9) is on y = (x - 3)^2, but y = x^2 - 3 gives -3 at x = 0. Subtracting 3 from the input moves the parabola right 3, to vertex (3, 0); subtracting 3 from the output moves it down 3, to vertex (0, -3).