From the free course College Algebra on Lykke

3.5 Transformation of Functions

Key concepts: Vertical shifts of functions · Horizontal shifts of functions · Combining horizontal and vertical shifts · Reflections across the x-axis and y-axis · Even and odd functions from graph symmetry · Horizontal and vertical stretches and compressions · Transformations of toolkit functions · Transforming domains and ranges

By the end of this section the student can: Graph functions using vertical and horizontal shifts; Graph functions using reflections about the x-axis and the y-axis; Determine whether a function is even, odd, or neither from its graph; Graph functions using compressions and stretches; Combine transformations

3.5 Transformation of Functions

A function’s graph can move, flip, widen, or narrow without changing its basic identity. The graph of $y=|x|$, for example, remains a $V$-shape after being shifted, reflected, stretched, or compressed; only its position or shape changes. These predictable changes are called transformations of functions.

The key distinction is whether a change acts on the output or the input. A constant added outside the function changes the $y$-coordinates and produces a vertical transformation. A constant added inside the function changes the $x$-coordinates and produces a horizontal transformation. Confusing these two locations is the most common source of errors.

Graphing Functions Using Vertical and Horizontal Shifts

A vertical shift moves a graph up or down. If $c>0$, then

$$ g(x)=f(x)+c $$

moves the graph of $f$ up $c$ units. If $c<0$, then the graph moves down $|c|$ units.

A horizontal shift moves a graph left or right. If $c>0$, then

$$ g(x)=f(x+c) $$

moves the graph of $f$ left $c$ units. If $c<0$, then

$$ g(x)=f(x-c) $$

moves the graph right $c$ units. The sign inside the function has the opposite effect from the sign outside it.

For a point $(x,y)$ on the graph of $f$, the corresponding point after a vertical shift by $k$ and a horizontal shift by $h$ is

$$ (x+h,y+k). $$

Thus, a transformed graph can often be drawn by locating a few important points, such as a vertex, endpoint, intercept, or turning point.

Example: Graph a function using a horizontal and vertical shift. Let

$$ f(x)=\sqrt{x} $$

and define

$$ g(x)=\sqrt{x-3}+2. $$

Identify the shifts and determine several points on the new graph.

Start with the parent function:

$$ f(x)=\sqrt{x}. $$

Use convenient points on its graph:

$$ \begin{aligned} f(0)&=\sqrt{0}=0,\ f(1)&=\sqrt{1}=1,\ f(4)&=\sqrt{4}=2,\ f(9)&=\sqrt{9}=3. \end{aligned} $$

Therefore, points on $f$ include

$$ (0,0),\quad (1,1),\quad (4,2),\quad (9,3). $$

The expression $x-3$ is inside the function. Rewrite it as $x+(-3)$:

$$ g(x)=f(x-3)+2. $$

Because the inside expression is $x-3$, shift the graph right $3$ units. Because $2$ is added outside the function, shift the graph up $2$ units.

Apply the point transformation

$$ (x,y)\longmapsto(x+3,y+2). $$

The points become

$$ \begin{aligned} (0,0)&\longmapsto(0+3,0+2)=(3,2),\ (1,1)&\longmapsto(1+3,1+2)=(4,3),\ (4,2)&\longmapsto(4+3,2+2)=(7,4),\ (9,3)&\longmapsto(9+3,3+2)=(12,5). \end{aligned} $$

The graph begins at $(3,2)$ and follows the same square-root shape as $f$.

A useful check is to substitute the transformed $x$-values directly:

$$ \begin{aligned} g(3)&=\sqrt{3-3}+2=\sqrt{0}+2=2,\ g(4)&=\sqrt{4-3}+2=\sqrt{1}+2=3,\ g(7)&=\sqrt{7-3}+2=\sqrt{4}+2=4. \end{aligned} $$

Thus, the graph is shifted right $3$ units and up $2$ units.

Graphing Functions Using Reflections about the Axes

A reflection flips a graph across a line. Reflecting the graph of $y=f(x)$ across the $x$-axis changes every output $y$ to its opposite:

$$ y=-f(x). $$

A point $(x,y)$ becomes $(x,-y)$. Reflecting across the $x$-axis changes the signs of the $y$-coordinates but leaves the $x$-coordinates unchanged.

Reflecting across the $y$-axis changes every input $x$ to its opposite:

$$ y=f(-x). $$

