Skip to main content

Section 5.5 Horizontal Stretches and Compressions

Subsection 5.5.1

In the previous section we discussed the result of multiplying the output of the function by a constant value. However, what happens when we multiply the input of the function? To explore this idea, we look at the graphs of
\begin{equation*} f(x)=(x-1)^2 \text{, } ~f(2x)=(2x-1)^2\ \text{ ,and } ~f\left(\dfrac{1}{2}x\right)=\left(\dfrac{1}{2}x-1\right)^2 \end{equation*}
and discuss how they are related.
described in detail following the image
yHorizontal Compression
Figure 5.43.
\(x\) \(y=f(x)\) \(y=f(2x)\)
\(-1\) \(4\) \(8\)
\(-.5\) \(2.25\) \(4\)
\(0\) \(1\) \(1\)
\(.5\) \(.25\) \(0\)
\(1\) \(0\) \(1\)
\(2\) \(1\) \(9\)
As we can see above, compared to the graph of \(f(x)\text{,}\) the graph of \(f(2x) \) is compressed horizontally by a factor of \(2 \text{.}\) Effectively, if we are given a point \((x,y) \) on the graph of \(f(x) \) then \(\left(\dfrac{1}{2}x,y\right) \) is a point on the graph of \(f(2x)\text{.}\)
Looking at the table above we can verify this for a few points. For example, the point \((2,1)\) is on the graph of \(f(x)\text{.}\) Then
\begin{equation*} \left(\dfrac{1}{2}(2),1\right)=(1,1) \end{equation*}
is a point on the graph \(f(2x)\text{.}\)
described in detail following the image
yHorizontal Stretch
Figure 5.44.
\(x\) \(y=f(x)\) \(y=f\left(\dfrac{1}{2}x\right)\)
\(-1\) \(4\) \(2.25\)
\(0\) \(1\) \(1\)
\(1\) \(0\) \(.25\)
\(2\) \(1\) \(0\)
\(4\) \(9\) \(1\)
Table 5.45. Horizontal Stretch
The graph of \(f\left(\dfrac{1}{2}x\right)\) is stretched horizontally by a factor of \(2 \) compared to the graph of \(f(x) \text{.}\) Further, if \((x,y) \) is a point on the graph of \(f(x)\text{,}\) then \((2x,y) \) is a point on the graph of \(f\left(\dfrac{1}{2}x\right)\text{.}\)
We can see this playing out in our example above. Notice that \((2,1) \) is a point on \(f(x)\text{,}\) and
\begin{equation*} (2(2),1)=(4,1) \end{equation*}
is a point on the graph of \(f\left(\dfrac{1}{2}x\right)\) as shown in the table and graph above. In general we have:

Horizontal Stretches, Compressions, and Reflections.

Compared with the graph of \(y = f (x)\text{,}\) the graph of \(y = f (a\cdot x)\text{,}\) where \(a \ne 0\text{,}\) is
  1. compressed horizontally by a factor of \(\abs{a}\) if \(\abs{a}\gt 1\text{,}\)
  2. stretched horizontally by a factor of \(\abs{\dfrac{1}{a}}\) if \(0\lt\abs{a}\lt 1\text{,}\) and
  3. reflected about the \(y\)-axis (and stretched or compressed) if \(a\lt 0\text{.}\)
As you may have notice by now through our examples, a horizontal stretch or compression will never change the \(y\) intercepts. This is a good way to tell if such a transformation has occurred.

Example 5.46.

described in detail following the image
yHorizontal Stretch
Figure 5.47.
The graph of \(f(x)\) is shown along with either a horizontal stretch of compression of \(f(x) \text{.}\) Decide if \(g(x) \) is a stretch or a compression, and give a formula for \(g(x)\) in terms of \(f(x)\text{.}\)
Solution.
First, notice that the \(y\)-intercept stays fixed while the \(x\)-intercepts shift closer to the \(y\)-axis. This tells us that \(g(x)\) is a horizontal compression. The \(x \)-intercepts of \(f(x)\) are \(x=-1,1,2 \) while the \(x\)-intercepts of \(g(x)\) are \(x=-.5,.5,1\text{.}\)
So, the \(x\)-intercepts of \(g(x) \) can be achieved by taking the intercepts of \(f(x) \) and divide each by 2. This tells us that \(g(x)\) is a horizontal compression by a factor of \(2 \text{.}\) Hence, we may write
\begin{equation*} g(x)=f(2x). \end{equation*}
Figure 5.48. Explore the inverse relationship between between the functions \(f(t)=\log_b(t)\) and \(g(t)=b^t\) for various values of \(b>0\) with this applet.

