Transformations of Functions

Learn to shift, stretch, and flip any function

Think about the last time you edited a photo on your phone. You probably moved it around, zoomed in or out, maybe flipped it horizontally to make it look just right. What you were doing, mathematically speaking, was transforming an image. The original photo stayed recognizable, but its position, size, or orientation changed.

Functions work exactly the same way. Once you know what a basic function looks like, you can shift it up, down, left, or right. You can stretch it or compress it. You can flip it like a mirror image. And the beautiful thing is that all these transformations follow predictable rules. Master these rules, and you will be able to sketch complex functions quickly, understand equations at a glance, and see patterns that would otherwise be invisible.

This chapter is one of the most practical in pre-calculus. The techniques you learn here will follow you through calculus, physics, engineering, and anywhere else functions appear. And they appear everywhere.

Core Concepts

Parent Functions: Your Starting Point

Before you can transform something, you need to know what you are starting with. In function transformations, we call these starting points parent functions. They are the simplest, most basic versions of different function families.

Think of parent functions like templates. Just as a basic t-shirt template can be modified into countless different designs, each parent function can be transformed into infinitely many related functions. But they all share the same fundamental shape.

Here are the parent functions you should know:

Parent Function Equation Key Features
Linear $f(x) = x$ Straight line through origin, slope of 1
Quadratic $f(x) = x^2$ U-shaped parabola, vertex at origin
Cubic $f(x) = x^3$ S-shaped curve through origin
Absolute Value $f(x) = |x|$ V-shape, vertex at origin
Square Root $f(x) = \sqrt{x}$ Starts at origin, curves up to the right
Reciprocal $f(x) = \frac{1}{x}$ Two curved branches, avoids the axes

Spend some time getting to know these shapes. Sketch them, think about their domains and ranges, notice where they cross the axes. When you can picture each parent function in your mind, transformations become much easier because you are just adjusting a mental image you already have.

Vertical Shifts: Moving Up and Down

The simplest transformation is the vertical shift. When you add a constant to a function, the entire graph moves up or down.

For the function $g(x) = f(x) + k$:

  • If $k > 0$, the graph shifts up by $k$ units
  • If $k < 0$, the graph shifts down by $|k|$ units

This makes intuitive sense. If you add 3 to every output of a function, then every point on the graph will be 3 units higher than before. The shape does not change; everything just moves up.

Why does this work? Remember that $f(x)$ represents the y-coordinate (output) of any point on the graph. Adding $k$ to $f(x)$ adds $k$ to every y-coordinate, shifting every point vertically by the same amount.

Example 1: Vertical Shifts

Describe how $g(x) = x^2 + 4$ differs from the parent function $f(x) = x^2$.

Step 1: Identify the parent function. Here it is $f(x) = x^2$, the basic parabola.

Step 2: Identify the transformation. We have $+4$ added to the function, so $k = 4$.

Step 3: Interpret the transformation. Since $k = 4 > 0$, the graph shifts up 4 units.

Answer: The graph of $g(x) = x^2 + 4$ is the parabola $f(x) = x^2$ shifted up 4 units. The vertex moves from $(0, 0)$ to $(0, 4)$.

Horizontal Shifts: Moving Left and Right

Horizontal shifts are where things get a little counterintuitive. When you replace $x$ with $(x - h)$ in a function, the graph moves horizontally, but in the opposite direction from what you might expect.

For the function $g(x) = f(x - h)$:

  • If $h > 0$, the graph shifts right by $h$ units
  • If $h < 0$, the graph shifts left by $|h|$ units

Yes, that is correct: subtracting a positive number inside the function moves the graph to the right. It seems backwards, and this trips up almost everyone at first.

Why does this happen? Think about it this way. Consider the parent function $f(x) = x^2$, where the vertex is at $x = 0$ because that is where the input equals zero. Now look at $g(x) = (x - 3)^2$. When does the input to the squaring operation equal zero? When $x - 3 = 0$, which happens at $x = 3$. The vertex moved to the right to $x = 3$.

Another way to think about it: to get the same output from $g(x) = f(x - 3)$ as you would from $f(x)$, you need an input that is 3 units larger. You need to “compensate” for the subtraction by using a bigger $x$ value. That bigger $x$ value means the graph has shifted right.

