Shift, stretch, flip
Tonight's idea
Every graph you meet this year is a few basic shapes (\(x^2\), \(|x|\), \(\sqrt{x}\), \(1/x\), \(\sin x\), \(2^x\)) slid, stretched or flipped.
Outside the function changes the output (vertical). \(y = f(x) + k\) lifts every point by \(k\). \(y = a\,f(x)\) multiplies every height by \(a\); if \(a \lt 0\) the graph flips as well.
Inside the function changes the input (horizontal), and it works backwards. Take \(y = f(x - 3)\). To get the output \(f(0)\) you now need \(x = 3\). Every feature appears 3 units later, so the graph moves right. Likewise \(y = f(2x)\) reaches \(f(4)\) already at \(x = 2\): everything happens twice as fast, so the graph is squashed horizontally by 2, not stretched.
Vertical changes do what they say. Horizontal changes do the opposite, because the input has to compensate.
Putting it together, \(y = a\,f\big(b(x - h)\big) + k\) with \(b \neq 0\): scale horizontally by \(1/|b|\) (flip left-right if \(b \lt 0\)), shift right \(h\), stretch vertically by \(a\) (flip if \(a \lt 0\)), lift by \(k\). Order matters: stretching after shifting also stretches the shift.
Watch one: two sketches from a formula
\(y = -2(x + 1)^2 + 3\) from \(y = x^2\). Inside: \(x + 1 = x - (-1)\), so shift left 1. Outside: stretch by 2, flip, lift by 3. The vertex goes to \((-1, 3)\) and the parabola opens downward, twice as steep.
\(y = \sqrt{2x - 6}\) from \(y = \sqrt{x}\). Trap: this is not a shift right by 6. Factor the inside: \(\sqrt{2(x - 3)}\). Squash horizontally by 2, then shift right 3. Check: \((0,0)\) on \(\sqrt x\) needs \(2x - 6 = 0\), so it lands at \((3, 0)\); \((4, 2)\) lands at \((5, 2)\), now 2 from the start instead of 4.
Move the sliders at mathdetours.com/demos/transform.html ; the original graph is shown faintly.
Your turn
- Describe in words (shift, stretch or flip, with amount and direction) how to get each graph from \(y = |x|\): \(y = |x - 2| + 1\); \(\;y = -3|x|\); \(\;y = |2x|\).
- The point \((2, 5)\) lies on \(y = f(x)\). Give the point it moves to on each of: \(y = f(x) - 3\); \(\;y = f(x + 4)\); \(\;y = f(2x)\); \(\;y = -f(x - 1) + 2\).
- Find the equation of the parabola with vertex \((3, -2)\) that passes through \((5, 6)\).
- Starting from \(f(x) = x^2\): (a) shift right 2, then stretch vertically by 3, then lift 1. (b) Shift right 2, lift 1, then stretch vertically by 3. Write both in the form \(a(x - h)^2 + k\) and explain the difference.
Stretch: when a horizontal move is secretly a vertical one
For \(f(x) = 2^x\), show that \(f(x + 1) = 2f(x)\): a horizontal shift is the same as a vertical stretch. For \(f(x) = \log_2 x\), show \(f(2x) = f(x) + 1\): a horizontal squash is a vertical shift. Which exponent law is each one?
Answers
- Shift right 2, up 1. Stretch vertically by 3 and flip. Squash horizontally by 2, though since \(|2x| = 2|x|\) it is the same picture as a vertical stretch by 2.
- \((2, 2)\); \((-2, 5)\); \((1, 5)\); \((3, -3)\).
- \(y = a(x - 3)^2 - 2\) with \(6 = 4a - 2\), so \(a = 2\): \(y = 2(x-3)^2 - 2\).
- (a) \(3(x - 2)^2 + 1\). (b) \(3\big((x-2)^2 + 1\big) = 3(x - 2)^2 + 3\). Stretching after lifting multiplies the lift too, so the vertex ends at \((2, 3)\) instead of \((2, 1)\).
Stretch. \(2^{x+1} = 2 \cdot 2^x\), which is \(2^{m+n} = 2^m 2^n\): sliding the graph left by 1 doubles every height. \(\log_2(2x) = \log_2 2 + \log_2 x = 1 + \log_2 x\), which is \(\log(xy) = \log x + \log y\): squashing horizontally by 2 (every horizontal length halves) lifts the graph by exactly 1. A stretch by 2 would be \(\log_2(x/2) = \log_2 x - 1\), a drop of 1. These two facts are the whole reason exponentials and logs behave as they do next sheet.