Graphing by transforming a parent graph
Given a rule like y = 2(x + 3)^2 + 1, how do you draw its whole graph without plotting dozens of points, and which inputs and outputs does it have?
Where you are 7 in Transformations of functions
When you reach for it
You have a rule such as y = 2(x + 3)^2 + 1 and need its graph. Plotting it point by point takes many evaluations and still leaves you guessing at the shape between them. But the rule is a moved copy of a parent you already know, y = x^2, so its graph is a moved copy too. Move a handful of the parent’s points and its key features, then draw the parent’s shape through them.
The same view answers a second question: which inputs does the rule accept, and which outputs does it give? The domain and range of a moved graph are the parent’s, moved.
The lesson is taught in two parts. Part 1 draws the graph; Part 2 finds the domain and range.
The procedure
Part 1: from the parent to the new graph
Write the rule in the general form from Combining transformations and the general form,
factoring the inside first if it is not yet b(x - h), and read off a, b, h and k. Every point (p, q) of the parent lands at
Every point of the parent moves by this one rule, so the graph moves as a single piece: the carried points fix where it is, and between them the curve keeps the parent’s shape, stretched. That is why a few well-chosen points are enough.
Which points? The parent’s anchor and two or three more, chosen so the arithmetic is easy. The parents themselves are in The squaring and cubing functions and The square root and reciprocal functions.
| Parent | Anchor | Easy points |
|---|---|---|
| y = x^2 | vertex (0, 0) | (\pm 1, 1), (\pm 2, 4) |
| y = x^3 | center (0, 0) | (1, 1), (-1, -1), (2, 8), (-2, -8) |
| \displaystyle y = \sqrt{x} | endpoint (0, 0) | (1, 1), (4, 2), (9, 3) |
| \displaystyle y = \frac{1}{x} | asymptotes x = 0 and y = 0 | (1, 1), \displaystyle \left(2, \frac{1}{2}\right), (-1, -1), \displaystyle \left(-2, -\frac{1}{2}\right) |
The anchor (0, 0) goes to \displaystyle \left(\frac{0}{b} + h,\ a \cdot 0 + k\right) = (h, k), so the new vertex, center or endpoint is (h, k), read straight off the rule. The asymptotes of \displaystyle \frac{1}{x} move as whole lines. The line x = 0 is every point with x-coordinate 0, and 0 goes to \displaystyle \frac{0}{b} + h = h: the line x = h. The line y = 0 is every point of height 0, and 0 goes to a \cdot 0 + k = k: the line y = k. So only the shifts move an asymptote; a stretch leaves both where they were.
Before joining the points, decide which way the graph faces: a negative a turns it upside down, and a negative b turns it left for right. Then draw the parent’s shape through the points and test one of them in the rule.
Part 2: where the domain and range go
The domain is a set of x-values, so only b and h can move it. The range is a set of y-values, so only a and k can move it. Precisely: x is an allowed input of g(x) = a\,f\big(b(x - h)\big) + k exactly when b(x - h) is an allowed input p of f, that is, when \displaystyle x = \frac{p}{b} + h. And the outputs of g are the numbers aq + k with q an output of f. So
with p running over the domain of f and q over its range.
In practice, carry the ends of each interval in Interval and set-builder notation. Each move keeps the order of numbers or reverses all of it, so an end stays an end. An included end stays included, an excluded value stays excluded (the gap at 0 in the domain and range of \displaystyle \frac{1}{x} moves to h and k, with the asymptotes), and an infinite end stays infinite. Multiplying by a negative number reverses order, so a negative a swaps the range’s lower and upper ends, and a negative b swaps the domain’s.
| Parent | Domain becomes | Range becomes |
|---|---|---|
| y = x^2 | (-\infty, \infty), unchanged | [k, \infty) if a > 0; (-\infty, k] if a < 0 |
| y = x^3 | (-\infty, \infty), unchanged | (-\infty, \infty), unchanged |
| \displaystyle y = \sqrt{x} | [h, \infty) if b > 0; (-\infty, h] if b < 0 | [k, \infty) if a > 0; (-\infty, k] if a < 0 |
| \displaystyle y = \frac{1}{x} | every number except h | every number except k |
Every row comes from the two rules above, so there is nothing here to memorize. Reading the domain and range off the finished drawing, as in Domain and range from a graph, makes a good check.
Worked examples
Examples 1 to 3 belong to Part 1, drawing the graph. Examples 4 to 7 belong to Part 2, the domain and range.
A stretched and shifted parabola
Graph y = 2(x + 3)^2 + 1 by moving y = x^2.
SolutionThe rule is already in the general form, with a = 2, b = 1, h = -3, k = 1 (the x + 3 is x - (-3)). The moves: shift left 3; stretch vertically by 2, then shift up 1. Each point goes to (p - 3,\ 2q + 1):
| Parent point | x: subtract 3 | y: times 2, then add 1 | Image |
|---|---|---|---|
| (-2, 4) | -5 | 9 | (-5, 9) |
| (-1, 1) | -4 | 3 | (-4, 3) |
| (0, 0) | -3 | 1 | (-3, 1) |
| (1, 1) | -2 | 3 | (-2, 3) |
| (2, 4) | -1 | 9 | (-1, 9) |
The vertex is (h, k) = (-3, 1). Since a > 0 the parabola still opens upward, and since a = 2 it is narrower: one step either side of the vertex climbs 2, not 1. Join the five points with a parabola whose axis is the line x = -3. Check: 2(-1 + 3)^2 + 1 = 9. This is vertex form, read as a list of moves.
The reciprocal, asymptotes first
Graph \displaystyle y = \frac{4}{x - 6} + 1 by moving \displaystyle y = \frac{1}{x}.
SolutionSince \displaystyle \frac{4}{x - 6} = 4 \cdot \frac{1}{x - 6}, the numbers are a = 4, b = 1, h = 6, k = 1. Draw the asymptotes first, dashed: x = 0 moves right 6 to x = 6, and y = 0 moves up 1 to y = 1. They cross at (h, k) = (6, 1), the new center. Then each point goes to (p + 6,\ 4q + 1):
With a > 0 there is no flip, so the branches sit up and to the right of the center and down and to the left, as the parent’s sit around the origin, each bending toward both asymptotes without reaching them. The stretch pulls them away from the center: the parent passes 1 across and 1 up from its center, at (1, 1); the new graph passes 1 across and 4 up, at (7, 5). Check: \displaystyle \frac{4}{2 - 6} + 1 = 0, so the graph crosses the x-axis at (2, 0).
A cubic with a factor inside
Graph \displaystyle y = \left(\frac{1}{2}x - 3\right)^3 - 5 by moving y = x^3.
SolutionThe inside is not yet b(x - h), so factor out the \displaystyle \frac{1}{2}: \displaystyle \frac{1}{2}x - 3 = \frac{1}{2}(x - 6). So a = 1, \displaystyle b = \frac{1}{2}, h = 6, k = -5. Dividing by \displaystyle b = \frac{1}{2} doubles each x: a horizontal stretch by 2, then a shift right 6; and a shift down 5. Each point goes to (2p + 6,\ q - 5):
The center is (6, -5). The curve rises from left to right like the parent, but is spread twice as wide. Check: \displaystyle \left(\frac{1}{2} \cdot 10 - 3\right)^3 - 5 = 8 - 5 = 3.
The same graph has a second description. Since \displaystyle \left(\frac{1}{2}(x - 6)\right)^3 = \frac{1}{8}(x - 6)^3, the rule is also \displaystyle y = \frac{1}{8}(x - 6)^3 - 5, a vertical compression by \displaystyle \frac{1}{8}. The points agree: \displaystyle \frac{1}{8}(10 - 6)^3 - 5 = 8 - 5 = 3. Either description draws the same curve.
The domain and range of a square root
Find the domain and range of \displaystyle y = -\frac{1}{2}\sqrt{x + 3} + 1, and sketch it.
SolutionHere \displaystyle a = -\frac{1}{2}, b = 1, h = -3, k = 1.
Domain. The parent’s domain is [0, \infty). Only the shift left 3 acts on x, so the end 0 moves to -3, and the domain is [-3, \infty). The rule agrees: \displaystyle \sqrt{x + 3} needs x + 3 \ge 0, that is, x \ge -3.
Range. The parent’s range is [0, \infty). Multiplying by \displaystyle -\frac{1}{2} keeps 0 at 0 and turns every positive height negative; and every w \le 0 is reached, from q = -2w \ge 0. So the range becomes (-\infty, 0]: the ends swapped because a < 0. Adding 1 gives (-\infty, 1].
To sketch, the points (0, 0), (1, 1), (4, 2) and (9, 3) go to \displaystyle \left(p - 3,\ -\frac{q}{2} + 1\right), giving (-3, 1), \displaystyle \left(-2, \frac{1}{2}\right), (1, 0) and \displaystyle \left(6, -\frac{1}{2}\right). The curve starts at the endpoint and runs right and down.
When the domain turns round
Find the domain and range of \displaystyle y = 2\sqrt{6 - x} - 5.
SolutionFactor the inside: 6 - x = -(x - 6), so a = 2, b = -1, h = 6, k = -5.
Domain. Each p in the parent’s domain goes to \displaystyle \frac{p}{-1} + 6 = 6 - p. The end p = 0 goes to 6, and as p grows, 6 - p shrinks. So the domain is (-\infty, 6]: the negative b swapped the ends. Directly, 6 - x \ge 0 exactly when x \le 6.
Range. Each height q \ge 0 becomes 2q - 5 \ge -5, and every w \ge -5 is reached, from \displaystyle q = \frac{w + 5}{2}. The range is [-5, \infty).
The graph starts at (6, -5) and runs to the left, rising: (4, 2) \mapsto (2, -1) and (9, 3) \mapsto (-3, 1). Check: \displaystyle 2\sqrt{6 - (-3)} - 5 = 6 - 5 = 1.
Gaps that move with the asymptotes
Find the domain and range of \displaystyle y = -\frac{1}{2(x + 3)} - 5.
SolutionWrite it as \displaystyle y = -\frac{1}{2} \cdot \frac{1}{x + 3} - 5, so \displaystyle a = -\frac{1}{2}, b = 1, h = -3, k = -5. The parent \displaystyle \frac{1}{x} accepts every input except 0 and gives every output except 0.
Domain. The shift left 3 moves the excluded input 0 to -3. The domain is every number except -3, that is, (-\infty, -3) \cup (-3, \infty).
Range. Multiplying by \displaystyle -\frac{1}{2} sends nonzero numbers to nonzero numbers, and every nonzero w is reached, from q = -2w. So after the stretch and flip the one missing output is still 0, and the shift down 5 moves it to -5. The range is (-\infty, -5) \cup (-5, \infty).
The two gaps are the asymptotes x = -3 and y = -5. To confirm that every other output occurs, solve for x:
which gives an x for every y except -5. For y = -4 it gives \displaystyle x = -\frac{7}{2}, and indeed \displaystyle -\frac{1}{2\left(-\frac{1}{2}\right)} - 5 = 1 - 5 = -4.
A shell’s flight, delayed and slowed
Tiago fires a firework shell from a tube on a pier. Its height is f(t) meters above the tube, t seconds after launch, and it climbs the whole time until it bursts at t = 4, 72 meters up. So f has domain [0, 4] and range [0, 72].
(a) Oluwaseun fires an identical shell 6 seconds later from the beach, 5 meters below Tiago’s tube. On Tiago’s clock and measured from his tube, its height is g(t) = f(t - 6) - 5. Find the domain and range of g.
(b) Venkat films Tiago’s shell and plays it back at half speed, so t seconds into the replay shows the moment \displaystyle \frac{t}{2} seconds after launch. The height on screen is \displaystyle v(t) = f\left(\frac{t}{2}\right). Find the domain and range of v.
Solution(a) Here h = 6 and k = -5. The domain moves right 6, to [6, 10]: launch at t = 6, burst at t = 10. The range moves down 5, to [-5, 67]. The shell starts below Tiago’s tube, a negative height on his scale, and bursts 67 meters above it, which is still 72 meters above its own tube.
(b) Here \displaystyle b = \frac{1}{2}, so each time p goes to \displaystyle \frac{p}{1/2} = 2p and the domain stretches to [0, 8]. Nothing acts on the height, so the range stays [0, 72]: the replay takes twice as long but climbs no higher. Check: v(8) = f(4) = 72.
Boundaries
- a and b must not be 0. With a = 0 the rule is the flat line y = k, whose range is the single number k, and nothing of the parent is left to move. With b = 0 every input is fed the same number 0, so the graph is flat again (or, for \displaystyle \frac{1}{x}, defined nowhere), and the point rule \displaystyle \frac{p}{b} would divide by zero.
- The method needs a rule that is a moved parent. A rule such as \displaystyle y = \sqrt{x} + x cannot be written as a\,f\big(b(x - h)\big) + k for any parent here, and is graphed some other way.
- The carried points are exact; the curve between them is right only because the whole parent moves with them. An asymptote is never reached, however far the branches run.
- The domain and range found from a rule are the ones the formula allows. A context can cut them further: a shell’s height means nothing before launch, so its domain is chosen, and that chosen domain is carried like any other.
Where this goes next
Each parent now gets its own lesson: Vertex form: reading, converting and graphing, Graphing square root functions, Transforming the reciprocal graph (where both asymptotes move) and Transforming the absolute value graph, where the corner of the V goes to (h, k) just as a vertex does here. In Transforming an exponential graph the same rules move a horizontal asymptote and the range with it, and Graphs of logarithmic functions does the same for a vertical one. Finding the rule of a transformed graph runs this lesson backwards, from a drawn graph to a, b, h and k.
Exercises
Part 1: drawing the graph
For each rule, name the parent, give the new anchor (vertex, center, endpoint or both asymptotes), and carry the parent points named.
- y = (x - 4)^2 - 3; carry (\pm 1, 1) and (\pm 2, 4).
- \displaystyle y = -3\sqrt{x + 2}; carry (1, 1), (4, 2) and (9, 3).
- \displaystyle y = \frac{2}{x + 1} - 4; carry (1, 1), \displaystyle \left(2, \frac{1}{2}\right), (-1, -1) and \displaystyle \left(-2, -\frac{1}{2}\right).
- \displaystyle y = \frac{1}{3}(x - 2)^3 + 4; carry (3, 27) and (-3, -27).
- y = (3x + 12)^2 - 1; carry (3, 9) and (-3, 9).
- \displaystyle y = -\frac{1}{x - 5}; carry (1, 1) and (-1, -1), and say where the branches sit around the center.
- \displaystyle y = \sqrt{-x} + 3; carry (1, 1), (4, 2) and (9, 3), and say which way the graph runs.
Part 2: domain and range from a rule
Give the domain and range in interval notation.
- \displaystyle y = \sqrt{x - 7} + 2
- \displaystyle y = -2\sqrt{x + 1} + 3
- \displaystyle y = \sqrt{5 - x} - 1
- y = -3(x - 1)^2 + 8
- \displaystyle y = \frac{1}{x - 2} + 7
- y = 5(x + 4)^3 - 6
Part 2: a moved function
A function f has domain [-2, 5] and range [1, 4]. Give the domain and range of each.
- g(x) = -2\,f(x + 1) - 3
- m(x) = f(2x) + 1
- n(x) = f(-x)
Part 2: fireworks
Zuberi’s shell climbs the whole time from launch to its burst. Its height is H(t) meters above its tube, t seconds after launch, with domain [0, 5] and range [0, 90].
- Yesenia fires an identical shell 3 seconds later from a hill 12 meters above Zuberi’s tube. Write its height S(t) on Zuberi’s clock and measured from his tube, and give the domain and range of S.
- A replay of Zuberi’s shell runs at a quarter of normal speed. Write the height R(t) shown t seconds into the replay, and give its domain and range.
Reasoning
- Explain why a and k can never change the domain of y = a\,f\big(b(x - h)\big) + k, and why b and h can never change its range.
- A vertical stretch by 3 leaves the range of \displaystyle y = \sqrt{x} as [0, \infty), but turns a range of [0, 2] into [0, 6]. Explain both.
- Show, by solving for x, that \displaystyle y = \frac{a}{x - h} + k with a \ne 0 takes every value except k.
- Oluwaseun says the range of \displaystyle y = -\sqrt{x} + 4 is [4, \infty), because the endpoint is at height 4. Find a point of the graph that shows this is wrong, and give the correct range.
Answers
- Parent x^2; vertex (4, -3). Points go to (p + 4,\ q - 3): (5, -2), (3, -2), (6, 1), (2, 1). Check: (6 - 4)^2 - 3 = 1.
- Parent \displaystyle \sqrt{x}; endpoint (-2, 0). Points go to (p - 2,\ -3q): (-1, -3), (2, -6), (7, -9). The graph runs right and down. Check: \displaystyle -3\sqrt{7 + 2} = -9.
- Parent \displaystyle \frac{1}{x}; asymptotes x = -1 and y = -4. Points go to (p - 1,\ 2q - 4): (0, -2), (1, -3), (-2, -6), (-3, -5). Check: \displaystyle \frac{2}{-3 + 1} - 4 = -5.
- Parent x^3; center (2, 4). Points go to \displaystyle \left(p + 2,\ \frac{q}{3} + 4\right): (5, 13) and (-1, -5). Check: \displaystyle \frac{1}{3}(5 - 2)^3 + 4 = 13.
- Parent x^2; 3x + 12 = 3(x + 4), so b = 3, h = -4, k = -1, and the vertex is (-4, -1). Points go to \displaystyle \left(\frac{p}{3} - 4,\ q - 1\right): (-3, 8) and (-5, 8). Check: (3(-3) + 12)^2 - 1 = 8.
- Parent \displaystyle \frac{1}{x}; asymptotes x = 5 and y = 0. Points go to (p + 5,\ -q): (6, -1) and (4, 1). With a = -1 the branches sit up and to the left of the center (5, 0) and down and to the right.
- Parent \displaystyle \sqrt{x}; endpoint (0, 3). Here b = -1, so points go to (-p,\ q + 3): (-1, 4), (-4, 5), (-9, 6). The graph runs to the left, rising.
- Domain [7, \infty), range [2, \infty). The endpoint is (7, 2), and nothing flips.
- Domain [-1, \infty), range (-\infty, 3]. Endpoint (-1, 3); a < 0 swaps the range’s ends.
- Domain (-\infty, 5], range [-1, \infty). Here 5 - x = -(x - 5), so b < 0 swaps the domain’s ends.
- Domain (-\infty, \infty), range (-\infty, 8]. The vertex (1, 8) is the highest point, since a < 0.
- Domain (-\infty, 2) \cup (2, \infty), range (-\infty, 7) \cup (7, \infty). The gaps are the asymptotes x = 2 and y = 7.
- Domain (-\infty, \infty), range (-\infty, \infty). Shifts and a stretch do not change “every number”.
- Domain [-3, 4], range [-11, -5]. x: subtract 1 from each end. y: 1 \mapsto -5 and 4 \mapsto -11; a < 0 swaps the ends.
- Domain \displaystyle \left[-1, \frac{5}{2}\right], range [2, 5]. x: divide each end by 2. y: add 1.
- Domain [-5, 2], range [1, 4]. x: negate each end, which swaps them. The heights do not change.
- S(t) = H(t - 3) + 12, domain [3, 8], range [12, 102].
- \displaystyle R(t) = H\left(\frac{t}{4}\right), domain [0, 20], range [0, 90]. Here \displaystyle b = \frac{1}{4} multiplies each time by 4; the heights do not change.
- The domain is the set of x-values, and an input x is allowed exactly when b(x - h) is in the domain of f. That test uses only b and h, so a and k play no part in it. The outputs are aq + k for q in the range of f, and that list uses only a and k.
- Every number w \ge 0 is 3 times a number \displaystyle \frac{w}{3} \ge 0, so tripling [0, \infty) still gives all of [0, \infty): an infinite end stays infinite. A range with a top end of 2 has its top moved to 3 \cdot 2 = 6, while the bottom end 0 stays at 0.
- From \displaystyle y - k = \frac{a}{x - h}, if y \ne k then \displaystyle x - h = \frac{a}{y - k}, so \displaystyle x = h + \frac{a}{y - k} gives the output y. If y = k, the equation needs \displaystyle \frac{a}{x - h} = 0, which no x gives because a \ne 0.
- The point (4, 2) is on the graph, since \displaystyle -\sqrt{4} + 4 = 2, and 2 is below 4. The range is (-\infty, 4]: with a = -1 the endpoint is the highest point, not the lowest.