Example 2: Horizontal Shifts

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

Step 1: Rewrite to match the standard form $f(x - h)$: $$g(x) = \sqrt{x + 2} = \sqrt{x - (-2)}$$

So $h = -2$.

Step 2: Interpret the transformation. Since $h = -2 < 0$, the graph shifts left by $|-2| = 2$ units.

Answer: The graph of $g(x) = \sqrt{x + 2}$ is the square root function shifted 2 units to the left. The starting point moves from $(0, 0)$ to $(-2, 0)$.

Check: The domain of $f(x) = \sqrt{x}$ is $x \geq 0$. The domain of $g(x) = \sqrt{x + 2}$ is $x \geq -2$. The domain shifted 2 units to the left, confirming our transformation.

Vertical Stretches and Compressions

When you multiply a function by a constant, you change how tall or short the graph is.

For the function $g(x) = a \cdot f(x)$:

  • If $|a| > 1$, the graph is vertically stretched (taller and narrower)
  • If $0 < |a| < 1$, the graph is vertically compressed (shorter and wider)

The factor $a$ multiplies every y-coordinate by $a$. If $a = 2$, every point is twice as far from the x-axis as before. If $a = \frac{1}{2}$, every point is half as far from the x-axis.

Points that start on the x-axis (where $y = 0$) do not move, since $a \cdot 0 = 0$. These are called anchor points because they stay fixed during vertical stretches and compressions.

Example 3: Vertical Stretch

Compare the graphs of $f(x) = x^2$ and $g(x) = 3x^2$.

Step 1: Identify the transformation. We have $g(x) = 3 \cdot f(x)$, so $a = 3$.

Step 2: Interpret. Since $|3| > 1$, this is a vertical stretch by a factor of 3.

Step 3: See the effect on specific points:

$x$ $f(x) = x^2$ $g(x) = 3x^2$
0 0 0
1 1 3
2 4 12
-1 1 3

Answer: The graph of $g(x) = 3x^2$ is the parabola $f(x) = x^2$ stretched vertically by a factor of 3. It passes through the origin (anchor point) and rises three times as fast on both sides. The parabola looks “narrower” because it is stretched upward.

Horizontal Stretches and Compressions

Just as vertical transformations involve multiplying the output, horizontal transformations involve multiplying the input.

For the function $g(x) = f(bx)$:

  • If $|b| > 1$, the graph is horizontally compressed (narrower)
  • If $0 < |b| < 1$, the graph is horizontally stretched (wider)

Notice that this is again opposite from what you might expect. A larger value of $b$ makes the graph narrower, not wider.

Why? When $b > 1$, the function reaches the same outputs at smaller x-values. If $f(x) = x^2$ equals 4 when $x = 2$, then $g(x) = (2x)^2$ equals 4 when $x = 1$. The graph is “compressed” horizontally because everything happens at half the x-values.

Example 4: Horizontal Compression

Describe the transformation from $f(x) = |x|$ to $g(x) = |2x|$.

Step 1: Identify the transformation. We have $g(x) = f(2x)$, so $b = 2$.

Step 2: Interpret. Since $|2| > 1$, this is a horizontal compression by a factor of $\frac{1}{2}$ (or equivalently, compressed by a factor of 2).

Step 3: See the effect on specific points:

  • On $f(x) = |x|$, the point $(2, 2)$ satisfies $f(2) = |2| = 2$
  • On $g(x) = |2x|$, where do we get output 2? When $|2x| = 2$, so $x = 1$
  • The point $(2, 2)$ on $f$ corresponds to $(1, 2)$ on $g$

Answer: The graph of $g(x) = |2x|$ is the absolute value function compressed horizontally by a factor of 2. The V-shape is twice as steep; it reaches the same heights at half the x-distance from the origin.

Reflections: Flipping the Graph

Reflections flip the graph across an axis. There are two types:

Reflection over the x-axis: $g(x) = -f(x)$

This multiplies every y-coordinate by $-1$, flipping the graph upside down. Points above the x-axis go below, and points below go above.

Reflection over the y-axis: $g(x) = f(-x)$

