Graphs of functions can be transformed in various ways to obtain new graphs from basic functions. These transformations include reflection, rotation, stretching, compression and shifting, and are applied to represent changes in functions in algebraic, graphical and real-life contexts. One of the most important applications of these transformations is in computer graphics, where they are used to model, manipulate and animate images and shapes. However, in this section, we shall focus only on three fundamental transformations: horizontal shift, vertical shift and scaling, which are most commonly used in the graphical analysis of functions.
,
y=∣x∣
,
y=lnx
or
y=3x
, and moves or reshapes it. You do not plot the new graph from nothing: you take the old graph and slide it, or pull it, or squeeze it.
Two questions decide everything:
1. Is the change made to the input
x
(inside the function) or to the output
y
(outside the function)? Inside changes act horizontally, outside changes act vertically.
2. Is it an addition/subtraction (a shift) or a multiplication (a scaling)?
Keep these two questions in mind through the whole section.
(i) Shifting of Graphs
Shifting of graphs refers to the movement of a graph from its original position without changing its shape or size. In shifting, the graph is translated either horizontally or vertically.
In mathematical modeling, shifting is used to represent changes in a function due to variations in input or output values. It allows the same basic function to describe different situations by adjusting its position on the coordinate plane.
Horizontal Shift
A graph of the function y=f(x) is shifted horizontally when the input variable x is changed to x−h. The resulting graph is represented by the function:
y=f(x−h)
swipey equals f of x minus h
If h>0: shift h units to the right
If h<0: shift ∣h∣ units to the left
Vertical Shift
A graph of the function y=f(x) is shifted vertically when the output variable y is changed to y−k. The resulting graph is represented by the function:
y=f(x)+k
swipey equals f of x plus k
If k>0: shift k units upward
If k<0: shift ∣k∣ units downward
For better understanding of horizontal and vertical shifts, we consider the function: y=x2. This equation represents a parabola with vertex at (0,0), as shown in Figure 1.14.
Next, we consider the function y=(x−2)2. This also represents a parabola with vertex at (2,0). Its graph can be seen in Figure 1.15. Note that the graph in Figure 1.15 can be obtained directly from the graph in Figure 1.14 by shifting it 2 units horizontally to the right.
Now, consider another function y=x2−2. This equation also represents a parabola with vertex at (0,−2). Its graph is shown in Figure 1.16. Note that this graph can be obtained directly from the graph in Figure 1.14 by shifting it 2 units downward.
Figure 1.14: y = x², vertex (0, 0) (original drawing after the textbook's figure)
Figure 1.15: y = (x − 2)², vertex (2, 0) (original drawing after the textbook's figure)
Figure 1.16: y = x² − 2, vertex (0, −2) (original drawing after the textbook's figure)
Our table: the same x-values on the three graphs (not printed in the book)
x
x2
(x−2)2
x2−2
0
0
4
−2
1
1
1
−1
2
4
0
2
3
9
1
7
4
16
4
14
swipe
General Formula for Vertical and Horizontal Shift
If both horizontal and vertical shifts are applied together to the function y=f(x), then the general form of the transformed function is given by:
y=f(x−h)+k
swipey equals f of x minus h, plus k
(ii) Scaling of Graphs
Scaling of graphs refers to the stretching or compression of a graph without changing its general shape. In scaling, the graph is enlarged or reduced either in the vertical direction or in the horizontal direction.
Scaling helps in understanding how a function changes when its input or output values are multiplied by a positive constant factor.
Vertical Scaling
If a function y=f(x) is multiplied by a positive constant a, then the new function: y=af(x),a>0 represents a vertical scaling of the graph of y=f(x).
y=af(x),a>0
swipey equals a times f of x, a greater than 0
If a>1, then the graph is stretched vertically by factor a.
If 0<a<1, then the graph is compressed vertically by factor a1>1.
Only the y-values of the graph change, while x-values remain unchanged.
Horizontal Scaling
If a function y=f(x) is transformed to: y=f(ax),a>0 then, it represents a horizontal scaling of the graph of y=f(x).
y=f(ax),a>0
swipey equals f of a x, a greater than 0
If a>1, then the graph is compressed horizontally by a factor a
If 0<a<1, then the graph is stretched horizontally by a factor a1>1.
Only the x-values of the graph change, while y-values remain unchanged
For better understanding of scaling, we consider the following functions: y=501(x−2)2 and y=(3x−2)2.
The graph of y=501(x−2)2 is shown in Figure 1.17 which can be obtained from the graph of y=(x−2)2 (Figure 1.15) using a vertical compression by factor of 50. Similarly, the graph of y=(3x−2)2 can be obtained from the graph of y=(x−2)2 by a horizontal compress, that is, by a factor of 3 (see Figure 1.18).
Figure 1.17: y = (1/50)(x − 2)² (original drawing after the textbook's figure)
Figure 1.18: y = (3x − 2)² (original drawing after the textbook's figure)
General Formula for Scaling of Graphs
If a function y=f(x) is transformed to y=af(bx),a>0,b>0 then it represents both vertical and horizontal scaling of the graph of y=f(x).
y=af(bx),a>0,b>0
swipey equals a times f of b x, a and b greater than 0
If a>1, the graph is stretched vertically by factor a. If 0<a<1, the graph is compressed vertically by factor a1. On the other hand, if b>1, the graph is compressed horizontally by factor b and if 0<b<1, the graph is stretched horizontally by factor b1.
Our summary of the four transformations (point (x, y) of y = f(x) moves to)
Change
New function
Point moves to
h units right (h>0)
y=f(x−h)
(x+h,y)
k units up (k>0)
y=f(x)+k
(x,y+k)
vertical scaling by a
y=af(x)
(x,ay)
horizontal scaling by b
y=f(bx)
(bx,y)
swipe
Worked example
Example 13
Let f(x)=ln(x2+1). Find the function obtained after: (i) a vertical stretch by factor 2 (ii) then a shift 1 unit to the left.
Given: f(x)=ln(x2+1).
To find: the function after (i) a vertical stretch by factor 2 and then (ii) a shift of 1 unit to the left.
Method: for (i) use vertical scaling y=af(x); for (ii) use the horizontal shift y=g(x−h) on the new function g. The order is given, so step (ii) acts on the result of step (i).
Step (i): vertical stretch by factor 2y=af(x),a=2y=2ln(x2+1)
Name the new functiong(x)=2ln(x2+1)Why: the next transformation acts on this function, not on the original f.
Step (ii): shift 1 unit to the lefty=g(x−h),h=−1y=g(x−(−1))=g(x+1)
Replace every x in g by x+1g(x+1)=2ln[(x+1)2+1]
Check:
The lowest point of f is (0,0), since ln1=0. The stretch keeps it at (0,0) and the shift left moves it to (−1,0)
Answer: The transformed function is y=2ln(x2+2x+2).
Worked example
Example 14
Let f(x)=x+1x. Find the function obtained after applying all the following transformations with the given order: (i) vertical stretch by 2 (ii) horizontal stretch by 3 (iii) shift 2 units to the right (iv) shift 1 unit downward
Given: f(x)=x+1x.
To find: the function after the four transformations, applied in the given order.
Method: one formula for each step: (i) y=af(x) with a=2; (ii) y=g(bx) with b=31; (iii) y=s(x−h) with h=2; (iv) y=t(x)+k with k=−1. Each step acts on the function produced by the step before it.
(i) Vertical stretch by 2y=2⋅x+1x=x+12x
(ii) Horizontal stretch by 3y=g(bx),b=31y=g(3x)
(iii) Shift 2 units to the right
The book prints: y=(x−h), where h=2. The function name s is missing; the formula is y=s(x−h)
(iv) Shift 1 unit downwardy=t(x)+k,k=−1y=x+12x−4−1
Check:
Follow the point (1,21) of f: (i) (1,1)
Answer: Transformed function is y=x+1x−5.
Why: a vertical stretch multiplies every output by
a=2
; the input
x
is not touched, so the whole function
ln(x2+1)
is multiplied by 2.
Why: in
y=g(x−h)
,
h>0
moves the graph right and
h<0
moves it left; 1 unit left means
h=−1
.
=2ln(x2+2x+1+1)
=2ln(x2+2x+2)
Why:
(x+1)2=x2+2x+1
; then
1+1=2
.
.
2ln((−1)2−2+2)=2ln1=0
The answer gives 0 at
x=−1
, as expected.
We set
g(x)=x+12x
.
Why:
y=af(x)
with
a=2
doubles every output.
=3x+12⋅3x
=x+32x
Let
s(x)=x+32x
.
Why: in
y=g(bx)
,
0<b<1
stretches horizontally by
b1
; a stretch by 3 needs
b1=3
, so
b=31
. Multiplying top and bottom by 3 clears the small fractions.
(see the Book correction below).
y=s(x−2)
=(x−2)+32(x−2)
=x+12x−4
Let
t(x)=x+12x−4
.
Why: a shift right by
h=2
replaces every
x
in
s
by
x−2
; in the denominator
−2+3=1
.
=x+12x−4−(x+1)
=x+1x−5
Why: moving down 1 subtracts 1 from every output; writing 1 as