Transforming Graphs

Outside the bracket moves it the way you expect.

Start from y = x²

Take f(x) = x², whose graph is the parabola y = x². Its lowest point, the vertex, is at the origin, (0, 0), and it passes through (1, 1), (2, 4) and (3, 9), and through (−1, 1), (−2, 4) and (−3, 9).

Changing the equation of a graph in a simple way moves the graph, or changes its shape. To see what a change does, follow the points: where does each point of y = x² end up?

A change outside the bracket

Add 3 to the function: y = f(x) + 3, which is y = x² + 3. The 3 is added after the squaring is done, so it changes the output and not the input. At every x, the new y is 3 more than before: (1, 1) moves to (1, 4), (2, 4) moves to (2, 7), and the vertex (0, 0) moves to (0, 3).

Every point moves 3 straight up, so the whole graph moves up 3 without changing its shape. A move like this, where every point slides the same distance in the same direction, is called a translation. In general, y = f(x) + a is the graph of y = f(x) moved up by a. When a is negative the move is down: y = x² − 4 has its vertex at (0, −4).

y = x² + 3

The dashed curve is y = x² and the gold curve is y = x² + 3. Each arrow moves a point 3 straight up.

A change inside the bracket

Now put the 3 inside the bracket: y = f(x − 3), which is y = (x − 3)². The 3 is subtracted before the squaring, so it changes the input. Work out some values. At x = 3, y = (3 − 3)² = 0. At x = 4, y = (4 − 3)² = 1, and at x = 5, y = (5 − 3)² = 4. On the other side, x = 2 gives (−1)² = 1 and x = 1 gives (−2)² = 4.

Compare these with y = x². The old graph reached the height 0 at x = 0; the new one reaches it at x = 3. The old graph reached the height 4 at x = 2 and at x = −2; the new one reaches it at x = 5 and at x = 1. Every height is reached 3 later, at an x that is 3 bigger. So the whole graph has moved 3 to the right, even though the bracket holds a minus sign. The vertex is at (3, 0).

The reason is that the square receives x − 3, which is always 3 less than x. For the square to receive any value it received before, x has to be 3 bigger than it was.

y = (x − 3)²

The dashed curve is y = x² and the gold curve is y = (x − 3)². Each arrow moves a point 3 to the right.

A plus sign inside moves the graph left

Now take y = f(x + 2), which is y = (x + 2)². Here the square receives x + 2, which is always 2 more than x. At x = −2 the square receives 0, and y = 0. y = x² had to wait until x = 0 for that. At x = 0 the square receives 2, and y = 4. y = x² reached 4 only at x = 2.

So the new graph reaches every height 2 earlier, at an x that is 2 smaller, and the whole graph lies 2 to the left. Its vertex is at (−2, 0).

The same argument works for any function f and any number a. Suppose (p, q) is on the graph of y = f(x), so f(p) = q. On y = f(x + a), put in x = p − a: the bracket holds (p − a) + a = p, so y = f(p) = q. So the point (p − a, q) is on the new graph: every point has moved a to the left. A number added inside the bracket moves the graph left by that amount, and a number subtracted inside the bracket moves it right.

y = (x + 2)²

The dashed curve is y = x² and the gold curve is y = (x + 2)². Each arrow moves a point 2 to the left, and the vertex is at (−2, 0).

−3−2−1123x − c = 0x = 1

the peak is where the input x − c is 0, so it sits at x = c: the graph moved RIGHT by 1

Set c = 3 and find where the peak lands

The faint curve is a function y = f(x) with its peak at x = 0, and the gold curve is y = f(x − c), here with c = 1. The peak of the gold curve is where the input x − c is 0, which is at x = c. Drag c to 3 and the peak moves to x = 3, to the right. Drag c below 0, to −2, and the peak moves to x = −2, to the left: then x − c is x − (−2) = x + 2.

Two changes together

Take y = (x − 3)² + 2. The change inside the bracket moves y = x² 3 to the right, and the change outside moves it 2 up. So the vertex moves from (0, 0) to (3, 2).

Check with one more point. (1, 1) is on y = x². Moved 3 right and 2 up, it goes to (4, 3). On the new graph, x = 4 gives (4 − 3)² + 2 = 1 + 2 = 3, so (4, 3) is on it.

This is the vertex form of a quadratic. Completing the square writes x² − 6x + 11 as (x − 3)² + 2, since (x − 3)² + 2 = x² − 6x + 9 + 2. So the graph of y = x² − 6x + 11 is the graph of y = x² moved 3 right and 2 up.

The rules hold for every function, not only x². The graph of y = |x + 1| is the V of y = |x| moved 1 to the left, with its corner at (−1, 0).

xy

The white curve is y = x², with its vertex at (0, 0) and the point (1, 1). The gold curve is y = (x − 3)² + 2: its vertex is at (3, 2), and (1, 1) has moved to (4, 3).

The usual mistakes

Reading the sign inside the bracket at face value. y = (x − 3)² does not move 3 to the left. Its vertex is where x − 3 = 0, at x = 3, so the graph moves 3 to the right.

Putting the vertex of y = (x + 2)² at (2, 0). There the bracket holds 4, and y = 16. The vertex is where x + 2 = 0, at (−2, 0).