This replaces every x-coordinate with its opposite. The left side of the graph becomes the right side, and vice versa.

Example 5: Reflections

Starting with $f(x) = \sqrt{x}$, describe: a) $g(x) = -\sqrt{x}$ b) $h(x) = \sqrt{-x}$

Part (a): $g(x) = -f(x)$ is a reflection over the x-axis.

The square root function normally curves upward from the origin. After reflection, it curves downward from the origin. The domain is still $x \geq 0$, but the range changes from $y \geq 0$ to $y \leq 0$.

Part (b): $h(x) = f(-x)$ is a reflection over the y-axis.

The original function exists only for $x \geq 0$ (in the right half of the plane). After reflection over the y-axis, it exists only for $x \leq 0$ (in the left half). The curve that went to the right now goes to the left.

Answer:

  • $g(x) = -\sqrt{x}$ flips the square root downward (reflection over x-axis)
  • $h(x) = \sqrt{-x}$ makes the square root extend to the left instead of right (reflection over y-axis)

Combining Transformations: Order Matters

Real-world functions often involve multiple transformations combined. The general form is:

$$g(x) = a \cdot f(b(x - h)) + k$$

Where:

  • $a$ controls vertical stretch/compression and reflection over x-axis
  • $b$ controls horizontal stretch/compression and reflection over y-axis
  • $h$ controls horizontal shift
  • $k$ controls vertical shift

The order in which you apply transformations matters. Here is the standard order:

  1. Horizontal transformations (inside the function, applied to $x$):

    • First, horizontal stretch/compression by factor $\frac{1}{|b|}$
    • Then, reflection over y-axis if $b < 0$
    • Then, horizontal shift by $h$
  2. Vertical transformations (outside the function, applied to outputs):

    • First, vertical stretch/compression by factor $|a|$
    • Then, reflection over x-axis if $a < 0$
    • Then, vertical shift by $k$

A helpful memory trick: transformations work “inside-out” for the horizontal direction and “outside-in” for the vertical direction. The operations closest to the $x$ happen first horizontally; the operations closest to the $f$ happen first vertically.

Example 6: Multiple Transformations

Graph $g(x) = -2(x + 3)^2 + 5$ by identifying and applying transformations to the parent function $f(x) = x^2$.

Step 1: Identify all transformations by comparing to $a \cdot f(b(x - h)) + k$:

  • $a = -2$, so vertical stretch by 2 and reflection over x-axis
  • $b = 1$ (no horizontal stretch)
  • $h = -3$ (rewrite $x + 3$ as $x - (-3)$), so horizontal shift left 3
  • $k = 5$, so vertical shift up 5

Step 2: Apply transformations to key points. Start with points on $f(x) = x^2$:

Point on $f(x) = x^2$ $(0, 0)$ $(1, 1)$ $(-1, 1)$ $(2, 4)$

Step 3: Apply horizontal shift (left 3):

After horizontal shift $(-3, 0)$ $(-2, 1)$ $(-4, 1)$ $(-1, 4)$

Step 4: Apply vertical stretch by 2:

After vertical stretch $(-3, 0)$ $(-2, 2)$ $(-4, 2)$ $(-1, 8)$

Step 5: Apply reflection over x-axis (multiply y by $-1$):

After reflection $(-3, 0)$ $(-2, -2)$ $(-4, -2)$ $(-1, -8)$

Step 6: Apply vertical shift up 5:

Final points on $g(x)$ $(-3, 5)$ $(-2, 3)$ $(-4, 3)$ $(-1, -3)$

Answer: The graph of $g(x) = -2(x + 3)^2 + 5$ is a parabola that:

  • Opens downward (due to the negative)
  • Has vertex at $(-3, 5)$
  • Is narrower than the parent parabola (due to the factor of 2)
  • Is symmetric about the line $x = -3$

Writing Equations from Graphs

Sometimes you will need to work backwards: given a transformed graph, write its equation. This requires identifying what transformations were applied.

