Mathwords logoMathwords

Compression of a Graph — Definition, Formula & Examples

Shrink
Compression of a Graph

A transformation in which all distances on the coordinate plane are shortened by multiplying either all x-coordinates (horizontal compression) or all y-coordinates (vertical compression) of a graph by a common factor less than 1.

Note: When the common factor is greater than 1 the transformation is called a dilation or a stretch.

 

Two sine waves: "Original graph" with full amplitude, and "Same graph, vertically compressed" with reduced amplitude.

 

 

See also

Graph of an equation, compression of a geometric figure

Key Formula

Vertical compression: y=af(x),0<a<1Horizontal compression: y=f(bx),b>1\begin{gathered}\text{Vertical compression: } y = a \cdot f(x), \quad 0 < a < 1\\\text{Horizontal compression: } y = f(bx), \quad b > 1\end{gathered}
Where:
  • f(x)f(x) = The original (parent) function
  • aa = Vertical compression factor; must satisfy 0 < a < 1 to compress the graph toward the x-axis
  • bb = Horizontal compression parameter; when b > 1, the graph is compressed toward the y-axis by a factor of 1/b

Worked Example

Problem: The parent function is f(x) = x². Graph the vertical compression g(x) = (1/2)x² and describe the transformation.
Step 1: Identify the compression factor. Here a = 1/2, which is between 0 and 1, so this is a vertical compression.
g(x)=12f(x)=12x2g(x) = \tfrac{1}{2}\,f(x) = \tfrac{1}{2}\,x^2
Step 2: Choose key points on the parent function f(x) = x². For example: (0, 0), (1, 1), (2, 4), (−2, 4).
Step 3: Multiply each y-coordinate by 1/2 to get the new points.
(0,0)(0,0),(1,1)(1,12),(2,4)(2,2),(2,4)(2,2)(0, 0) \to (0, 0),\quad (1, 1) \to (1, \tfrac{1}{2}),\quad (2, 4) \to (2, 2),\quad (-2, 4) \to (-2, 2)
Step 4: Plot the new points and connect them. The parabola is wider and closer to the x-axis than the original because every output is half as far from the x-axis.
Answer: g(x) = (1/2)x² is the graph of x² compressed vertically by a factor of 1/2. Each point is half as high as the corresponding point on the parent graph.

Another Example

This example demonstrates horizontal compression, which affects x-coordinates instead of y-coordinates. It also shows how compression applies to trigonometric functions, where changing the period is a common application.

Problem: The parent function is f(x) = sin(x). Graph the horizontal compression h(x) = sin(3x) and describe the transformation.
Step 1: Identify the compression parameter. Here b = 3, which is greater than 1, so the graph is compressed horizontally by a factor of 1/3.
h(x)=f(3x)=sin(3x)h(x) = f(3x) = \sin(3x)
Step 2: Choose key points on f(x) = sin(x) for one period: (0, 0), (π/2, 1), (π, 0), (3π/2, −1), (2π, 0).
Step 3: Divide each x-coordinate by 3 (multiply by 1/b = 1/3) while keeping y-coordinates the same.
(0,0)(0,0),(π2,1)(π6,1),(π,0)(π3,0),(3π2,1)(π2,1),(2π,0)(2π3,0)(0, 0) \to (0, 0),\quad (\tfrac{\pi}{2}, 1) \to (\tfrac{\pi}{6}, 1),\quad (\pi, 0) \to (\tfrac{\pi}{3}, 0),\quad (\tfrac{3\pi}{2}, -1) \to (\tfrac{\pi}{2}, -1),\quad (2\pi, 0) \to (\tfrac{2\pi}{3}, 0)
Step 4: The new period is 2π/3 instead of 2π. The sine wave completes three full cycles in the same interval the original completes one.
New period=2π3\text{New period} = \frac{2\pi}{3}
Answer: h(x) = sin(3x) is the graph of sin(x) compressed horizontally by a factor of 1/3. The wave oscillates three times faster, with a period of 2π/3.

Frequently Asked Questions

What is the difference between compression and stretching of a graph?
Compression and stretching are opposite transformations. A compression shrinks the graph toward an axis (the multiplier on y-values is between 0 and 1, or the multiplier on x inside the function is greater than 1). A stretch pulls the graph away from an axis. They use the same formulas, but with different ranges for the constant.
How do you tell if a transformation is a horizontal or vertical compression?
Look at where the constant appears. If it multiplies the entire function output — like y = a·f(x) with 0 < a < 1 — the compression is vertical (toward the x-axis). If it multiplies the input variable — like y = f(bx) with b > 1 — the compression is horizontal (toward the y-axis). Vertical compression changes y-values; horizontal compression changes x-values.
Why does a number greater than 1 inside the function cause a horizontal compression instead of a stretch?
When you replace x with bx (b > 1), the function reaches the same output values at x-values that are 1/b times as large. For example, f(2·1) = f(2), meaning the point that was at x = 2 now appears at x = 1. Every point moves closer to the y-axis, which is a compression. The factor that actually scales the x-coordinates is 1/b, which is less than 1.

Compression vs. Stretch (Dilation)

CompressionStretch (Dilation)
DefinitionGraph is shrunk toward an axisGraph is pulled away from an axis
Vertical formulay = a·f(x), where 0 < a < 1y = a·f(x), where a > 1
Horizontal formulay = f(bx), where b > 1y = f(bx), where 0 < b < 1
Effect on shapeGraph appears narrower or flatterGraph appears wider or taller
y-values (vertical case)Move closer to the x-axisMove farther from the x-axis

Why It Matters

Graph compressions appear throughout algebra and precalculus whenever you study function transformations. In trigonometry, horizontal compression directly controls the period of sine and cosine waves, which is essential for modeling sound, light, and other periodic phenomena. Understanding compression also prepares you for calculus, where scaling a function affects its derivatives and integrals.

Common Mistakes

Mistake: Confusing the direction of horizontal compression. Students see f(3x) and think the graph stretches by 3 instead of compressing by 1/3.
Correction: Remember that multiplying the input by b > 1 makes the function reach each value sooner, pulling the graph closer to the y-axis. The actual scaling factor on x-coordinates is 1/b, not b.
Mistake: Applying the compression factor to the wrong coordinate. For example, compressing y-values when the factor is inside the function argument.
Correction: A factor outside the function (multiplying the output) affects y-coordinates. A factor inside the function (multiplying the input) affects x-coordinates. Identify where the constant sits before transforming points.

Related Terms