Math Core

Lesson 1.2 · Functions

Transformations of functions

You already know that f(x−h)+kf(x - h) + k slides a graph and that a negative sign flips it. Precalculus asks more of you: transforming functions you only know from a graph or a few points, handling a horizontal stretch and a shift in the same expression, and predicting exactly how the domain and range move. The key is to treat every transformation as a rule that moves points, and to keep careful track of the order.

One rule for every transformation

The general transformation

Write the new function in the form

g(x)=a f(b(x−h))+kg(x) = a\,f\big(b(x - h)\big) + k

Then every point (x,y)(x, y) on the graph of ff moves to

(xb+h, ay+k)\left(\frac{x}{b} + h,\ a y + k\right)

on the graph of gg. The inside numbers bb and hh act on xx-coordinates; the outside numbers aa and kk act on yy-coordinates.

Why divide by bb? On gg, the input xx gets multiplied by bb before ff sees it. To reach an input that ff already knew, say x0x_0, you need bx=x0bx = x_0, so x=x0bx = \dfrac{x_0}{b}. The inside of a function always works backward, which is also why f(x−3)f(x - 3) moves right instead of left.

Here is what each constant does on its own:

ConstantEffect on the graph of ff
aavertical stretch by ∣a∣\lvert a \rvert (compression if ∣a∣<1\lvert a \rvert < 1); also reflect across the xx-axis if a<0a < 0
bbhorizontal compression by 1∣b∣\dfrac{1}{\lvert b \rvert} (stretch if ∣b∣<1\lvert b \rvert < 1); also reflect across the yy-axis if b<0b < 0
hhshift right hh (left if h<0h < 0)
kkshift up kk (down if k<0k < 0)

Order matters

Vertical transformations follow the usual order of operations on the output: first multiply by aa, then add kk. If the steps happen in a different order, the equation changes.

Worked example: Stretch then shift, or shift then stretch?

Start with f(x)=xf(x) = \sqrt{x}.

  1. Stretch vertically by 33, then shift up 22.
  2. Shift up 22, then stretch vertically by 33.

1. Stretching gives 3x3\sqrt{x}. Shifting adds 22 to that: g(x)=3x+2g(x) = 3\sqrt{x} + 2. The starting point (0,0)(0, 0) moves to (0,2)(0, 2).

2. Shifting gives x+2\sqrt{x} + 2. Stretching multiplies the whole output by 33: g(x)=3(x+2)=3x+6g(x) = 3(\sqrt{x} + 2) = 3\sqrt{x} + 6. The starting point moves to (0,6)(0, 6).

The parent (dashed), 3√x + 2, and 3√x + 6. Same steps, different order, different graphs.Open in grapher →

The same care applies inside the function. The horizontal steps in f(b(x−h))f\big(b(x - h)\big) happen in this order: stretch or compress by bb first, then shift by hh. The shift has to be read off after factoring out bb. (You could also shift first and compress second, but then the shift amount changes: for f(2x−6)f(2x - 6) that would be right 66, then compress. Precalculus uses the factored, compress-first reading, because it lets you use the point rule above.)

Common mistake

When you compress first, the horizontal shift in g(x)=f(2x−6)g(x) = f(2x - 6) is not 66. Factor the inside first: 2x−6=2(x−3)2x - 6 = 2(x - 3), so g(x)=f(2(x−3))g(x) = f\big(2(x - 3)\big). The graph is compressed horizontally by 12\dfrac{1}{2} and then shifted right 3. Reading "right 6" off 2x−62x - 6 is the most common transformation mistake in precalculus.

Worked example: A horizontal compression with a shift

The point (4,5)(4, 5) lies on the graph of ff. Find the corresponding point on g(x)=f(2x−6)g(x) = f(2x - 6), and check it.

Factor: g(x)=f(2(x−3))g(x) = f\big(2(x - 3)\big), so b=2b = 2, h=3h = 3, a=1a = 1, k=0k = 0.

Apply (x,y)→(xb+h, ay+k)(x, y) \to \left(\dfrac{x}{b} + h,\ ay + k\right):

(4,5)→(42+3, 5)=(5,5)(4, 5) \to \left(\frac{4}{2} + 3,\ 5\right) = (5, 5)

Check: g(5)=f(2⋅5−6)=f(4)=5g(5) = f(2 \cdot 5 - 6) = f(4) = 5. The point (5,5)(5, 5) is on gg.

Tip

You can always find a transformed point by solving instead of memorizing. For g(x)=f(2x−6)g(x) = f(2x - 6), ask: which xx makes the inside equal to 44? Solve 2x−6=42x - 6 = 4 to get x=5x = 5. Then g(5)=f(4)=5g(5) = f(4) = 5.

How domain and range transform

Because the inside numbers only move xx-coordinates and the outside numbers only move yy-coordinates, you can transform a domain and range without a graph at all.

  • Push each domain endpoint through x→xb+hx \to \dfrac{x}{b} + h.
  • Push each range endpoint through y→ay+ky \to a y + k.
  • If aa or bb is negative, the endpoints swap order, so rewrite the interval from smallest to largest.