Strategy for writing equations from graphs:

  1. Identify the parent function by recognizing the basic shape (parabola, V-shape, square root curve, etc.)

  2. Find key reference points, especially:

    • The vertex (for parabolas and absolute value)
    • The starting point (for square root)
    • A point where you can determine the stretch factor
  3. Determine the transformations:

    • Horizontal and vertical shifts from the reference point
    • Vertical stretch/compression from how steep or flat the graph is
    • Reflections from the orientation
  4. Write the equation in the form $g(x) = a \cdot f(b(x - h)) + k$

Example 7: Writing an Equation from a Graph

A parabola has its vertex at $(2, -1)$ and passes through the point $(4, 7)$. Write its equation.

Step 1: Identify the parent function. It is a parabola, so we start with $f(x) = x^2$.

Step 2: Determine the shifts from the vertex. The vertex of $x^2$ is at $(0, 0)$. This vertex is at $(2, -1)$, so:

  • Horizontal shift: $h = 2$ (right 2)
  • Vertical shift: $k = -1$ (down 1)

So far: $g(x) = a(x - 2)^2 - 1$

Step 3: Find the vertical stretch factor $a$ using the other point $(4, 7)$.

Substitute $x = 4$ and $g(x) = 7$: $$7 = a(4 - 2)^2 - 1$$ $$7 = a(4) - 1$$ $$8 = 4a$$ $$a = 2$$

Step 4: Write the final equation.

Answer: $g(x) = 2(x - 2)^2 - 1$

Check: At $x = 2$: $g(2) = 2(0)^2 - 1 = -1$. The vertex is $(2, -1)$. At $x = 4$: $g(4) = 2(4)^2 - 1 = 2(4) - 1 = 7$. The point $(4, 7)$ is on the graph.

Notation and Terminology

Term Definition
Parent function The simplest form of a function family, used as the starting point for transformations
Transformation An operation that changes the position, size, or orientation of a graph
Vertical shift Moving a graph up or down; written as $f(x) + k$
Horizontal shift Moving a graph left or right; written as $f(x - h)$
Vertical stretch Making a graph taller; occurs when $|a| > 1$ in $a \cdot f(x)$
Vertical compression Making a graph shorter; occurs when $0 < |a| < 1$ in $a \cdot f(x)$
Horizontal compression Making a graph narrower; occurs when $|b| > 1$ in $f(bx)$
Horizontal stretch Making a graph wider; occurs when $0 < |b| < 1$ in $f(bx)$
Reflection Flipping a graph across an axis; $-f(x)$ reflects over x-axis, $f(-x)$ over y-axis
Anchor point A point that remains fixed during a transformation (typically on the axis of reflection or at $y = 0$ for vertical stretches)

Key Properties and Rules

Transformation Rules at a Glance

Transformation Equation Form Effect
Vertical shift up $k$ $f(x) + k$ Every point moves up $k$ units
Vertical shift down $k$ $f(x) - k$ Every point moves down $k$ units
Horizontal shift right $h$ $f(x - h)$ Every point moves right $h$ units
Horizontal shift left $h$ $f(x + h)$ Every point moves left $h$ units
Vertical stretch by $a$ $a \cdot f(x)$ with $a > 1$ Graph is taller by factor of $a$
Vertical compression by $a$ $a \cdot f(x)$ with $0 < a < 1$ Graph is shorter by factor of $a$
Horizontal compression by $b$ $f(bx)$ with $b > 1$ Graph is narrower by factor of $b$
Horizontal stretch by $b$ $f(bx)$ with $0 < b < 1$ Graph is wider by factor of $\frac{1}{b}$
Reflection over x-axis $-f(x)$ Graph flips upside down
Reflection over y-axis $f(-x)$ Graph flips left-right

The General Form

The most general transformed function can be written as:

$$g(x) = a \cdot f(b(x - h)) + k$$

  • Vertex or key point is at $(h, k)$
  • $|a|$ determines vertical stretch/compression
  • If $a < 0$, there is a reflection over the x-axis
  • $|b|$ determines horizontal stretch/compression (graph width is divided by $|b|$)
  • If $b < 0$, there is a reflection over the y-axis

Transformation Order

