Sub topic 8
Combining Transformations in the Right Order
This chapter assumes you can already shift, stretch, compress, and reflect a graph one step at a time. It also assumes you can evaluate function notation, plot points, and recognize the parent graphs x, x², |x|, √x, and x³. Here you will combine those moves and learn why their order matters.
The general form
Every transformation from the earlier chapters fits into one template:
g(x) = a · f(b(x − h)) + k
| Parameter | Where it acts | Effect on the graph | Column | Column |
|---|---|---|---|---|
| a | outside f, on the output | vertical stretch by \ | a\ | ; reflection across the x-axis if a < 0 |
| k | outside f, on the output | vertical shift by k | ||
| b | inside f, on the input | horizontal compression by factor 1/\ | b\ | ; reflection across the y-axis if b < 0 |
| h | inside f, on the input | horizontal shift by h |
The template has a built-in order. When you evaluate g(x), the arithmetic happens from the inside out. Reading the graph transformations in the same order gives a reliable method.
Two groups that do not interfere
The parameters split into two groups:
- Input group (h and b): these change x before f sees it. They move points left and right.
- Output group (a and k): these change the value f returns. They move points up and down.
An input-group change and an output-group change never interact. Shifting right 3 and then stretching vertically by 2 gives the same graph as stretching first and then shifting. Order matters only inside a group.
Order inside the output group
Evaluating a · f(…) + k multiplies by a first and adds k second. To transform the graph, scale and reflect first, then shift.
Suppose you shift f up 3 and then stretch vertically by 2. The stretch also doubles the shift:
2 · (f(x) + 3) = 2f(x) + 6
The result is a·f(x) + k with a = 2 and k = 6, not k = 3. Both procedures are valid, but they give different graphs. Follow the template order (stretch first, then shift) and the numbers you read from the equation are the actual movements.
Order inside the input group
Evaluating f(b(x − h)) subtracts h first and multiplies by b second. The graph version runs the other way: stretch or reflect horizontally first, then shift.
Consider f(2x − 6). You can read the 6 as a shift of 6 only if the coefficient of x is 1. Factor out the coefficient first:
f(2x − 6) = f(2(x − 3))
So b = 2 and h = 3. The graph is compressed horizontally by a factor of 1/2 and shifted right 3, not right 6.
The same trap appears with a reflection. For f(4 − x), factor out −1:
f(4 − x) = f(−(x − 4))
So b = −1 and h = 4. The graph is reflected across the y-axis and shifted right 4. It is not shifted left.
The full procedure
Use these five steps to build the graph of g from the parent f. Steps 1 and 2 belong to the input group. Steps 3 and 4 belong to the output group. Step 5 is a check.
- Factor the input into b(x − h), and read b and h.
- Apply the horizontal stretch, compression, or reflection from b. Then apply the horizontal shift h.
- Apply the vertical stretch, compression, or reflection from a.
- Apply the vertical shift k.
- Check one or two points by substituting into g.
The two groups commute, so you may do the vertical steps before the horizontal ones. Within each group, keep the scale step before the shift step.
Worked example 1: a square root
Take f(x) = √x and g(x) = −2√(3x − 6) + 1.
First factor the input: 3x − 6 = 3(x − 2). So g(x) = −2 · f(3(x − 2)) + 1, which gives a = −2, b = 3, h = 2, and k = 1.
Now describe the graph in order:
- Compress horizontally by a factor of 1/3 (b = 3).
- Shift right 2 (h = 2).
- Stretch vertically by 2 and reflect across the x-axis (a = −2).
- Shift up 1 (k = 1).
Track the key points of √x with the mapping rule (x, y) → (x/b + h, a·y + k). Dividing by b undoes the input scaling, and h and k move the point afterward.
| Point on f | x/3 + 2 | −2y + 1 | Point on g |
|---|---|---|---|
| (0, 0) | 2 | 1 | (2, 1) |
| (1, 1) | 7/3 | −1 | (7/3, −1) |
| (4, 2) | 10/3 | −3 | (10/3, −3) |
| (9, 3) | 5 | −5 | (5, −5) |
Check one point directly: g(5) = −2√(15 − 6) + 1 = −2 · 3 + 1 = −5. It matches.
The graph starts at (2, 1) and falls to the right. The domain is x ≥ 2 and the range is y ≤ 1.
Checking the order with code
The function below applies the five operations one at a time and compares the result with the one-line formula.
import math
f = math.sqrt
a, b, h, k = -2, 3, 2, 1
def g(x):
return a * f(b * (x - h)) + k
def step_by_step(x):
u = x - h # 1. subtract h from the input
u = b * u # 2. scale the input by b
y = f(u) # 3. apply the parent function
y = a * y # 4. scale the output by a
return y + k # 5. add k
for x in [2, 7 / 3, 10 / 3, 5]:
print(round(x, 3), round(g(x), 6), round(step_by_step(x), 6))Expected output:
2 1.0 1.0
2.333 -1.0 -1.0
3.333 -3.0 -3.0
5 -5.0 -5.0The y-values agree with the table. The x-values are the mapped points from the table, so the code confirms the mapping rule.
Worked example 2: a reflection with a shift
Let f(x) = √x and g(x) = √(4 − x).
Factor the input: 4 − x = −(x − 4). So b = −1 and h = 4.
The graph reflects across the y-axis, so the curve heads left from the origin. It then shifts right 4, so the starting point lands at (4, 0). Applying (x, y) → (x/b + h, y) gives:
| Point on f | x/(−1) + 4 | Point on g |
|---|---|---|
| (0, 0) | 4 | (4, 0) |
| (1, 1) | 3 | (3, 1) |
| (4, 2) | 0 | (0, 2) |
Check: g(0) = √4 = 2, which matches (0, 2).
If you wrongly read 4 − x as "shift left 4", you would put the starting point at (−4, 0), and g(−4) = √8 does not equal 0.
Common errors
- Reading a shift before factoring. In f(2x + 8), the shift is 4 units left, not 8.
- Shifting before stretching. If a problem says "shift up 3, then stretch by 2", the final k is 6. If you write 2f(x) + 3, you have changed the order.
- Treating the horizontal factor like the vertical one. A factor of 2 inside f compresses the graph toward the y-axis. A factor of 2 outside f stretches it away from the x-axis.
- Forgetting that a negative b reverses direction. A shift described as "right 4" is only right 4 after the reflection is factored out.
- Skipping the point check. One substitution into g catches most sign and order mistakes.
Exercises
Exercise
Let g(x) = 3 · f(½x + 1). Factor the input, then state the transformations in order. Where does the point (4, 5) on f go?
Show answer
Factor ½x + 1 = ½(x + 2), so b = ½ and h = −2. The graph is stretched horizontally by a factor of 2, shifted left 2, and stretched vertically by 3. The mapping rule gives (x/b + h, a·y + k) = (4/½ − 2, 3·5) = (6, 15). Check: g(6) = 3f(3 + 1) = 3f(4) = 15.
Exercise
Write an equation for the graph of f reflected across the x-axis, compressed vertically by a factor of ½, shifted left 1, and shifted down 3.
Show answer
The vertical scale is a = −½, the horizontal shift is h = −1 (so the input is x + 1), and k = −3. The equation is g(x) = −½ · f(x + 1) − 3. The scale and reflection are applied before the −3, so −3 is not halved.
Exercise
Explain how y = −f(x) + 2 differs from y = −(f(x) + 2). Which one moves the graph up?
Show answer
In −f(x) + 2, the graph is reflected across the x-axis first and then shifted up 2. In −(f(x) + 2), f is shifted up 2 first and then reflected, which is the same as −f(x) − 2, so the graph ends up shifted down 2. Only −f(x) + 2 moves the reflected graph up.