Graph transformations
A transformation moves or reshapes a graph without you having to plot it again from scratch. Learn six of them and you can sketch hundreds of graphs from the few you already know.
What you need first
- How to plot a simple graph such as y = x² from a table of values.
- Function notation. f(x) is a rule: you put a number x in, and one number comes out. For example, if f(x) = √x then f(9) = 3.
What you will be able to do
- Say what each of the six basic transformations does to a graph.
- Explain why f(x − 3) moves a graph right, not left.
- Follow a single point through several transformations.
The one idea behind all of them
There are only two places you can change a formula like y = f(x).
- Outside the function, after it has done its work. This changes the outputs, the y values, so the graph moves or stretches up and down. It does exactly what it looks like: adding 2 moves the graph up 2.
- Inside the function, before it does its work. This changes the inputs, the x values, so the graph moves or stretches left and right. It does the opposite of what it looks like: subtracting 3 moves the graph right 3.
The second point trips most people up. We will come back to why it happens once you have seen it.
Try it yourself
For each step, make a prediction before you move anything. Then check it.
Set the sliders to a = 1, b = 1, h = 0, k = 0. What do you expect the orange curve to do?
What you should see
It sits exactly on top of the blue one. With these values nothing has been changed yet. Come back to these values before each step below.
The slider k is added on the outside. Predict what k = 2 does, then try it.
What you should see
The whole curve moves up 2. Its starting point goes from (0, 0) to (0, 2). Every point keeps its x value and gains 2 in its y value.
Put k back to 0. The slider h is subtracted on the inside. Predict what h = 3 does.
What you should see
The curve moves 3 to the right. Its starting point is now (3, 0). The formula reads √(x − 3), with a minus, but the movement is in the positive direction.
Put h back to 0. The slider a multiplies on the outside. Predict what a = 2 does to the point (4, 2).
What you should see
It moves to (4, 4). Every point is now twice as far from the x-axis. The point (0, 0) stays where it is, because twice zero is still zero.
Now try a = −1.
What you should see
The curve flips upside down. Every y value has changed sign, so the graph is reflected in the x-axis.
Put a back to 1 and set b = −1. The slider b multiplies on the inside.
What you should see
The curve now goes to the left. It is √(−x), which only works when x is zero or negative. This is a reflection in the y-axis.
The six transformations
| Change to the formula | Where | What happens to the graph |
|---|---|---|
| y = f(x) + k | Outside | Moves up by k (down if k is negative) |
| y = f(x − h) | Inside | Moves right by h (left if h is negative) |
| y = a f(x) | Outside | Stretches away from the x-axis, scale factor a |
| y = f(bx) | Inside | Squashes towards the y-axis, scale factor 1/b |
| y = −f(x) | Outside | Reflects in the x-axis |
| y = f(−x) | Inside | Reflects in the y-axis |
A movement without any change of shape is called a translation. A stretch pulls the graph away from an axis. A reflection flips it over an axis like a mirror.
Why inside changes work backwards
Take y = √(x − 3). Suppose you want the output 2. The plain square root gives 2 when you feed it 4. But this formula subtracts 3 before taking the root, so to feed the root a 4 you must start with x = 7.
| Output wanted | x needed for √x | x needed for √(x − 3) |
|---|---|---|
| 0 | 0 | 3 |
| 1 | 1 | 4 |
| 2 | 4 | 7 |
| 3 | 9 | 12 |
Every x in the last column is 3 bigger. The formula takes 3 away, so you have to supply 3 extra to make up for it. That is why the graph sits 3 further to the right.
The same thinking explains y = f(2x). The input is doubled before the function sees it, so you only need half as much x to get the same output. The graph is squashed to half its width.
Worked example 1
Describe the transformations that turn y = √x into y = 2√(x − 3) + 1, and find where the point (4, 2) ends up.
- Look inside first. x has become x − 3. That is a translation 3 to the right.
- Then the multiplier outside. The root is multiplied by 2. That is a vertical stretch, scale factor 2.
- Then what is added outside. Adding 1 is a translation 1 up.
Now follow the point. Moving right 3 takes (4, 2) to (7, 2). Doubling the height gives (7, 4). Moving up 1 gives (7, 5).
Check by substituting x = 7: 2√(7 − 3) + 1 = 2 × 2 + 1 = 5. It works.
The order of steps 2 and 3 matters. Stretch then shift gives 2y + 1. Shift then stretch would give 2(y + 1), which is a different graph.
Worked example 2
Sketch y = (x + 2)² − 1 starting from y = x².
Inside the bracket, x has become x + 2. Inside changes work backwards, so this is 2 to the left. Outside, 1 is subtracted, so the graph moves 1 down.
The lowest point of y = x² is (0, 0). After moving it is at (−2, −1). The shape is unchanged, so draw the same U shape with its lowest point there.
Check yourself
Try each one on paper before you open the answer. Getting one wrong is useful: it shows you which part to reread.
What does y = f(x) + 5 do to the graph of y = f(x)?
Show the answer
It moves it up by 5. The change is outside, so it affects y and does what it says.
What does y = f(x + 4) do?
Show the answer
It moves it 4 to the left. The change is inside, so it affects x and works backwards.
The point (2, 3) is on y = f(x). Where is it on y = 3f(x)? And on y = f(2x)?
Show the answer
On y = 3f(x) it is at (2, 9): the height is tripled. On y = f(2x) it is at (1, 3): the x value is halved.
Common mistakes
- Saying f(x + 2) moves the graph right. It moves it left by 2.
- Calling f(2x) a stretch of factor 2. The factor is ½.
- Doing a vertical shift before a vertical stretch when the equation has them the other way round.
What to remember
- Outside changes affect y and do what they say.
- Inside changes affect x and do the opposite.
- To follow a point, apply one transformation at a time and write down where it is after each.