Unit 1, lesson 13

Stretches and Compressions of Graphs

How multiplying the outputs or the inputs of a function stretches or compresses its graph, why a multiplier on the input acts by its reciprocal, and how to track points when stretches and shifts are combined.

  • Theory part 25
  • Practice part 26
  • Transformations of Graphs

Draw a graph on a sheet of rubber and pull the sheet up and down, away from the xx-axis. The curve gets taller, yet every point on the xx-axis stays where it was. Multiplying the outputs of a function by a constant does exactly this. Multiplying the inputs pulls or squeezes the sheet sideways instead, and there the effect runs opposite to the number in the formula.

Key terms

Vertical stretch and compression

Definition Let ff be a function and let a>0a > 0 be a constant. The function g(x)=af(x)g(x) = a f(x) has the same domain as ff, and a point (x,y)(x, y) lies on the graph of ff exactly when (x,ay)(x, ay) lies on the graph of gg. If a>1a > 1 the graph of gg is a vertical stretch of the graph of ff by the factor aa. If 0<a<10 < a < 1 it is a vertical compression by the factor aa. Every distance from the xx-axis is multiplied by aa, so points on the xx-axis stay fixed, the zeros of gg are the zeros of ff, and the range of gg consists of the numbers ayay with yy in the range of ff.

In plain words Each point moves straight up or down until it is aa times as far from the xx-axis as before. The inputs do not change, only the outputs.

Example Let f(x)=x2−4f(x) = x^2 - 4, with zeros −2-2 and 22 and lowest point (0,−4)(0, -4). Compare it with 3f(x)=3x2−123f(x) = 3x^2 - 12 and 12f(x)=12x2−2\frac{1}{2} f(x) = \frac{1}{2} x^2 - 2.

xxf(x)f(x)3f(x)3f(x)12f(x)\frac{1}{2} f(x)
−3-355151552\frac{5}{2}
−2-2000000
00−4-4−12-12−2-2
11−3-3−9-9−32-\frac{3}{2}
22000000

The zeros stay at ±2\pm 2. The lowest point moves down to (0,−12)(0, -12) under the stretch and up to (0,−2)(0, -2) under the compression, and the range [−4,∞)[-4, \infty) becomes [−12,∞)[-12, \infty) and [−2,∞)[-2, \infty).

Horizontal compression and stretch

Definition Let ff be a function and let b>0b > 0 be a constant. The function g(x)=f(bx)g(x) = f(bx) is defined at xx exactly when bxbx is in the domain of ff. Since

g(xb)=f(b⋅xb)=f(x),g\left(\frac{x}{b}\right) = f\left(b \cdot \frac{x}{b}\right) = f(x),

a point (x,y)(x, y) lies on the graph of ff exactly when (xb,y)\left(\frac{x}{b}, y\right) lies on the graph of gg. If b>1b > 1 the graph of gg is a horizontal compression of the graph of ff toward the yy-axis by the factor 1b\frac{1}{b}. If 0<b<10 < b < 1 it is a horizontal stretch away from the yy-axis by the factor 1b\frac{1}{b}. Points on the yy-axis stay fixed, and the range does not change.

In plain words The new function gives the output f(x)f(x) at the input xb\frac{x}{b} instead of at xx. For b=2b = 2 every input is halved, so the graph is squeezed to half its width.

Example Let f(x)=x2−4xf(x) = x^2 - 4x, with zeros 00 and 44 and lowest point (2,−4)(2, -4). Then

g(x)=f(2x)=(2x)2−4(2x)=4x2−8x=4x(x−2),\begin{aligned} g(x) &= f(2x) \\[0.4em] &= (2x)^2 - 4(2x) \\[0.4em] &= 4x^2 - 8x \\[0.4em] &= 4x(x - 2), \end{aligned}

with zeros 00 and 22 and lowest point (1,−4)(1, -4). Every first coordinate is halved and every height stays the same. The point (4,0)(4, 0) moves to (2,0)(2, 0), while (0,0)(0, 0) on the yy-axis does not move. Squeezing also makes the graph steeper. The secant line of ff through (2,−4)(2, -4) and (4,0)(4, 0) has slope 22, and the matching secant line of gg through (1,−4)(1, -4) and (2,0)(2, 0) has slope 44. This doubling of slopes is why the derivative of f(2x)f(2x) carries a factor 22 in the chain rule.

Multiplier

Definition In the formula g(x)=af(bx)g(x) = a f(bx) with nonzero constants aa and bb, the number aa is the outside multiplier and bb is the inside multiplier. The outside multiplier multiplies each output after ff has acted. The inside multiplier multiplies each input before ff acts. When the input of ff also contains a constant, as in 2x+62x + 6, the inside multiplier is still the coefficient 22 of xx. Factoring the input as 2(x+3)2(x + 3) shows that this 22 multiplies the whole of x+3x + 3, which matters once stretches and shifts are combined.

