Lesson Objectives
  • Learn how to apply a vertical stretch to a graph
  • Learn how to apply a vertical compression to a graph
  • Learn how to apply a horizontal stretch to a graph
  • Learn how to apply a horizontal compression to a graph

How to Apply a Stretch or Compression to a Graph


When working with functions, we will often encounter the topic of graphing transformations. These transformations give us a way to graph a given function by altering the graph of a related function. As we continue through this chapter, we will discuss rigid transformations and nonrigid transformations. For rigid transformations (horizontal shifts, vertical shifts, and reflections), the basic shape of the graph is unchanged, we are only changing the position of the graph in the coordinate plane. The nonrigid transformations (vertical and horizontal stretch/compression) cause a distortion or a change in the shape of the graph. The vertical and horizontal stretch/compression are also known as dilations.

Vertical Stretch

A vertical stretch can be thought of as stretching the graph away from the x-axis when compared to the related function. $$g(x)=a \cdot f(x)$$ $$\text{if}\hspace{.1em}a > 1$$ For a given x-value, the y-value has been multiplied by a. This will stretch the graph vertically by a factor of a (a > 1). Showing a vertical stretch with a graph Example #1: Describe the transformation from f(x) to g(x). $$f(x)=\frac{1}{x}$$ $$g(x)=\frac{3}{x}$$ Since g(x) =  3 • f(x), we can say that compared to the graph of f, g has been vertically stretched by a factor of 3. Looking at the graph below, we can see that g is being stretched away from the x-axis. When comparing g to f, for a given x-value, the y-value is multiplied by 3. A more detailed graph with a few labeled points is available via Desmos from the link below.
Desmos Link for More Detail Graphing f and g

Vertical Compression (Shrink)

A vertical compression, which is also known as a vertical shrink can be thought of as compressing or squeezing the graph towards the x-axis when compared to the related function. $$g(x)=a \cdot f(x)$$ $$\text{if}\hspace{.25em}0 < a < 1$$ For a given x-value, the y-value has been multiplied by a. The graph is vertically shrunk by a factor of a (a is between 0 and 1). The terminology used might be different based on the resource. See the note in example #2. Showing a vertical compression with a graph Example #2: Describe the transformation from f(x) to g(x). $$f(x)=x^3$$ $$g(x)=\frac{1}{2}x^3$$ Since g(x) =  1/2 • f(x), we can say that compared to the graph of f, g has been vertically compressed by a factor of 2. Note: The terminology here can vary based on your textbook or teacher. In some cases, the answer would be given by saying when compared to the graph of f, g has been vertically shrunk by a factor of 1/2. Looking at the graph below, we can see that g is being squeezed towards the x-axis. When comparing g to f, for a given x-value, the y-value is multiplied by 1/2 (or divided by 2). A more detailed graph with a few labeled points is available via Desmos from the link below.
Desmos Link for More Detail Graphing f and g

Horizontal Stretch

A horizontal stretch can be thought of as stretching the graph away from the y-axis when compared to the related function. $$g(x)=f(ax)$$ $$\text{if}\hspace{.25em}0 < a < 1$$ To obtain the same y-value, the x-value must be multiplied by 1/a to undo what is done to x. The graph is horizontally stretched by a factor of 1/a. Pay close attention to the formula here as it may cause some confusion. We have 1/a, where a is a number between 0 and 1. For example, if a was 1/3, then 1/a would be 1/(1/3) or 3. Showing a horizontal stretch with a graph Example #3: Describe the transformation from f(x) to g(x). $$f(x)=2 - x^3$$ $$g(x)=2 - \frac{1}{8}x^3$$ Since g(x) = f[(1/2)x], we can say that compared to the graph of f, g has been horizontally stretched by a factor of 2. This may seem a bit counterintuitive. We see f[(1/2)x], so why aren't we getting a horizontal compression? When dealing with horizontal transformations, always think about how to undo what's being done to x. Since 1/2 is multiplying x, we undo this by multiplying by 2. In other words, to obtain the same y-value, x must be multiplied by 2, giving us a horizontal stretch by a factor of 2. Looking at the graph below, we can see that g is being stretched away from the y-axis. Following the rule above, here the a-value is 1/2 and we get the horizontal stretch as 1/(1/2), which is 2. A more detailed graph with a few labeled points is available via Desmos from the link below.
Desmos Link for More Detail Graphing f and g

Horizontal Compression (Shrink)

A horizontal compression, which is also known as a horizontal shrink can be thought of as compressing or squeezing the graph towards the y-axis when compared to the related function. $$g(x)=f(ax)$$ $$a > 1$$ Showing a horizontal compression with a graph The graph is horizontally shrunk by a factor of 1/a. Again, to obtain the same y-value, we need to undo the multiplication of x by a. We would divide by a or multiply by 1/a. This creates a horizontal shrink by a factor of 1/a or again, you may prefer to say this as a horizontal compression by a factor of a.
Example #4: Describe the transformation from f(x) to g(x). $$f(x)=\sqrt{x}$$ $$g(x)=\sqrt{2x}$$ Since g(x) =  f(2x), we can say that compared to the graph of f, g has been horizontally compressed by a factor of 2. Again, we might also see the answer given as a horizontal shrink by a factor of 1/2. The idea here is that in order to obtain the same y-value, we need to either divide the x-value by 2 or multiply by 1/2. Looking at the graph below, we can see that g is being squeezed towards the y-axis. A more detailed graph with a few labeled points is available via Desmos from the link below.
Desmos Link for More Detail Graphing f and g

Skills Check:

Example #1

Describe the transformation from f(x) to g(x). $$f(x)=x^2$$ $$g(x)=\frac{1}{8}x^2$$

Please choose the best answer.

A
Vertically stretched by a factor of 16
B
Vertically stretched by a factor of 8
C
Vertically compressed by a factor of 8
D
Horizontally compressed by a factor of 2
E
Horizontally stretched by a factor of 8

Example #2

Describe the transformation from f(x) to g(x). $$f(x)=\sqrt{x}$$ $$g(x)=\sqrt{\frac{1}{2}x}$$

Please choose the best answer.

A
Vertically stretched by a factor of 2
B
Vertically stretched by a factor of 4
C
Vertically compressed by a factor of 2
D
Horizontally compressed by a factor of 2
E
Horizontally stretched by a factor of 2

Example #3

Describe the transformation from f(x) to g(x). $$f(x)=|x|$$ $$g(x)=\left|\frac{1}{5}x\right|$$

Please choose the best answer.

A
Vertically stretched by a factor of 5
B
Vertically stretched by a factor of 15
C
Vertically compressed by a factor of 15
D
Horizontally compressed by a factor of 5
E
Horizontally stretched by a factor of 5
checkmark x-mark
checkmark x-mark
checkmark x-mark

Congrats, Your Score is 100%

Trophy, You Win!

Better Luck Next Time, Your Score is %

Try again?

retry Trophy, You Win!