The negative sign outside the function produces an $x$-axis reflection; the negative sign inside the function produces a $y$-axis reflection. If both occur, the graph is reflected across both axes:

$$ y=-f(-x). $$

Example: Reflect a square-root graph across both axes. Let

$$ f(x)=\sqrt{x}. $$

Find the equation and key points for the graph obtained by reflecting $f$ across the $x$-axis and then across the $y$-axis.

First reflect across the $x$-axis. Replace $f(x)$ with $-f(x)$:

$$ y=-f(x). $$

Since $f(x)=\sqrt{x}$,

$$ y=-\sqrt{x}. $$

A point $(x,y)$ on $f$ becomes $(x,-y)$. For example,

$$ \begin{aligned} (0,0)&\longmapsto(0,0),\ (1,1)&\longmapsto(1,-1),\ (4,2)&\longmapsto(4,-2),\ (9,3)&\longmapsto(9,-3). \end{aligned} $$

Next reflect the result across the $y$-axis. Replace $x$ with $-x$:

$$ y=-\sqrt{-x}. $$

Equivalently,

$$ y=-f(-x). $$

Now each point $(x,-y)$ becomes $(-x,-y)$:

The final graph is

$$ y=-\sqrt{-x}. $$

Its domain is

$$ -x\ge 0, $$

so

$$ x\le 0. $$

Its range is

$$ y\le 0. $$

The original square-root graph begins at the origin and extends right and upward; the final graph begins at the origin and extends left and downward.

Determining Even and Odd Functions

A function is even if its graph is symmetric about the $y$-axis. Algebraically, $f$ is even when

$$ f(-x)=f(x) $$

for every $x$ in the domain. Replacing $x$ with $-x$ leaves the function unchanged.

A function is odd if its graph is symmetric about the origin. Algebraically, $f$ is odd when

$$ f(-x)=-f(x) $$

for every $x$ in the domain. Replacing $x$ with $-x$ changes the sign of the output.

The domain must be symmetric about $0$ for a function to be even or odd. If one of $x$ or $-x$ is in the domain but the other is not, the function cannot have either symmetry.

Example: Determine whether a polynomial is even, odd, or neither. Let

$$ f(x)=x^4-3x^2+2. $$

Compute $f(-x)$:

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

Because

$$ f(-x)=f(x), $$

the function is even. Its graph is symmetric about the $y$-axis.

For comparison, consider

$$ g(x)=x^3-2x. $$

Then

$$ \begin{aligned} g(-x)&=(-x)^3-2(-x)\ &=-x^3+2x\ &=-(x^3-2x)\ &=-g(x). \end{aligned} $$

Therefore, $g$ is odd and its graph is symmetric about the origin. A function that satisfies neither equation is neither even nor odd.

Graphing Functions Using Stretches and Compressions

A vertical stretch multiplies every output by a factor greater than $1$:

$$ g(x)=a f(x),\qquad a>1. $$

Each point $(x,y)$ becomes $(x,ay)$. A vertical compression occurs when

$$ 0<a<1, $$

and each output is multiplied by a number between $0$ and $1$.

A horizontal stretch replaces $x$ with $bx$, where

$$ 0<b<1: \qquad g(x)=f(bx). $$

The graph stretches horizontally by a factor of

$$ \frac{1}{b}. $$

A horizontal compression occurs when

$$ b>1, $$

and the graph is compressed horizontally by a factor of

$$ \frac{1}{b}. $$

The reciprocal factor is important: $f(3x)$ compresses the graph horizontally by a factor of $\frac{1}{3}$, not by a factor of $3$.

Example: Apply a vertical stretch and a horizontal compression. Let

$$ f(x)=\sqrt{x} $$

and

$$ g(x)=2f(4x). $$

Find an explicit formula and describe the transformations.

Substitute $4x$ into $f$:

$$ f(4x)=\sqrt{4x}. $$

Now multiply the output by $2$:

$$ g(x)=2f(4x)=2\sqrt{4x}. $$

For $x\ge 0$,

$$ \sqrt{4x}=\sqrt{4}\sqrt{x}=2\sqrt{x}. $$

Therefore,

$$ g(x)=2(2\sqrt{x})=4\sqrt{x}. $$

The factor $4$ inside the original function produces a horizontal compression by a factor of

$$ \frac{1}{4}. $$