In plain words Outside, a multiplier does what it says to the heights. Inside, it does the opposite to the widths, because a bigger multiplier on the input makes ff reach each value closer to the yy-axis.

Example Take f(x)=x3f(x) = x^3 and the multiplier 22 in both places. At x=1x = 1 the outside version gives 2f(1)=22f(1) = 2 and the inside version gives f(2)=8f(2) = 8. The point (2,8)(2, 8) on the graph of ff goes to (2,16)(2, 16) on the graph of y=2f(x)y = 2f(x) and to (1,8)(1, 8) on the graph of y=f(2x)y = f(2x). For this particular ff the identity (2x)3=8x3(2x)^3 = 8x^3 shows that the inside multiplier 22 has the same effect as the outside multiplier 88. That does not happen in general. For f(x)=x2−4xf(x) = x^2 - 4x every graph y=af(x)y = af(x) with a≠0a \ne 0 has zeros 00 and 44, while f(2x)f(2x) has zeros 00 and 22, so no outside multiplier can match it.

Scale factor

Definition A scale factor is the positive number by which a stretch or compression multiplies distances in one direction. For g(x)=af(x)g(x) = a f(x) with a≠0a \ne 0 the vertical scale factor is ∣a∣\lvert a \rvert, with distances measured from the xx-axis. For g(x)=f(bx)g(x) = f(bx) with b≠0b \ne 0 the horizontal scale factor is 1∣b∣\frac{1}{\lvert b \rvert}, with distances measured from the yy-axis. A scale factor greater than 11 gives a stretch and one between 00 and 11 gives a compression. A negative multiplier adds a reflection, across the xx-axis when a<0a < 0 and across the yy-axis when b<0b < 0. In every case a point (x,y)(x, y) on the graph of ff corresponds to a point on the graph of g(x)=af(bx)g(x) = a f(bx) by the rule

(x,y) ⟼ (xb, ay).(x, y) \ \longmapsto \ \left(\frac{x}{b},\ ay\right).

In plain words The scale factor says how much bigger or smaller the graph gets in one direction. Read it straight from an outside multiplier, and take the reciprocal of an inside one. The sign only decides whether the graph also flips.

Example Suppose ff has domain [−3,6][-3, 6] and its graph passes through (6,1)(6, 1), and let g(x)=−2f(x3)g(x) = -2f\left(\frac{x}{3}\right). The inside multiplier 13\frac{1}{3} gives the horizontal scale factor 33, a stretch. The outside multiplier −2-2 gives the vertical scale factor 22 together with a reflection across the xx-axis. The point (6,1)(6, 1) goes to (18,−2)(18, -2), and indeed g(18)=−2f(6)=−2g(18) = -2f(6) = -2. The domain of gg is [−9,18][-9, 18], since g(x)g(x) needs x3\frac{x}{3} to lie in [−3,6][-3, 6].

Dilation

Definition For a constant k>0k > 0, the dilation of the plane centered at the origin with scale factor kk sends each point (x,y)(x, y) to (kx,ky)(kx, ky). The vertical dilation with factor kk sends (x,y)(x, y) to (x,ky)(x, ky) and keeps the xx-axis fixed, and the horizontal dilation with factor kk sends (x,y)(x, y) to (kx,y)(kx, y) and keeps the yy-axis fixed. These three maps carry the graph of y=f(x)y = f(x) onto the graphs of

y=kf(xk),y=kf(x),y=f(xk)\begin{gathered} y = k f\left(\frac{x}{k}\right), \\[0.8em] y = k f(x), \\[0.8em] y = f\left(\frac{x}{k}\right) \end{gathered}

respectively. The word dilation covers both stretches, with k>1k > 1, and compressions, with 0<k<10 < k < 1.

In plain words A dilation centered at the origin is a zoom. It changes the size of the picture but not its shape. A dilation in one direction pulls the picture one way only, which in general does change the shape.

Example Zoom the parabola y=x2y = x^2 by the factor 22 about the origin. The first rule gives

y=2(x2)2=x22.y = 2\left(\frac{x}{2}\right)^2 = \frac{x^2}{2}.

The point (2,4)(2, 4) goes to (4,8)(4, 8), and indeed 422=8\frac{4^2}{2} = 8. In the same way the zoom with factor k=1ck = \frac{1}{c} carries y=x2y = x^2 onto y=cx2y = cx^2 for any c>0c > 0, so all these parabolas have the same shape and differ only in size. Parabolas are special in this way, because the vertical dilation y=cx2y = cx^2 of y=x2y = x^2 is also a zoom of it. A semicircle stretched vertically, by contrast, becomes half of an ellipse and really changes shape.

