A whole family of graphs, such as every parabola with a vertical axis, comes from one parent graph by shifts, stretches and reflections. Pick a parent function and set the four numbers in
The faded curve is and the bold curve is . Arrows join three key points of to the points where they land on , so every change has a visible cause. Drag the ring on the graph to move and together, and use the play button to watch being built from one step at a time.
f of x equals x squared
g of x equals 2 times the square of the quantity x minus 2, minus 3
- Parent f
- New function g
- Where each key point moves
- Asymptote of g
Drag the ring on the graph to change h and k
Steps from f to g, in order
- No horizontal stretch or reflection
- Shift right by 2
- Stretch vertically away from the x-axis by the factor 2
- Shift down by 3
Each point (x, y) of f moves to
(x + 2, 2y − 3)
| Feature | f | g |
|---|---|---|
| Domain | (−∞, ∞) | (−∞, ∞) |
| Range | [0, ∞) | [−3, ∞) |
| Vertical asymptote | ||
| Horizontal asymptote | ||
| Point A | (−1, 1) | (1, −1) |
| Point B | (0, 0) | (2, −3) |
| Point C | (1, 1) | (3, −1) |
The sliders for and jump from straight to . With or the graph would collapse onto a horizontal line, or vanish when is undefined, so would no longer be a copy of .
Things to try
- Choose , set , and , and move to . The formula shows with a minus sign, yet the vertex moves right to , because .
- Keep and compare with , each time with the other factor at . The two graphs are identical, since . The same happens with for and , and with for and .
- Choose and make negative. The graph flips across the vertical line and the domain turns from into . Make negative instead and the graph flips across the line , so the range turns from into while the domain stays where it was.
- Choose and drag the ring around. The dashed asymptotes and travel with it, and the domain and the range leave out exactly and .
- Choose and set . The curve drops below its asymptote and the range changes from to . With and it is the domain that flips, to .
- Choose and try and then . The period becomes and then , while the range is always .
- With , set , , and and play the steps. The vertex stays at the origin during the compression and then moves right to . Had the shift come first, the compression would have pulled it back to .
- Choose and switch between and . The graph does not change, but the images and trade places, because is even and . With the graph stays the same only when and change sign together, because is odd and .
What you are seeing
Each point on the graph of lands at
on the graph of . To check, put the new first coordinate into .
The explorer draws exactly this way, by moving every point of , and the readout under the graph spells out the rule with the current numbers. The table next to it applies the rule to the key points , and , with exact values.
The order of the steps
The second coordinate is multiplied by and then shifted by , the same order in which is worked out. The first coordinate is divided by and then shifted by . So the explorer lists the steps in this order.
- Stretch or compress horizontally by the factor , and reflect across the -axis when .
- Shift horizontally by .
- Stretch or compress vertically by the factor , and reflect across the -axis when .
- Shift vertically by .
Horizontal and vertical steps do not affect each other, so the two pairs could come in either order. Within each pair the order matters. Compressing by the factor and then shifting it right by gives
which takes the point to . Shifting first and then compressing gives a different parabola,
with its vertex at instead of . That is why an input such as should be factored as before the shift is read off.
Composition gives another way to see the order. Write for the inside and for the outside, so that
An input passes through first, then , then . The lesson on function composition explains this way of building functions in general.
Why the inside acts the opposite way
The outside numbers act on the outputs of directly. Adding moves the graph up by , and the factor multiplies every height by . The inside numbers act on the input before sees it. To get the output that gives at some input , the function needs an with , and solving for gives
So subtracting inside moves the graph right by , and multiplying by inside scales it horizontally by the factor , which is a compression when . Each inside change shows up on the graph undone. In the input runs twice as fast, so a full wave fits into half the distance.
Domain, range and asymptotes
The domain of is the set of all for which is an allowed input of . For that means , so the domain is when and when .
The range of is the set of all values with in the range of . For , and it is when and when . Horizontal steps never change the range, and vertical steps never change the domain.
The vertical asymptote of and moves to , and the horizontal asymptote of and moves to . They move like any other part of the graph, by the same rule as the points.
The lessons on shifts and reflections and on stretches and compressions work through these rules with more examples, and the lesson on even and odd functions explains the symmetry behind the last thing to try. The same numbers come back in the vertex form of a parabola in Quadratic Functions and Vertex Form, in the shifted curves of Graphs of Exponential and Logarithmic Functions and as the amplitude, period and phase shift of a wave in Amplitude, Period, and Phase Shift. The rules are also collected on the precalculus reference sheet. Every lesson is listed on the Precalculus course page, and the video lessons are coming soon. For test preparation, the SAT Math lessons Shifting, Reflecting and Stretching Graphs and Quadratic Graphs and Their Forms apply the same rules.