Worked example: Transforming a domain and range

A function ff has domain [−2,6][-2, 6] and range [−1,3][-1, 3]. Find the domain and range of g(x)=−2f(x2+1)+4g(x) = -2 f\left(\dfrac{x}{2} + 1\right) + 4.

Factor the inside: x2+1=12(x+2)\dfrac{x}{2} + 1 = \dfrac{1}{2}(x + 2). So b=12b = \dfrac{1}{2}, h=−2h = -2, a=−2a = -2, k=4k = 4.

Domain. The rule is x→x1/2−2=2x−2x \to \dfrac{x}{1/2} - 2 = 2x - 2:

−2→−6,6→10-2 \to -6, \qquad 6 \to 10

The domain of gg is [−6,10][-6, 10]. (Check by solving: −2≤x2+1≤6-2 \le \dfrac{x}{2} + 1 \le 6 gives −6≤x≤10-6 \le x \le 10.)

Range. The rule is y→−2y+4y \to -2y + 4:

−1→6,3→−2-1 \to 6, \qquad 3 \to -2

The endpoints swapped because a<0a < 0, so the range of gg is [−2,6][-2, 6].

Graphing with key points

For a familiar parent function, pick a few key points, push them through the rule, and connect them with the parent's shape. A reflection across the yy-axis is part of bb, so factor out the negative too.

Worked example: A reflected square root

Graph g(x)=23−x−1g(x) = 2\sqrt{3 - x} - 1 and state its domain and range.

Rewrite the inside: 3−x=−(x−3)3 - x = -(x - 3), so g(x)=2−(x−3)−1g(x) = 2\sqrt{-(x - 3)} - 1 with b=−1b = -1, h=3h = 3, a=2a = 2, k=−1k = -1.

The graph of x\sqrt{x} is reflected across the yy-axis, shifted right 33, stretched vertically by 22 and shifted down 11. Points move by (x,y)→(−x+3, 2y−1)(x, y) \to (-x + 3,\ 2y - 1):

On x\sqrt{x}On gg
(0,0)(0, 0)(3,−1)(3, -1)
(1,1)(1, 1)(2,1)(2, 1)
(4,2)(4, 2)(−1,3)(-1, 3)
y = sqrt(x)y = 2sqrt(3 - x) - 1(3, -1)(2, 1)(-1, 3)Open in grapher →

The graph starts at (3,−1)(3, -1) and heads left and up. Domain: 3−x≥03 - x \ge 0, so x≤3x \le 3. Range: y≥−1y \ge -1.

Check one point: g(−1)=24−1=3g(-1) = 2\sqrt{4} - 1 = 3. It matches.

Notice that a reflection across the yy-axis has no effect on an even function, since f(−x)=f(x)f(-x) = f(x), and for an odd function it gives the same graph as a reflection across the xx-axis, since f(−x)=−f(x)f(-x) = -f(x). For example, (−x)3=−x3(-x)^3 = -x^3.

Practice

Practice 1

The point (6,−2)(6, -2) is on the graph of ff. What point must be on the graph of g(x)=f(x+4)−3g(x) = f(x + 4) - 3?

Enter a point like (2, -3)

Practice 2

The point (6,−2)(6, -2) is on the graph of ff. What point must be on the graph of g(x)=f(3x)g(x) = f(3x)?

Enter a point like (2, -3)

Practice 3

The point (6,−2)(6, -2) is on the graph of ff. What point must be on the graph of g(x)=−f(2x−4)+1g(x) = -f(2x - 4) + 1?

Enter a point like (2, -3)

Practice 4

Which describes the graph of g(x)=f(2x+6)g(x) = f(2x + 6) compared with the graph of ff?

Practice 5

Start with f(x)=x2f(x) = x^2. Stretch the graph horizontally by a factor of 22, then shift it right 11 and up 33. Write the new function g(x)g(x).

Enter an expression, e.g. 3x^2 - 2x + 1

Practice 6

A function ff has domain [0,8][0, 8]. What is the domain of g(x)=f(4−x)g(x) = f(4 - x)? Write it as a compound inequality.

Enter an inequality, e.g. x >= 4, -2 < x <= 3, or x < 1 or x > 5

Practice 7

A function ff has range [−3,5][-3, 5]. What is the range of g(x)=−3f(x)+2g(x) = -3f(x) + 2? Write it as a compound inequality in yy.

Enter an inequality, e.g. x >= 4, -2 < x <= 3, or x < 1 or x > 5

Practice 8

The graph shown is a transformation of f(x)=xf(x) = \sqrt{x}. It starts at (2,1)(2, 1) and passes through (−2,3)(-2, 3). Write its equation.

y = sqrt(2 - x) + 1(2, 1)(-2, 3)Open in grapher →

Enter an expression, e.g. 3x^2 - 2x + 1