Stretches combined with shifts

Definition For constants a≠0a \ne 0, b≠0b \ne 0, hh and kk, consider

g(x)=af(b(x−h))+k.g(x) = a f\big(b(x - h)\big) + k.

For each point (x,y)(x, y) on the graph of ff the point (xb+h, ay+k)\left(\frac{x}{b} + h,\ ay + k\right) lies on the graph of gg, because

g(xb+h)=af(b⋅xb)+k=af(x)+k=ay+k.\begin{aligned} g\left(\frac{x}{b} + h\right) &= a f\left(b \cdot \frac{x}{b}\right) + k \\[0.8em] &= a f(x) + k \\[0.4em] &= ay + k. \end{aligned}

So the first coordinate is scaled by 1b\frac{1}{b} and then shifted by hh, and the second is scaled by aa and then shifted by kk. With aa and bb equal to 11 or −1-1 this is the rule (x,y)↦(bx+h,ay+k)(x, y) \mapsto (bx + h, ay + k) for shifts and reflections, since then xb=bx\frac{x}{b} = bx. When the input is written as bx−cbx - c, factor out bb first,

bx−c=b(x−cb),bx - c = b\left(x - \frac{c}{b}\right),

so the horizontal shift is cb\frac{c}{b} and not cc.

In plain words Rewrite the inside until it reads b(x−h)b(x - h). Then move each point by scaling first and shifting second, in both directions.

Example Start from f(x)=xf(x) = \sqrt{x} and take g(x)=23x−6+1g(x) = 2\sqrt{3x - 6} + 1. Factoring gives g(x)=23(x−2)+1g(x) = 2\sqrt{3(x - 2)} + 1, so a=2a = 2, b=3b = 3, h=2h = 2 and k=1k = 1, and each point (x,y)(x, y) goes to (x3+2, 2y+1)\left(\frac{x}{3} + 2,\ 2y + 1\right).

Point on y=xy = \sqrt{x}Point on y=g(x)y = g(x)
(0,0)(0, 0)(2,1)(2, 1)
(1,1)(1, 1)(73,3)\left(\frac{7}{3}, 3\right)
(4,2)(4, 2)(103,5)\left(\frac{10}{3}, 5\right)
(9,3)(9, 3)(5,7)(5, 7)

As a check, g(5)=29+1=7g(5) = 2\sqrt{9} + 1 = 7. The domain of gg is [2,∞)[2, \infty), from 3x−6≥03x - 6 \ge 0. Reading 3x−63x - 6 as a shift by 66 would put the starting point at (6,1)(6, 1), but g(6)=212+1g(6) = 2\sqrt{12} + 1, which is not 11.

Check yourself

  1. The graph of ff passes through (−2,5)(-2, 5), (0,1)(0, 1) and (4,−3)(4, -3). Find the corresponding points on the graph of g(x)=3f(2x)g(x) = 3f(2x).
Show the answer

Each point (x,y)(x, y) goes to (x2,3y)\left(\frac{x}{2}, 3y\right), which gives (−1,15)(-1, 15), (0,3)(0, 3) and (2,−9)(2, -9). As a check, g(2)=3f(4)=−9g(2) = 3f(4) = -9.

  1. Compress the graph of y=xy = \sqrt{x} horizontally by the factor 14\frac{1}{4}, then stretch it vertically by the factor 33. Write the new function and find its value at x=1x = 1.
Show the answer

The horizontal compression by 14\frac{1}{4} uses the inside multiplier 44 and the vertical stretch uses the outside multiplier 33, so g(x)=34xg(x) = 3\sqrt{4x} and g(1)=3⋅2=6g(1) = 3 \cdot 2 = 6. Since 4x=2x\sqrt{4x} = 2\sqrt{x} for x≥0x \ge 0, the same graph is also y=6xy = 6\sqrt{x}.

  1. Explain how the graph of g(x)=(2x+6)2g(x) = (2x + 6)^2 comes from the graph of y=x2y = x^2.
Show the answer

Factor the inside as 2x+6=2(x+3)2x + 6 = 2(x + 3). Compress horizontally toward the yy-axis by the factor 12\frac{1}{2}, then shift left by 33. The vertex (0,0)(0, 0) goes to (−3,0)(-3, 0), and the point (2,4)(2, 4) goes to (1−3,4)=(−2,4)(1 - 3, 4) = (-2, 4). Indeed g(−3)=0g(-3) = 0 and g(−2)=22=4g(-2) = 2^2 = 4.

How this lesson connects

Where this leads in Calculus

Resources for this lesson