The factor $2$ outside the function produces a vertical stretch by a factor of $2$. For example, the point $(1,1)$ on $f$ transforms horizontally according to

$$ x\longmapsto \frac{x}{4}, $$

so its new $x$-coordinate is

$$ \frac{1}{4}. $$

Its output is then multiplied by $2$, giving

$$ y\longmapsto 2y=2. $$

Thus,

$$ (1,1)\longmapsto\left(\frac{1}{4},2\right). $$

A direct check confirms this:

$$ g\left(\frac{1}{4}\right) =2\sqrt{4\left(\frac{1}{4}\right)} =2\sqrt{1} =2. $$

Performing a Sequence of Transformations

A function may undergo several transformations. The general transformed form

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

contains several effects:

  • $h$ shifts the graph horizontally: right when $h>0$, left when $h<0$.
  • $k$ shifts the graph vertically: up when $k>0$, down when $k<0$.
  • $a$ stretches or compresses vertically and reflects across the $x$-axis when $a<0$.
  • $b$ stretches or compresses horizontally and reflects across the $y$-axis when $b<0$.

For the basic shift procedure, identify the constants inside and outside the function, apply the horizontal and vertical shifts, and then apply any reflections, stretches, or compressions. Horizontal and vertical shifts may be performed in either order because they affect different coordinates.

Example: Describe and graph a complete sequence of transformations. Start with

$$ f(x)=|x| $$

and define

$$ g(x)=-2|x-3|+4. $$

Write $g$ in transformation form and identify every transformation.

Begin with the parent function:

$$ f(x)=|x|. $$

Replace $x$ by $x-3$:

$$ f(x-3)=|x-3|. $$

Because the expression is $x-3$, shift the graph right $3$ units.

Next multiply by $-2$:

$$ -2f(x-3)=-2|x-3|. $$

The factor $2$ creates a vertical stretch by a factor of $2$. The negative sign reflects the graph across the $x$-axis.

Finally, add $4$:

$$ -2f(x-3)+4=-2|x-3|+4. $$

This shifts the graph up $4$ units.

The vertex of $f(x)=|x|$ is $(0,0)$. Apply the transformations step by step:

$$ (0,0)\longmapsto(3,0)\longmapsto(3,0)\longmapsto(3,4). $$

Therefore, the vertex of $g$ is

$$ (3,4). $$

Use points on the original graph:

$$ (-1,1),\quad (0,0),\quad (1,1). $$

Shift right $3$ units:

$$ (2,1),\quad (3,0),\quad (4,1). $$

Multiply the $y$-coordinates by $-2$:

$$ (2,-2),\quad (3,0),\quad (4,-2). $$

Shift up $4$ units:

$$ (2,2),\quad (3,4),\quad (4,2). $$

Thus, the transformed graph is an inverted $V$ with vertex $(3,4)$, passing through $(2,2)$ and $(4,2)$. Its equation is

$$ g(x)=-2|x-3|+4. $$

The order can also be checked algebraically. The horizontal shift gives

$$ |x-3|, $$

the vertical stretch and reflection give

$$ -2|x-3|, $$

and the vertical shift gives

$$ -2|x-3|+4. $$

Keeping inside changes attached to horizontal behavior and outside changes attached to vertical behavior prevents the sign errors that most often occur in transformation problems.

Practice problems

  1. Describe the transformations of

$$ g(x)=\sqrt{x+2}-3. $$

Answer: Shift $f(x)=\sqrt{x}$ left $2$ units and down $3$ units.

  1. Determine whether

$$ f(x)=x^5-4x $$

is even, odd, or neither.

Answer: Odd, because

$$ f(-x)=-f(x). $$

  1. Describe the transformations of

$$ g(x)=3|2(x-1)|+5. $$

Answer: Shift right $1$ unit, compress horizontally by a factor of $\frac{1}{2}$, stretch vertically by a factor of $3$, and shift up $5$ units.

Content adapted from OpenStax College Algebra 2e by Jay Abramson et al., licensed CC BY 4.0.

Source Materials

Study College Algebra on Lykke

This course page is free to open: signed out, you can read its first two sections, and signing in, on any plan, opens the rest. The free Lykke Chrome extension syncs your own Canvas courses, so ChatGPT, Claude and Muse can answer from your classes and deadlines. It only reads Canvas.

Add the free extensionSign in to open every section

All sections of College Algebra · Browse more course pages