Mixing up the two directions. A number outside the function, as in x² + 3, changes every height and moves the graph up or down. A number inside the bracket changes the input and moves the graph left or right.

Multiplying the whole function

A third kind of change multiplies the whole function. In y = kf(x), every output of f is multiplied by k. At each x the height is k times what it was, so a point (p, q) moves to (p, kq): it stays above the same x, and only its height changes. For y = 0.6f(x), every height becomes 0.6 of what it was, so the point (2, 10) moves to (2, 0.6 × 10) = (2, 6), and, since 0.6 is positive, the highest point is still the highest point, above the same x. This is called a vertical stretch.

Worked example: Visitors to a Swimming Pool on a Late Opening and on a Rainy Day: A Shift and a Stretch of One Graph

Question On a normal day the number of people in a swimming pool x hours after 8 a.m. is f(x) = 5x(8 − x), for 0 ≤ x ≤ 8. (a) In the school holidays the pool opens 2 hours later and the day follows the same pattern, so the number of people is f(x − 2). Find the greatest number of people and the time at which it is reached. (b) On a rainy day the pool opens at 8 a.m. as usual, but at every moment only 60% as many people are there. Write this function in terms of f, and find the greatest number of people.

  1. 1.First find the peak of a normal day. f(x) = 5x(8 − x) is zero at x = 0 and at x = 8, so the axis of symmetry is x = 4, and f(4) = 5 × 4 × 4 = 80. The pool is fullest at 12 noon, with 80 people.

    0204060800246810hours after 8 a.m., xpeople in the pool(4, 80)f is zero at 0 and at 8: the axis is x = 4f(4) = 5 × 4 × 4 = 80 people, at 12 noon
    0204060800246810hours after 8 a.m., xpeople in the pool(4, 80)f is zero at 0 and at 8: the axis is x = 4f(4) = 5 × 4 × 4 = 80 people, at 12 noon
    The normal day peaks halfway between its zeros, at x = 4, with f(4) = 80 people.
  2. 2.The graph of y = f(x − 2) is the graph of y = f(x) moved 2 units to the right, because the new function needs an input that is 2 larger to give the same output. The turning point (4, 80) moves to (6, 80).

    0204060800246810hours after 8 a.m., xpeople in the pool(4, 80)y = f(x − 2): the graph moves 2 to the right(4, 80) moves to (6, 80)
    0204060800246810hours after 8 a.m., xpeople in the pool(4, 80)y = f(x − 2): the graph moves 2 to the right(4, 80) moves to (6, 80)
    y = f(x − 2) is the same graph moved 2 units to the right, so the turning point moves from (4, 80) to (6, 80).
  3. 3.(a) The greatest number is still 80 people, and it is reached at x = 6, which is 2 p.m. Check: f(6 − 2) = f(4) = 80.

    0204060800246810hours after 8 a.m., xpeople in the pool(6, 80)80 people at x = 6, which is 2 p.m.check: f(6 − 2) = f(4) = 80
    0204060800246810hours after 8 a.m., xpeople in the pool(6, 80)80 people at x = 6, which is 2 p.m.check: f(6 − 2) = f(4) = 80
    (a) The greatest number is still 80, reached at x = 6, which is 2 p.m.
  4. 4.On the rainy day every output is multiplied by 0.6, so the function is 0.6f(x). This is a vertical stretch with scale factor 0.6: every point stays above the same value of x and moves to 0.6 of its height.

    0204060800246810hours after 8 a.m., xpeople in the pool(6, 80)rainy day: y = 0.6 f(x)every height is multiplied by 0.6
    0204060800246810hours after 8 a.m., xpeople in the pool(6, 80)rainy day: y = 0.6 f(x)every height is multiplied by 0.6
    The rainy day is y = 0.6f(x), a vertical stretch with scale factor 0.6: every point keeps its x and moves to 0.6 of its height.
  5. 5.(b) The turning point (4, 80) moves to (4, 0.6 × 80) = (4, 48). The greatest number is 48 people, still at 12 noon.

    0204060800246810hours after 8 a.m., xpeople in the pool(6, 80)48(4, 80) moves to (4, 0.6 × 80) = (4, 48)48 people, still at 12 noon
    0204060800246810hours after 8 a.m., xpeople in the pool(6, 80)48(4, 80) moves to (4, 0.6 × 80) = (4, 48)48 people, still at 12 noon
    (b) The turning point moves to (4, 48): 48 people, still at 12 noon.

Answer: (a) 80 people at x = 6, which is 2 p.m.; (b) 0.6f(x); 48 people, at 12 noon

Common mistakes

  • Taking f(x − 2) to move the graph 2 units to the left because of the minus sign, which would put the peak at 10 a.m. on a day when the pool opens at 10 a.m. With x − 2 in the bracket the input must be 2 larger to give the same output, so every point moves to the right.
  • Writing the rainy day as f(0.6x). A number inside the bracket changes the input and stretches the graph sideways, so the peak would still be 80. Fewer people at the same times is a change to the output, 0.6f(x).

More functions problems, worked step by step →

Practice Transforming Graphs in the app