Sub topic 5
Stretching and compressing vertically
Prerequisites and the main idea
Assume you can evaluate function notation, plot points, and recognize basic parent functions such as \(x^2\), \(|x|\), and \(\sqrt{x}\). A vertical transformation changes the output of a function:
\[ g(x)=a f(x) \]
The input \(x\) stays the same, so the horizontal position of every point is unchanged. The output \(y=f(x)\) is multiplied by \(a\).
If \((x,y)\) lies on \(y=f(x)\), then the corresponding point on \(y=g(x)\) is
\[ (x,y)\longrightarrow (x,ay). \]
Vertical stretches
When \(a>1\), every output is multiplied by a number greater than 1. The graph moves farther from the \(x\)-axis. This is a vertical stretch.
For example, let
\[ f(x)=x^2,\qquad g(x)=3f(x)=3x^2. \]
Some points on \(f\) are:
| \(x\) | \(f(x)=x^2\) | \(g(x)=3x^2\) |
|---|---|---|
| \(-2\) | 4 | 12 |
| \(-1\) | 1 | 3 |
| \(0\) | 0 | 0 |
| \(1\) | 1 | 3 |
| \(2\) | 4 | 12 |
The \(x\)-coordinates do not change. The nonzero \(y\)-coordinates become three times as large. The parabola becomes narrower because its points rise more quickly as \(x\) moves away from zero.
Vertical compressions
When \(0<a<1\), every output is multiplied by a fraction. The graph moves closer to the \(x\)-axis. This is a vertical compression.
For example,
\[ g(x)=\frac12 f(x)=\frac12 x^2. \]
The point \((2,4)\) becomes \((2,2)\), and \((-2,4)\) becomes \((-2,2)\). The parabola becomes wider because its outputs grow more slowly.
The factor \(a\) controls the distance from the \(x\)-axis:
| Value of \(a\) | Effect on \(y=f(x)\) |
|---|---|
| \(a>1\) | Vertical stretch |
| \(0<a<1\) | Vertical compression |
| \(a=1\) | No change |
| \(a=0\) | Every output becomes 0 |
Negative factors and reflections
If \(a<0\), the negative sign reflects the graph across the \(x\)-axis. The absolute value \(|a|\) still controls the vertical stretch or compression:
\[ g(x)=a f(x)=(-|a|)f(x). \]
For example,
\[ g(x)=-2|x| \]
reflects \(y=|x|\) across the \(x\)-axis and stretches it vertically by a factor of 2. The point \((3,3)\) becomes \((3,-6)\).
The mapping rule works for positive and negative factors:
\[ (x,y)\longrightarrow (x,ay). \]
caption: How the multiplier changes a point on a function graph
alt: A flowchart showing that multiplying the output by a changes the point from x comma y to x comma a y, with different effects for values of a.
flowchart TD
A["Point (x, y) on f"] --> B["Multiply y by a"]
B --> C["New point (x, a·y)"]
C --> D{"Value of a"}
D --> E["a > 1: stretch"]
D --> F["0 < a < 1: compression"]
D --> G["a < 0: reflect and scale"]Domain and range effects
A vertical transformation leaves the domain unchanged because no input values are added or removed. The range can change.
If the original range is \(y\ge 0\), then multiplying by a positive \(a\) keeps the range \(y\ge0\). Multiplying by a negative \(a\) changes it to \(y\le0\). For example, \(f(x)=x^2\) has range \([0,\infty)\), while \(-2x^2\) has range \((-\infty,0]\).
A common error is to use \(1/a\) for a vertical transformation. The factor is \(a\) itself. Reciprocals belong to horizontal transformations, where the input is changed.
def vertical_transform(f, a):
"""Return g(x) = a*f(x), a vertical transformation of f."""
return lambda x: a * f(x)
f = lambda x: x ** 2
g = vertical_transform(f, -2)
for x in [-2, -1, 0, 1, 2]:
print((x, f(x)), "->", (x, g(x)))Exercise
The graph of f contains the point (4, -3). Where does this point move under g(x) = -1/2 f(x), and what transformation occurs?
Show answer
It moves to (4, 3/2). The graph is reflected across the x-axis and vertically compressed by a factor of 1/2.