When graphing, apply transformations in this order:

  1. Horizontal stretch/compression (factor of $\frac{1}{|b|}$)
  2. Reflection over y-axis (if $b < 0$)
  3. Horizontal shift (by $h$ units)
  4. Vertical stretch/compression (factor of $|a|$)
  5. Reflection over x-axis (if $a < 0$)
  6. Vertical shift (by $k$ units)

Effects on Domain and Range

Transformations affect domain and range in predictable ways:

Transformation Effect on Domain Effect on Range
Vertical shift by $k$ No change Shifts by $k$
Horizontal shift by $h$ Shifts by $h$ No change
Vertical stretch/compression No change Multiplied by $|a|$
Horizontal stretch/compression Divided by $|b|$ No change
Reflection over x-axis No change Negated
Reflection over y-axis Negated No change

Real-World Applications

Sound and Music

Sound waves are functions of time, and audio effects are transformations:

  • Volume control is a vertical stretch or compression. Turning up the volume multiplies the wave’s amplitude.
  • Pitch shifting involves horizontal compression or stretch. Compressing a sound wave (making it narrower in time) raises its pitch.
  • Reverb and echo involve horizontal shifts, adding delayed copies of the original sound.

When a musician says they are playing a song “in a different key,” they are essentially applying a vertical shift to the frequency function.

Economics and Business

In economics, supply and demand curves are functions, and market changes transform them:

  • A new tax shifts supply curves vertically (prices increase by the tax amount)
  • A change in consumer preferences shifts demand curves horizontally (more or fewer people want to buy at each price)
  • Scaling a business involves stretching production functions

When economists talk about “shifting the curve,” they are speaking literally about function transformations.

Physics and Engineering

Physical systems often involve transformed functions:

  • The position of a bouncing ball involves a reflected parabola (gravity pulls down, creating $-t^2$ instead of $t^2$)
  • Electrical signals are transformed versions of input signals; amplifiers stretch, filters shift, and inverters reflect
  • Bridges and arches often use parabolic shapes, positioned and scaled using transformations

Computer Graphics

Video games and animations use transformations constantly:

  • Moving a character involves horizontal and vertical shifts
  • Zooming in or out involves stretches and compressions
  • Mirroring an image for a reflection in water involves reflection transformations

The coordinate transformations in computer graphics are directly based on the function transformations you are learning here.

Medical Imaging

Medical devices like EKG machines display heart rhythms as functions of time. Doctors learn to recognize:

  • Shifted peaks (timing abnormalities)
  • Stretched or compressed waves (rate changes)
  • Inverted waves (certain heart conditions)

Understanding that these are transformations of a normal heart rhythm helps in diagnosis.

Self-Test Problems

Problem 1: Describe the transformation(s) that convert $f(x) = |x|$ into $g(x) = |x - 4| + 2$.

Show Answer

The function $g(x) = |x - 4| + 2$ involves:

  • A horizontal shift right by 4 units (due to $x - 4$ inside)
  • A vertical shift up by 2 units (due to $+ 2$ outside)

The vertex of the V-shape moves from $(0, 0)$ to $(4, 2)$.

Problem 2: Write the equation for the square root function $f(x) = \sqrt{x}$ after it has been shifted 3 units left and 5 units down.

Show Answer

Starting with $f(x) = \sqrt{x}$:

  • Shift left 3: replace $x$ with $x + 3$ to get $\sqrt{x + 3}$
  • Shift down 5: subtract 5 to get $\sqrt{x + 3} - 5$

Answer: $g(x) = \sqrt{x + 3} - 5$

Problem 3: The graph of $g(x) = -3(x + 1)^2 + 4$ is a transformation of $f(x) = x^2$. Identify the vertex, whether the parabola opens up or down, and whether it is stretched or compressed compared to the parent.

Show Answer

From $g(x) = -3(x + 1)^2 + 4$:

  • $h = -1$ (rewrite $x + 1$ as $x - (-1)$)
  • $k = 4$
  • $a = -3$

Vertex: $(-1, 4)$

Opens: Downward (because $a = -3 < 0$)

Stretch/Compression: Vertically stretched by a factor of 3 (because $|a| = 3 > 1$), making it narrower than the parent parabola.

Problem 4: Starting with the function $f(x) = x^3$, apply these transformations in order: reflect over the x-axis, then shift right 2, then shift up 1. Write the final equation.

