Transforming Graphs - Department of Mathematics

Okaloosa-Walton College
DEPARTMENT OF MATHEMATICS
Transforming Graphs
D. P. Story
This file contains explanations and animations of some of the common function transformations: shifting, compression and stretching.
I hope you enjoy the demonstrations, I enjoyed making them. DP
S
c 2007 [email protected]
Prepared: Feb. 16, 2007
College Algebra Web Site
Published: Feb. 20, 2007
2/9
Vertical Shifting
Theory: Let f be a given function, and
define g(x) = f (x) + C. When C > 0,
the graph of g is shifted vertically upward
from that of f ; When C < 0 the graph is
vertically shifted downward.
In the animation to the right, when you
click on the forward button, the initial
function of f (x) = x2 is shifted vertically
upward by an amount of C, the graph in
red is that if g(x) = x2 + C, for larger
and larger values of C. The last function
graphed is g(x) = x2 + 2.
When you click on the backward animation button, the function g(x) = x2 + 2
is shifted downwards. This downward
movement illustrates the case of C < 0.
Do you understand why?
Note: Explore the functionality of the
buttons. Have fun!
y
9
8
y = x2
7
6
5
4
3
2
1
x
−3
−2
−1
1
2
10
3
3/9
Horizontal Shifting – Shifting to the Right
Theory: Let f be a given function, and
define g(x) = f (x − h). When h > 0, the
graph of g is shifted horizontally to the
right of that of f .
In the animation to the right, when you
click on the forward button, the initial
function of f (x) = x2 is shifted horizontally to the right by an amount of h,
0 ≤ h ≤ 2. The graph in red is that if
g(x) = (x − h)2 , where h > 0, for larger
and larger values of h. The last function
graphed is g(x) = (x − 2)2 . You can see
this last graph has vertex at x = 2, exactly 2 units to the right from the vertex
of f (x) = x2 .
When you click on the backward animation button, the function g(x) = (x − h)2
is shifted back to the left.
y
9
8
y = x2
7
6
5
4
3
2
1
x
−3
−2
−1
1
2
10
3
4/9
Horizontal Shifting – Shifting to the Left
Theory: Let f be a given function, and
define g(x) = f (x − h). When h < 0, the
graph of g is shifted horizontally to the
left of that of f .
In the animation to the right, when you
click on the forward button, the initial
function of f (x) = x2 is shifted horizontally to the left by an amount of |h|,
−2 ≤ h ≤ 0. The graph in red is that if
g(x) = (x − h)2 , where h < 0, for smaller
and smaller values of h. The last function
graphed is g(x) = (x + 2)2 (in this case,
h = −2). You can see this last graph has
vertex at x = −2, exactly 2 units to the
left from the vertex of f (x) = x2 .
When you click on the backward animation button, the function g(x) = (x − h)2
is shifted back to the right.
y
9
8
y = x2
7
6
5
4
3
2
1
x
−3
−2
−1
1
2
10
3
5/9
Vertical Compression
Theory: Let f be a given function, and
define g(x) = af (x). When 0 < a < 1,
the graph of g is compressed vertically
from the graph of f towards the x-axis.
The amount of compression is proportional to the height of the graph of f .
In the animation to the right, when you
click on the forward button, the initial
function of f (x) = x2 is compressed vertically for 0.25 ≤ a ≤ 1. The graph in red is
that if g(x) = ax2 , for smaller and smaller
values of a. The last function graphed is
g(x) = 0.25x2 (in this case, a = 0.25).
You can see the results of compression towards the x-axis.
When you click on the backward animation button, the function g(x) = ax2 is
stretched back into the original function.
y
9
8
y = x2
7
6
5
4
3
2
1
x
−3
−2
−1
1
2
10
3
6/9
Vertical Stretching
Theory: Let f be a given function, and
define g(x) = af (x). When a > 1, the
graph of g is stretched vertically from the
graph of f away from the x-axis. The
amount of stretching is proportional to
the height of the graph of f .
In the animation to the right, when you
click on the forward button, the initial
function of f (x) = x2 is stretched vertically for 1 ≤ a ≤ 3. The graph in red is
that if g(x) = ax2 , for larger and larger
values of a. The last function graphed
is g(x) = 3.00x2 (in this case, a = 3.00).
You can see the results of stretching away
from the x-axis.
When you click on the backward animation button, the function g(x) = ax2 is
stretched back into the original function.
y
9
8
y = x2
7
6
5
4
3
2
1
x
−3
−2
−1
1
2
10
3
7/9
Horizontal Stretching
Theory: Let f be a given function, and
define g(x) = f (ax). When 0 < a < 1,
the graph of g is stretched horizontally
from the graph of f away from the y-axis.
The amount of stretching is proportional
to the x coordinate of the point on the
graph of f .
In the animation to the right, when you
click on the forward button, the initial function of f (x) = x2 is horizontal
stretching for 0.25 ≤ a ≤ 1. The graph
in red is that if g(x) = (ax)2 , for smaller
and smaller values of a. The last function graphed is g(x) = (0.25x)2 (in this
case, a = 0.25). You can see the results
of stretching away from the y-axis.
When you click on the backward animation button, the function g(x) = ax2
is compressed horizontally back into the
original function.
y
9
8
y = x2
7
6
5
4
3
2
1
x
−3
−2
−1
1
2
10
3
8/9
Horizontal Compression
Theory: Let f be a given function, and
define g(x) = f (ax). When a > 1,
the graph of g is compressed horizontally
from the graph of f toward the y-axis.
The amount of compression is proportional to the x coordinate of the point on
the graph of f .
In the animation to the right, when you
click on the forward button, the initial
function of f (x) = x2 is compressed horizontally for 1 ≤ a ≤ 3. The graph in
red is that if g(x) = (ax)2 , for larger
and larger values of a. The last function graphed is g(x) = (3.00x)2 (in this
case, a = 3.00). You can see the results
of stretching away from the x-axis.
When you click on the backward animation button, the function g(x) = (ax)2 is
compressed back into the original function.
y
9
8
y = x2
7
6
5
4
3
2
1
x
−3
−2
−1
1
2
10
3
9/9
Vertical Compression & Horizontal Stretching Compared
When you compare the end-states of the Vertical Compression example and the Horizontal Stretching example, they appear to be the
same, except one was more extreme than the
other. They are not the same transformation, despite their appearance.
To clarify the issue, let’s look at the function
f (x) = x2 − 2x + 2 = (x − 1)2 + 1. Run
the animation. The green curve is vertical
compression (y = af (x)) while the red curve
is horizontal stretching (y = f (ax)), in both
cases 0 < a < 1. We get quite different results.
In this case, each of the curves is a parabola:
For the green one, the vertex is compressed vertically downward towards the xaxis, while the red one stretches the vertex
horizontally away from the y-axis. The final
resting place for the red vertex is at x = 4.
The vertices tell the story: For vertical compression (green), the vertex moves from (1, 1)
to (1, 0.25), while for horizontal stretching
(red) the vertex moves (1, 1) to (4, 1).
y
9
8
y = x2 − 2x + 2
7
6
5
4
3
2
1
x
−3 −2 −1
1
2
3
4
10
5
6