Exercises 5.5.2 Exercises

1. Exploring Horizontal Compressions and Stretches.

\prob Let \(f(x)=x^2-1\text{,}\) \(g(x)=f(2x)=(2x)^2-1\text{,}\) and \(h(x)=f(.5x)=(.5x)^2-1\text{.}\) Fill in the following table:
\(x\) -2 -1 0 1 2
\(f(x)\)
\(g(x)\)
\(h(x)\)
The following are graphs of the functions \(f(x)\text{,}\) \(g(x)\text{,}\) and \(h(x)\text{.}\)
a) Which of the following statements best describes the differences between the graphs of \(f(x)\) and \(g(x)\text{?}\)
  • The graph of \(g(x)\) is a vertical compression of the graph of \(f(x)\text{.}\)
  • The graph of \(g(x)\) is a horizontal stretch of the graph of \(f(x)\text{.}\)
  • The graph of \(g(x)\) is a horizontal compression of the graph of \(f(x)\text{.}\)
  • The graph of \(g(x)\) is a vertical stretch of the graph of \(f(x)\text{.}\)
b) Which of the following statements best describes the differences between the graphs of \(f(x)\) and \(h(x)\text{?}\)
  • The graph of \(g(x)\) is a vertical compression of the graph of \(f(x)\text{.}\)
  • The graph of \(g(x)\) is a vertical stretch of the graph of \(f(x)\text{.}\)
  • The graph of \(g(x)\) is a horizontal compression of the graph of \(f(x)\text{.}\)
  • The graph of \(g(x)\) is a horizontal stretch of the graph of \(f(x)\text{.}\)
c) Assume \(b>1\) and \(f(x)\) is a function. Based on your work above, try to write an implicit formula (a function in terms of \(f(x)\text{,}\) e.g. \(g(x)=f(2x)\)) for the following:
i) The graph of \(g(x)=\) is the graph of \(f(x)\) horizontally stretched by a factor of \(b\text{.}\)
ii) The graph of \(g(x)=\) is the graph of \(f(x)\) horizontally compressed by a factor of \(b\text{.}\)
Hint.
We can fill in the table by evaluating each of the given functions at the values of \(x\) in the table.
a) We see that the graph of \(g(x)\) looks like it has been flattened towards \(y\)-axis. Which description best fits this concept?
b) We see the the graph of \(h(x)\) looks like it has been stretched away from \(y\)-axis. Which description best fits this concept?
c) To come up with the formulas, let’s use what happened with \(g(x)\) and \(h(x)\) to help figure out the general rule.
We know that \(g(x)=f(2x)\) resulted in a horizontal compression and \(h(x)=f(.5x)=f\left(\dfrac{1}{2}x\right)\) resulted in a horizontal stretch. Think about the expressions \(f(bx)\) and \(f\left(\dfrac{1}{b}x\right)\text{,}\) where \(b>1\text{.}\) Which of these do you think will give a horizontal stretch and which will give a horizontal compression, based on what you see above?

2. Describing Compressions and Stretches.

Find explicit formulas (in terms of \(x\)) for the following functions, and describe in words how the graphs of the following functions differ from \(f(x) = x^2+2\text{.}\) For example, the explicit form of \(g(x)=f(x)+2\) would be \(g(x)=(x^2+2)+2\text{.}\)
a) \(g(x) = 5 f(x)=\)
The graph of \(g(x)\) is the same as the graph of \(f(x)\) vertically
by .
b) \(j(x) = f(3x)=\)
The graph of \(j(x)\) is the same as the graph of \(f(x)\) horizontally
by a factor of .
c) \(k(x) = f\left(\frac{1}{5}x\right)=\)
The graph of \(j(x)\) is the same as the graph of \(f(x)\) horizontally
by a factor of .
d) \(h(x) = \frac{1}{5}f(4x) =\)
The graph of \(h(x)\) is the same as the graph of \(f(x)\) vertically
by and horizontally
by a factor of .
Hint.
In order to write an explicit formula, we want to use the fact that we know \(f(x)=x^2+2\text{.}\) To answer the rest of each question, recall the following information:
When compared to the graph of \(f(x)\text{,}\)
- the graph of \(y=f(bx)\) is horizontally compressed by a factor of \(b\) when \(b>1\text{.}\)
- the graph of \(y=f(bx)\) is horizontally stretched by a factor of \(\dfrac{1}{b}\) when \(0\lt b\lt 1\text{.}\)
- the graph of \(y=af(x)\) is vertically stretched by a factor of \(a\) when \(a>1\text{.}\)
- the graph of \(y=af(x)\) is vertically compressed by a factor of \(\dfrac{1}{a}\) when \(0\lt a\lt 1\text{.}\)

