AP Precalculus · Polynomial and Rational Functions · free lesson
Transformations of Functions
The idea, then worked examples solved step by step, then practice questions whose numbers change every time you try them.
The idea
New functions from old ones
Many functions on the AP exam are built from a simpler one. If you know the graph of f, a constant added or multiplied in the right place gives a new function g whose graph is the graph of f moved, stretched or flipped. The graph of f is called the preimage and the graph of g the image.
There are only two places to put a constant. A constant put outsidef, as in f(x)+3 or 2f(x), changes the output values, so it acts up and down. A constant put inside, as in f(x−2) or f(2x), changes the input values, so it acts left and right, and it acts the opposite way to what it seems to say.
Additive transformations: translations
Take f(x)=x3−3x. Its graph has a relative maximum and a relative minimum, which make good points to follow. Let g(x)=f(x−2)+1:
Point of f
(x,f(x))
Matching point of g
(x,g(x))
relative maximum
(−1,2)
relative maximum
(1,3)
relative minimum
(1,−2)
relative minimum
(3,−1)
The value g(1) is f(−1)+1: the input of g must be 2 more than the input of f to reach the same height. So every point of f appears on g two units to the right and one unit up. Click the picture to watch both graphs drawn.
Rule.
g(x)=f(x)+k is a vertical translation of the graph of f by k units: up when k>0, down when k<0.
g(x)=f(x+h) is a horizontal translation of the graph of f by −h units: f(x−2) moves the graph 2 units right, f(x+2) moves it 2 units left.
Multiplicative transformations: dilations and reflections
g(x)=a⋅f(x) multiplies every output value by a. It is a vertical dilation by a factor of ∣a∣; when a<0 the graph is also reflected over the x-axis. Zeros of f stay where they are, because a⋅0=0.
g(x)=f(bx) multiplies the input by b, so g reaches each value of f at an input b times smaller. It is a horizontal dilation by a factor of ∣b∣1; when b<0 the graph is also reflected over the y-axis. The y-intercept stays where it is, because b⋅0=0.
In the picture f(x)=x3−3x has a zero at x=3≈1.732. On y=2f(x) the zero is still there and the relative maximum doubles to (−1,4). On y=f(2x) the zero moves in to 0.866 and the relative maximum to (−21,2): half as wide, just as tall.
All four together
A function of the form g(x)=a⋅f(b(x−h))+k combines all four: a horizontal dilation by ∣b∣1, a vertical dilation by ∣a∣, reflections for negative a or b, a horizontal translation by h and a vertical translation by k. Drag the sliders and watch the relative maximum of f (the dot) travel.
To follow one point, undo the inside and do the outside. A point (p,q) on the graph of f goes to
(x,y)=(h+bp,aq+k)
because g reaches the input p of f when b(x−h)=p, and then multiplies the output q by a and adds k.
The inside written another way
The exam often writes the inside as f(bx+c). Factor out b before you read the shift. For g(x)=f(2x−6):
2x−6=2(x−3), so g(x)=f(2(x−3)): a horizontal dilation by 21 and a translation of 3 units right, not 6. A quick test: the input 0 of f is reached when 2x−6=0, at x=3.
Domain and range
Inside constants change the domain; outside constants change the range. Suppose f has domain −2≤x≤4 and range −1≤y≤3, and g(x)=−2f(x−1)+5.
The inputs move right 1: the domain of g is −1≤x≤5. The outputs are multiplied by −2 and raised by 5. The lowest output of f, −1, becomes −2(−1)+5=7, and the highest, 3, becomes −2(3)+5=−1. The reflection turns the range over: it is −1≤y≤7.
Warning.
The slips the exam is built on: moving f(x−h) to the left; giving the horizontal dilation of f(bx) as b instead of b1; reading the shift of f(bx+c) as c instead of bc; reflecting over the wrong axis; and, for a<0, writing the new range with its ends in the wrong order.
Note.
On the AP exam, describe each change with its kind, its direction and its size, in an order that works: "a vertical dilation by a factor of 3, then a vertical translation of 2 units down". For 3f(x)−2 that order matters: translating first and then dilating would give 3(f(x)−2)=3f(x)−6.
Worked examples
Worked examples
Each example is one kind of question the AP exam asks about transformations. Every number in the working is found by the engine.
Example.
1. From words to a formula. Let f(x)=x2−4x+1. The graph of g is made from the graph of f by a vertical dilation by a factor of 3, a reflection over the x-axis, and then a translation of 2 units left and 5 units up. Write g(x), and find where the vertex of f goes.
The dilation and the reflection multiply the outputs by −3; the move up adds 5 outside; the move left is x+2 inside:
g(x)=−3f(x+2)+5=−3((x+2)2−4(x+2)+1)+5=−3x2+14
The vertex of f is at x=2, where f(2)=−3. Its image is 2 units left, at x=0, with height −3(−3)+5:
g(0)=−3f(2)+5=14
So the vertex (2,−3) goes to (0,14). The order matters: the dilation and reflection come before the move up, so the 5 is added after multiplying by −3.
Example.
2. From a formula to words. Describe how the graph of g(x)=2f(3x−6)−1 is made from the graph of f. If (4,−3) is on the graph of f, which point is on the graph of g?
Factor the inside first: 3x−6=3(x−2), so g(x)=2f(3(x−2))−1. Read it from the inside out:
a horizontal dilation by a factor of 31 (the factor 3 inside),
a horizontal translation of 2 units right,
a vertical dilation by a factor of 2,
a vertical translation of 1 unit down.
For the point: g uses the input 4 of f when 3x−6=4, and its output is 2(−3)−1:
3x−6xy=4=310=2×(−3)−1=−7
The point is (310,−7). A common slip is 4+6=10 or 4+2=6 for the first coordinate: the input must be divided by 3 as well as moved.
Example.
3. The constants from two graphs. The graph of f is the broken line in gray. The graph of g(x)=a⋅f(x−h)+k is in red. Find a, h and k.
The two zeros of f at x=−2 and x=2 are 4 apart, and the matching points of g, at x=1 and x=5, are also 4 apart: there is no horizontal dilation. The peak moves from x=0 to x=3:
h=3−0=3
Heights: on f the peak is 2 above the point to its left; on g it is 4 above. That ratio is a. Then k comes from the left end point, g(1)=a⋅f(−2)+k:
ak=2−03−(−1)=2=−1−2(0)=−1
So g(x)=2f(x−3)−1. Check one more point: f(3)=−1, so g(6)=2(−1)+(−1)=−3, which is the last red point, (6,−3).
Example.
4. Values from a table. Some values of f are given. Let g(x)=3f(x+2)−1 and p(x)=f(2x). Find g(0), g(1) and p(1).
x
−1
0
1
2
3
4
f(x)
5
2
−1
4
0
−3
Work out the input of f first, then read the table, then do the outside:
The usual slip is to read f at the input of g itself: 3f(0)−1=5 is not g(0).
Example.
5. Domain and range. The function f has domain 0≤x≤8 and range −2≤y≤6. Find the domain and the range of g(x)=−3f(2x)+1.
Domain: g(x) is defined when the input 2x is in the domain of f:
0≤2x≤8 gives 0≤x≤16. So the domain is 0≤x≤16 (a horizontal dilation by a factor of 2). Range: each output y of f becomes −3y+1. The ends of the range give
−3(−2)+1−3(6)+1=7=−17
The negative factor turns the range over: it is −17≤y≤7. Writing 7≤y≤−17 describes no numbers at all, and forgetting the reflection gives the wrong interval −5≤y≤19.
Example.
6. A model from a parent function. A fountain's jet leaves its nozzle 2 feet above the ground, reaches its greatest height of 8 feet at a horizontal distance of 3 feet from the nozzle, and comes down. Model the height of the jet by a transformation of f(x)=x2, where x is the horizontal distance in feet, and find where it lands.
The vertex of f is (0,0); the jet's highest point is (3,8). A translation 3 right and 8 up, with a vertical dilation by a, gives g(x)=a(x−3)2+8. The nozzle gives the condition g(0)=2:
a(0−3)2+8a=2=−32
So g(x)=−32(x−3)2+8; the negative a reflects the parabola so that it opens down. The jet lands where g(x)=0 with x>3:
x=3+23≈6.464 feet from the nozzle. The model applies only for 0≤x≤6.464: before the nozzle there is no jet, and after landing the water does not go below the ground.
Practice
Answer AP-style questions on transformations of functions. Each answer is checked, with the full solution, and every try brings new numbers. Practice needs a free account: it keeps your progress.