2.4 Transformations of Functions


2.4.1 Learning Objectives

By the end of this section, you should be able to:

  • describe vertical and horizontal shifts;
  • reflect graphs across the coordinate axes;
  • apply vertical and horizontal stretches and compressions;
  • combine transformations in an appropriate order;
  • write transformed function rules; and
  • identify even and odd functions from formulas and graphs.

2.4.2 Vertical Shifts

Adding a constant outside a function shifts its graph vertically:

\[ g(x)=f(x)+k. \]

  • If \(k>0\), the graph moves upward \(k\) units.
  • If \(k<0\), the graph moves downward \(|k|\) units.

Every point \((x,y)\) on \(f\) becomes \((x,y+k)\) on \(g\).

Example 2.16 Applying a Vertical Shift

Describe the transformation from \(f(x)=x^2\) to

\[ g(x)=x^2-5. \]

Solution

Subtracting \(5\) outside the function shifts the parabola \(\boxed{5\text{ units downward}}\). Its vertex moves from \((0,0)\) to \((0,-5)\).

Exercise 2.15 Describe the transformation from \(f(x)=\sqrt{x}\) to \(g(x)=\sqrt{x}+3\).

Show answer

Answer: The graph shifts \(\boxed{3\text{ units upward}}\).


2.4.3 Horizontal Shifts

Changing the input shifts a graph horizontally:

\[ g(x)=f(x-h). \]

  • \(f(x-h)\) shifts the graph right \(h\) units.
  • \(f(x+h)\) shifts the graph left \(h\) units.

The direction appears opposite to the sign because the transformation changes which input produces each original output.

Example 2.17 Applying a Horizontal Shift

Describe the transformation from \(f(x)=|x|\) to

\[ g(x)=|x+4|. \]

Solution

The \(+4\) occurs inside the function, so the graph shifts \(\boxed{4\text{ units left}}\). The vertex moves from \((0,0)\) to \((-4,0)\).

Exercise 2.16 Describe the transformation from \(f(x)=x^3\) to \(g(x)=(x-2)^3\).

Show answer

Answer: The graph shifts \(\boxed{2\text{ units right}}\).


2.4.4 Reflections

Multiplying the output by \(-1\) reflects a graph across the \(x\)-axis:

\[ g(x)=-f(x). \]

Replacing \(x\) by \(-x\) reflects a graph across the \(y\)-axis:

\[ h(x)=f(-x). \]

Example 2.18 Reflecting a Square-Root Graph

Describe the transformations from \(f(x)=\sqrt{x}\) to

\[ g(x)=-\sqrt{-x}. \]

Solution

The replacement \(x\mapsto -x\) reflects the graph across the \(y\)-axis. The negative sign outside then reflects it across the \(x\)-axis. The graph begins at the origin and extends left and downward.

Exercise 2.17 Describe the transformation from \(f(x)=x^2\) to \(g(x)=-x^2\).

Show answer

Answer: Reflection across the \(\boxed{x\text{-axis}}\).


2.4.5 Vertical Stretches and Compressions

For

\[ g(x)=af(x), \]

the factor \(a\) multiplies every output.

  • If \(|a|>1\), the graph is stretched vertically by factor \(|a|\).
  • If \(0<|a|<1\), the graph is compressed vertically by factor \(|a|\).
  • If \(a<0\), a reflection across the \(x\)-axis also occurs.

Example 2.19 Comparing Vertical Scale Factors

Describe \(g(x)=3|x|\) and \(h(x)=\frac12|x|\) relative to \(f(x)=|x|\).

Solution

The graph of \(g\) is stretched vertically by a factor of \(\boxed{3}\). The graph of \(h\) is compressed vertically by a factor of \(\boxed{1/2}\).

Exercise 2.18 Describe \(g(x)=-2f(x)\) relative to \(f\).

Show answer

Answer: A vertical stretch by factor \(2\) and a reflection across the \(x\)-axis.


2.4.6 Horizontal Stretches and Compressions

For

\[ g(x)=f(bx), \]

the horizontal scale factor is \(1/|b|\).

  • If \(|b|>1\), the graph is compressed horizontally by factor \(1/|b|\).
  • If \(0<|b|<1\), the graph is stretched horizontally by factor \(1/|b|\).
  • If \(b<0\), a reflection across the \(y\)-axis also occurs.

Example 2.20 Applying a Horizontal Scale Factor

Describe \(g(x)=f(4x)\) relative to \(f(x)\).

Solution

Inputs one quarter as large produce the original outputs, so the graph is compressed horizontally by a factor of \(\boxed{1/4}\).

Exercise 2.19 Describe \(h(x)=f(x/3)\) relative to \(f(x)\).

Show answer

Answer: A horizontal stretch by a factor of \(\boxed{3}\).


2.4.7 Combining Transformations

A transformed function often has the form

\[ g(x)=af(b(x-h))+k. \]

The parameters describe:

  • a horizontal shift by \(h\);
  • a horizontal scale factor of \(1/|b|\), with a \(y\)-axis reflection if \(b<0\);
  • a vertical scale factor of \(|a|\), with an \(x\)-axis reflection if \(a<0\); and
  • a vertical shift by \(k\).