3. Points on Compressions and Stretches.

The graph of \(y=h(x)\) contains the point \((-1,4)\text{.}\)
a) What point must lie on the graph of \(h(5 x)\text{?}\)
b) What point must lie on the graph of \(2h(5 x)\text{?}\)
Hint.
Try to figure out what transformations have been applied to the function in each case. Use that to help you determine what would happen to the point.
a) The graph of \(h(5x)\) is the same as the graph of \(h(x)\) horizontally compressed by a factor of 5.
b) The graph of \(2h(5x)\) is the same as the graph of \(h(x)\) horizontally compressed by a factor of 5 and vertically stretched by a factor of 2.

4. Graphing Compressions and Stretches.

Let \(f(x)\) be given by the (large) graph to the right. On a piece of paper, graph and label each equation listed below. Then, match each formula with its graph from the list A-F below. Pay careful attention to the axes in the graph on the right, and on the graphs below. In all pictures, each tick mark represents a length of 1 unit. \(y = f(4 x)\) \(y = 4 f(0.25 x)\) \(y = 0.25 f(4 x)\) \(y = 4 f(x)\)
\(y = f(x)\)
A B C
D E F
(Click on a graph to enlarge it)
Hint.
Recall the following information to help you choose the right graph. It may be useful to pick a couple of key points to follow to help you decide.
When compared to the graph of \(f(x)\text{,}\)
- the graph of \(y=f(bx)\) is horizontally compressed by a factor of \(b\) when \(b>1\text{.}\)
- the graph of \(y=f(bx)\) is horizontally stretched by a factor of \(\dfrac{1}{b}\) when \(0\lt b\lt 1\text{.}\)
- the graph of \(y=af(x)\) is vertically stretched by a factor of \(a\) when \(a>1\text{.}\)
- the graph of \(y=af(x)\) is vertically compressed by a factor of \(\dfrac{1}{a}\) when \(0\lt a\lt 1\text{.}\)

5. Domain and Range of Compressions and Stretches.

Suppose the domain of a function \(j(x)\) is the interval \([-3,6]\text{,}\) and the range of \(j(x)\) is the interval \([-6,5]\text{.}\) Determine the domain and range of the following functions. Write your answers using interval notation.
a) \(j\left(\dfrac{1}{4} x\right)\)
Domain:
Range:
b) \(\frac{1}{2}j(8 x)\)
Domain:
Range:
Hint.
a) The graph of \(j\left(\dfrac{1}{4} x\right)\) is a horizontal stretch of the graph of the function \(j(x)\) by a factor of 4. Will this change the inputs or outputs? Think about whether that will change the domain or the range.
b) The graph of \(\dfrac{1}{2}j\left(8 x\right)\) is a horizontal compression of the graph of the function \(j(x)\) by a factor of 8 and a vertical compression of the graph of \(j(x)\) by a factor of 2. Will this change the inputs or outputs? Think about whether that will change the domain or the range.
One thing to consider here is that if there’s a compression involved, the interval should get smaller (i.e., the endpoints will get closer together). On the other hand, if there’s a stretch involved, the interval should get larger (i.e., the endpoints will get farther apart).

6. Application: Conversions in Functions.

Sylvia is running a marathon. Let \(D(t)\) represent the total distance in kilometers she has run \(t\) hours after starting. Find a formula for each of the following functions in terms of \(D(t)\text{.}\) Note: Be careful with your input variables.
a) \(M(h)\text{,}\) the total distance in meters she has run after \(h\) hours.
\(M(h)=\)
b) \(K(m)\text{,}\) the total distance in kilometers she has run after \(m\) minutes.
\(K(m)=\)
c) \(C(s)\text{,}\) the total distance in centimeters she has run after \(s\) seconds.
\(C(s)=\)
Hint.
a) There are 1000 meters in a kilometer, think about how you would convert the output values to the correct units.
b) In this case, we want to write an expression with \(D\) that will give the total distance in kilometers when Sylvia has run for \(m\) minutes. The following example may be useful. Suppose Sylvia runs for 60 minutes. This should be the equivalent of running for 1 hour. Therefore,
\begin{equation*} K(60)=D(1). \end{equation*}
Remember that the input for \(D\) is the number of hours Sylvia has been running.
Another way to think about this is that
\begin{equation*} K(60)=D\left(\frac{60}{60}\right). \end{equation*}
Think about what this means in general for \(m\) minutes.
c) Using similar ideas to parts a) and b), we know there are 100000 centimeters in a kilometer and there are 3600 seconds in an hour.