Show Answer

Starting with $f(x) = x^3$:

Step 1: Reflect over x-axis: $-x^3$

Step 2: Shift right 2: $-(x-2)^3$

Step 3: Shift up 1: $-(x-2)^3 + 1$

Answer: $g(x) = -(x - 2)^3 + 1$

Problem 5: A transformed absolute value function has its vertex at $(3, -2)$ and passes through the point $(5, 4)$. Write its equation.

Show Answer

The parent function is $f(x) = |x|$ with vertex at $(0, 0)$.

Step 1: The vertex is at $(3, -2)$, so $h = 3$ and $k = -2$: $$g(x) = a|x - 3| - 2$$

Step 2: Use the point $(5, 4)$ to find $a$: $$4 = a|5 - 3| - 2$$ $$4 = a(2) - 2$$ $$6 = 2a$$ $$a = 3$$

Answer: $g(x) = 3|x - 3| - 2$

Problem 6: How does the graph of $f(x) = \frac{1}{x}$ change when transformed to $g(x) = \frac{1}{x - 2} + 3$? What are the new asymptotes?

Show Answer

The function $g(x) = \frac{1}{x - 2} + 3$ is the reciprocal function transformed by:

  • Horizontal shift right 2 (due to $x - 2$)
  • Vertical shift up 3 (due to $+ 3$)

The original asymptotes of $f(x) = \frac{1}{x}$ are:

  • Vertical asymptote: $x = 0$
  • Horizontal asymptote: $y = 0$

After shifting right 2 and up 3:

  • New vertical asymptote: $x = 2$
  • New horizontal asymptote: $y = 3$

The “center” of the hyperbola moves from $(0, 0)$ to $(2, 3)$.

Problem 7: Match each equation to its description:

a) $y = 2\sqrt{x}$ b) $y = \sqrt{2x}$ c) $y = \sqrt{x - 2}$ d) $y = \sqrt{x} - 2$

Descriptions: i. Horizontal shift right 2 ii. Vertical shift down 2 iii. Vertical stretch by factor of 2 iv. Horizontal compression by factor of 2

Show Answer

a) $y = 2\sqrt{x}$ matches iii. Vertical stretch by factor of 2 (the 2 multiplies the output)

b) $y = \sqrt{2x}$ matches iv. Horizontal compression by factor of 2 (the 2 multiplies the input)

c) $y = \sqrt{x - 2}$ matches i. Horizontal shift right 2 (subtracting 2 from input)

d) $y = \sqrt{x} - 2$ matches ii. Vertical shift down 2 (subtracting 2 from output)

Summary

  • Parent functions are the basic building blocks: linear ($x$), quadratic ($x^2$), cubic ($x^3$), absolute value ($|x|$), square root ($\sqrt{x}$), and reciprocal ($\frac{1}{x}$). Know their shapes.

  • Vertical shifts $f(x) + k$ move the graph up (when $k > 0$) or down (when $k < 0$).

  • Horizontal shifts $f(x - h)$ move the graph right (when $h > 0$) or left (when $h < 0$). Remember: the direction is opposite to the sign you see.

  • Vertical stretches and compressions $a \cdot f(x)$ make the graph taller ($|a| > 1$) or shorter ($|a| < 1$).

  • Horizontal stretches and compressions $f(bx)$ make the graph narrower ($|b| > 1$) or wider ($|b| < 1$). Again, opposite to what you might expect.

  • Reflections flip the graph: $-f(x)$ reflects over the x-axis; $f(-x)$ reflects over the y-axis.

  • The general form $g(x) = a \cdot f(b(x - h)) + k$ combines all transformations. The vertex or key point ends up at $(h, k)$.

  • Order matters when applying multiple transformations. Apply horizontal transformations first (inside-out), then vertical transformations (outside-in).

  • Transformations have predictable effects on domain and range: horizontal changes affect domain, vertical changes affect range.

  • To write equations from graphs, identify the parent function, find the vertex or key point, determine the stretch factor using another point, and assemble the equation.

  • Function transformations appear everywhere in the real world: music, economics, physics, computer graphics, and medicine all use these same principles.