For point mapping, a point \((x,y)\) on \(f\) corresponds to

\[ \left(\frac{x}{b}+h,ay+k\right) \]

on \(g\).

Example 2.21 Describing Several Transformations

Describe the graph of

\[ g(x)=-2(x-3)^2+5 \]

relative to \(f(x)=x^2\).

Solution

Starting with \(y=x^2\):

  1. shift right \(3\) units;
  2. stretch vertically by factor \(2\);
  3. reflect across the \(x\)-axis; and
  4. shift upward \(5\) units.

The vertex is \(\boxed{(3,5)}\), and the parabola opens downward.

Exercise 2.20 Describe \(g(x)=\frac12|x+1|-4\) relative to \(f(x)=|x|\).

Show answer

Answer: Shift left \(1\), compress vertically by factor \(1/2\), and shift down \(4\). The vertex is \(\boxed{(-1,-4)}\).


2.4.8 Even and Odd Functions

A function is even if

\[ f(-x)=f(x) \]

for every \(x\) in its domain. Its graph is symmetric about the \(y\)-axis.

A function is odd if

\[ f(-x)=-f(x). \]

Its graph is symmetric about the origin. A function may be neither even nor odd.

Example 2.22 Testing Algebraically for Symmetry

Classify

\[ f(x)=x^4-3x^2+2 \]

as even, odd, or neither.

Solution

\[ \begin{aligned} f(-x) &=(-x)^4-3(-x)^2+2\\ &=x^4-3x^2+2\\ &=f(x). \end{aligned} \]

Therefore, \(f\) is \(\boxed{\text{even}}\).

Exercise 2.21 Classify \(g(x)=x^3-2x\) as even, odd, or neither.

Show answer

Answer:

\[ g(-x)=-x^3+2x=-(x^3-2x)=-g(x), \]

so \(g\) is \(\boxed{\text{odd}}\).


2.4.9 Desmos Graphing Activity

In Desmos, enter a base function as \(f(x)\), then graph transformed versions using sliders for \(a\), \(b\), \(h\), and \(k\):

\[ g(x)=a f(b(x-h))+k. \]

Change one parameter at a time. Record how it affects the position, orientation, and scale of the graph. Then test combinations of parameters and predict the graph before moving the sliders.


2.4.10 Conceptual Takeaways

  • Changes outside a function affect outputs and therefore act vertically.
  • Changes inside a function affect inputs and therefore act horizontally.
  • Horizontal shifts and scale factors appear opposite to their algebraic signs or sizes.
  • Negative factors create reflections.
  • Several transformations can be combined in one function rule.
  • Even functions have \(y\)-axis symmetry, while odd functions have origin symmetry.

2.4.11 Skills You Should Be Able to Do

  • Describe vertical and horizontal shifts.
  • Apply reflections across the coordinate axes.
  • Distinguish vertical stretches from compressions.
  • Distinguish horizontal stretches from compressions.
  • Write and interpret functions of the form \(af(b(x-h))+k\).
  • Map important points through a transformation.
  • Test functions algebraically for even or odd symmetry.
  • Explore transformations using Desmos.

2.4.12 Practice Problems with Solutions

  1. Describe the transformation from \(f(x)=x^2\) to \(g(x)=x^2+7\).

    Show Solution

    Adding \(7\) outside the function shifts the graph \(\boxed{7\text{ units upward}}\).

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

    Show Solution

    Replacing \(x\) with \(x-5\) shifts the graph \(\boxed{5\text{ units right}}\).

  3. Describe \(g(x)=-f(x+2)\) relative to \(f(x)\).

    Show Solution

    The graph shifts \(2\) units left and reflects across the \(x\)-axis.

  4. Describe \(h(x)=4f(x)\) relative to \(f(x)\).

    Show Solution

    The graph is stretched vertically by a factor of \(\boxed{4}\).

  5. Describe \(p(x)=f(2x)\) relative to \(f(x)\).

    Show Solution

    The graph is compressed horizontally by a factor of \(\boxed{1/2}\).

  6. State the vertex and describe the transformations of

    \[ g(x)=3(x+2)^2-4. \]

    Show Solution

    Relative to \(y=x^2\), shift left \(2\), stretch vertically by factor \(3\), and shift down \(4\). The vertex is

    \[ \boxed{(-2,-4)}. \]

  7. Write a function obtained by reflecting \(f(x)=|x|\) across the \(x\)-axis, shifting it right \(3\), and shifting it up \(2\).

    Show Solution

    The reflection gives \(-|x|\), the right shift replaces \(x\) by \(x-3\), and the upward shift adds \(2\):

    \[ \boxed{g(x)=-|x-3|+2}. \]

  8. Classify \(f(x)=x^5+3x\) as even, odd, or neither.

    Show Solution

    \[ f(-x)=(-x)^5+3(-x)=-x^5-3x=-f(x). \]

    Therefore, \(f\) is \(\boxed{\text{odd}}\).

  9. Classify \(g(x)=x^2+x\) as even, odd, or neither.

    Show Solution

    \[ g(-x)=x^2-x. \]

    This is neither \(g(x)=x^2+x\) nor \(-g(x)=-x^2-x\). Therefore, \(g\) is \(\boxed{\text{neither even nor odd}}\).