In many applications, the relationship between two variables will have a graph that is simply a transformation of a more simple relationship. Transformations might include translations (shifting the graph left or right or up or down), scaling (stretching or compressing the graph) and reflections. This section looks at the rules associated with transformations in the context of composition of functions.

Algebra and pre-calculus courses often teach basic rules for how to transform a function according to the basic available transformations of translation, reflection and scaling.

Theorem2.10.1

Starting with a graph \(y=f(x)\):

\(y=f(x)+c\) is a vertical shift of the graph by \(+c\).

\(y=f(x-c)\) is a horizontal shift of the graph by \(+c\).

\(y=-f(x)\) is a vertical reflection (across \(x\)-axis).

\(y=f(-x)\) is a horizontal reflection (across \(y\)-axis).

\(y=af(x)\) is a vertical stretch of the graph by factor \(a\).

\(y=f(\frac{x}{a})\) is a horizontal stretch of the graph by factor \(a\).

You should notice that the horizontal transformations of translation (shift) and scaling (stretch) use inverse operations. That is, to shift the graph of \(y=f(x)\) to the right 2 units, you graph \(y=f(x-2)\). Similarly, to stretch a graph horizontally by a factor of 3 (making it three times wider), you would need to graph \(y=f(\frac{x}{3})\). Vertical transformations, by contrast, follow a more natural reasoning, using the same operations that we would expect.

Composition of functions provides a unifying approach to understand transformations. We will think of \(y=f(x)\) as providing a reference relationship \(x \overset{f}{\mapsto} y\). We will think of the actual data (the transformed graph) as having its own variables for which we need a relation \(\widetilde{x} \mapsto \widetilde{y}\). The transformation of the graph will correspond to finding linear functions that describe a relation between \(\widetilde{x} \mapsto x\) and \(y \mapsto \widetilde{y}\) so that the overall transformation is the composition \begin{equation*}\widetilde{x} \mapsto x \overset{f}{\mapsto} y \mapsto \widetilde{y}.\end{equation*}

Subsection2.10.2Transformations as Composition

Consider the absolute value function \(\mathrm{abs}(x)=|x|\) as a relation between \(x\) and \(y\), \(\mathrm{abs} : x \mapsto y\). The following table illustrates some data from this relation.

label

\(x\)

\(y\)

a

-2

2

b

-1

1

c

0

0

d

1

1

e

2

2

Now consider a new equation, \(y=2|x-1|\). In order to use the ideas of composition and a chain of variables, we have already reserved the variables \(x\) and \(y\) for the simpler relation \(y=|x|\). So we introduce some decorations (a squiggle or tilde) for our new variables and instead consider \begin{equation*}\tilde{y} = 2 |\tilde{x}-1|.\end{equation*} The key step is recognizing that this equation is equivalent to the following chain: \begin{align*}
x &= \tilde{x}-1, \\
y &= |x|, \\
\tilde{y} &= 2y.
\end{align*} That is, the relation is a composition of three operations: subtracting 1, taking an absolute value, and multiplying by 2. The following diagram illustrates this composition as mappings.

The data that were shown in the table were highlighted. If we extended the table for the same five labeled states to include \(\tilde{x}\) and \(\tilde{y}\), we can see the relationship begin to appear. The ordering of the columns was chosen to match the mapping \(\tilde{x} \mapsto x \mapsto y \mapsto \tilde{y}\).

label

\(\tilde{x}\)

\(x\)

\(y\)

\(\tilde{y}\)

\((x,y)\)

\((\tilde{x},\tilde{y})\)

a

\(-1\)

\(-2\)

\(2\)

\(4\)

\((-2,2)\)

\((-1,4)\)

b

\(0\)

\(-1\)

\(1\)

\(2\)

\((-1,1)\)

\((0,2)\)

c

\(1\)

\(0\)

\(0\)

\(0\)

\((0,0)\)

\((1,0)\)

d

\(2\)

\(1\)

\(1\)

\(2\)

\((1,1)\)

\((2,2)\)

e

\(3\)

\(2\)

\(2\)

\(4\)

\((2,2)\)

\((3,4)\)

If we were to graph the relationship for \((\tilde{x},\tilde{y})\) as shown below, we can see the transformation consists of shifting the graph to the right 1 unit (adding 1 to all \(x\) values) and stretching the graph vertically by a factor of 2 (multiplying all \(y\) values by 2). These are precisely the relationships \(\tilde{x} = x+1\) (the inverse of \(x = \tilde{x}-1\)) and \(\tilde{y} = 2y\).

By identifying the composition in an equation involving a known function, we can describe the transformation of the graph. The inverse of the composition involved on the input of the function corresponds to the horizontal transformations (\(x\)-axis); the composition involved on the output of the function corresponds to the vertical transformations (\(y\)-axis).

Example2.10.2

Describe the graph \(y=-3(x+2)^2+4\) as a transformation of \(y=x^2\).

Because we want to think of \(y=x^2\) as the elementary function, we will rename the variables in our equation to transformed variables \(\tilde{x}\) and \(\tilde{y}\). Thus, our transformed equation can be written \begin{equation*}\tilde{y} = -3(\tilde{x}+2)^2+4.\end{equation*} We need to interpret this formula as a sequence of operations (composition): start with \(\tilde{x}\), add \(2\), square that result, multiply by \(-3\), add \(4\).

Every transformation problem consists of the composition \begin{equation*}\tilde{x} \mapsto x \overset{y=x^2}{\mapsto} y \mapsto \tilde{y}.\end{equation*} All of the steps before squaring will be the operation on the input; all of the steps after squaring will be the operation on the output. Our chain of variables in the composition can be written \begin{align*}
x &= \tilde{x}+2 \\
y &= x^2 \\
\tilde{y} &= -3y+4
\end{align*} To understand the horizontal transformation, we need to solve for \(\tilde{x}\) to get \(\tilde{x} = x-2\), meaning that the transformation moves points left 2 units (subtract 2 from every \(x\)-coordinate). The vertical transformation is described as seen: multiply all \(y\)-coordinates by \(-3\) (a vertical reflection and stretching by a factor 3) followed by shifting up 4 (adding 4).

We illustrate the transformation by considering a few known points on the original graph \(y=x^2\) shown in the table below. Be sure as you look at this table, you look at how the values of the points are related by the functions we identified in the compositions of the transformation.

label

\((x,y)\)

\((\tilde{x},\tilde{y})\)

a

\((0,0)\)

\((-2,4)\)

b

\((1,1)\)

\((-1,1)\)

c

\((-1,1)\)

\((-3,1)\)

d

\((2,4)\)

\((0,-8)\)

The graph of the function \(y=x^2\) and the transformation \(\tilde{y} = -3(\tilde{x}+2)^2+4\) are shown below.

Subsection2.10.3Finding Transformations

Elementary transformations correspond to mappings that are linear functions. A translation or shift corresponds to adding a constant to the original value. A rescaling or stretching or compressing corresponds to multiplying the original value by the scale factor. Reflection corresponds to multiplying by -1. Applying these operations to a variable can always be represented as a linear function on the variable.

In order to find the transformation, we need to determine the linear functions that map the independent and dependent variables. When the functions are not obvious, we can find them by determining the equation of a line.

Example2.10.3

Find the equation of a parabola as a transformation of \(y=x^2\) that has a vertex at \((3,-1)\) and transforms the point \((1,1)\) to the point \((5,-4)\).

The vertex of the simple parabola \(y=x^2\) is at \((0,0)\). If we name the vertex with a label “a” and the point at \((1,1)\) with a label “b”, then the corresponding points on the transformed parabola using variables \((\tilde{x}, \tilde{y})\) are shown in the table below.

label

\((x,y)\)

\((\tilde{x},\tilde{y})\)

a

\((0,0)\)

\((3,-1)\)

b

\((1,1)\)

\((5,-4)\)

Transformations correspond to a composition \begin{equation*}\tilde{x} \mapsto x \overset{y=x^2}{\mapsto} y \mapsto \tilde{y}.\end{equation*} We only need to find the linear functions that relate \(\tilde{x} \mapsto x\) and \(y \mapsto \tilde{y}\). Rewriting the table of points in terms of the variables, we can see the input and output values of these functions.

label

\(\tilde x\)

\(x\)

\(y\)

\(\tilde{y}\)

a

\(3\)

\(0\)

\(0\)

\(-1\)

b

\(5\)

\(1\)

\(1\)

\(-4\)

Using the first two columns corresponding to variables \(\tilde x\) and \(x\), we find the linear relation \(\tilde x \mapsto x\), which gives the horizontal transformation. First we find the slope, using the change in output (\(x\)) over the change in input (\(\tilde x\)), \begin{equation*} \frac{\Delta x}{\Delta \tilde x} = \frac{1-0}{5-3} = \frac{1}{2}.\end{equation*} Using this slope and the point \((\tilde x, x) = (3,0)\), we find the equation of the line, \begin{equation*}x-0 = \frac{1}{2}(\tilde x - 3) \qquad \Leftrightarrow \qquad x = \frac{\tilde x - 3}{2}.\end{equation*}

Using the last two columns corresponding to variables \(y\) and \(\tilde y\), we find the linear relation \(y \mapsto \tilde y\), which gives the vertical transformation. Again, we start with the slope of the relation, \begin{equation*}\frac{\Delta \tilde y}{\Delta y} = \frac{-4--1}{1-0} = -3.\end{equation*} Using this slope and the point \((y,\tilde y)=(0,-1)\), we find the equation of the relation \begin{equation*} \tilde y - -1 = -3(y-0) \quad \Leftrightarrow \quad \tilde y = -3y-1.\end{equation*}

Once we know the relations, we can write down the composition: \begin{align*}
\tilde x &\mapsto x = \frac{\tilde x - 3}{2}, \\
x & \mapsto y = x^2, \\
y & \mapsto \tilde y = -3y-1.
\end{align*} Using substitution with this composition gives the transformed equation, \begin{equation*} \tilde y = -3\left(\frac{\tilde x - 3}{2}\right)^2. \end{equation*}

Finding the transformation of a graph \(y=f(x)\) always corresponds to a composition \begin{equation*}\tilde x \mapsto x \overset{f}{\mapsto} y \mapsto \tilde y\end{equation*} where \((\tilde x, \tilde y)\) are the coordinates of the transformed graph. Normally, we think of a transformation in terms of how it moves the original coordinates \((x,y)\) to the new coordinates \((\tilde x, \tilde y)\). That the mapping \(\tilde x \mapsto x\) is the inverse of \(x \mapsto \tilde x\) explains why the formula used on the input behaves opposite to the transformation itself.

Example2.10.4

Describe the transformation of the graph \(y=f(x)\) on the graph \(y=-f(2x+1)-3\).

First, identify the composition. Using \((\tilde x, \tilde y)\) as the transformed variables in the equation \( \tilde y = -f(2 \tilde x + 1)-3\), we identify the formula as the following composition: \begin{align*}
\tilde x & \mapsto x = 2 \tilde x + 1, \\
x & \mapsto y = f(x), \\
y & \mapsto \tilde y = -y-3.
\end{align*}

Once the composition is identified, we can describe the horizontal transformation using the operation in the inverse map \(x \mapsto \tilde x\), \begin{equation*} x = 2 \tilde x + 1 \quad \Leftrightarrow \quad \tilde x = \frac{x-1}{2}.\end{equation*} Interpreting the operations in order, we see that we first subtract 1 (move left 1 unit) and then divide by 2 (rescale the graph by a factor \(\frac{1}{2}\)). The vertical transformation is already in the right form \(\tilde y = -y-3\). Order of operations tells us that the transformation first multiplies by \(-1\) (vertical reflection) followed by subtracting 3 (vertically move down 3 units).

Subsection2.10.4Families of Transformed Functions

Understanding the relationship between a transformation and the mappings between coordinates also allows us to interpret certain equations as transformations of a more basic graph. You should try to become comfortable thinking about before and after the transformation so that you can look at the form of the equation and recognize the transformation without requiring the introduction of new variables.

Theorem2.10.5

The function \begin{equation*}y = A(x-h)^2+k\end{equation*} is a transformation of the standard parabola \(y=x^2\) so that the vertex is moved to \((h,k)\) and stretched so that the point 1 unit away is at \((h+1, k+A)\). We call \(A\) the amplitude of the parabola.

The graph of \(y=-2(x+1)^2+5\) can be sketched if we rewrite \(x+1\) as subtraction, \(x+1 = x--1\) to get \begin{equation*}y=-2(x--1)^2+5.\end{equation*} This is a parabola with vertex at \((-1,5)\) and which has been reflected down and stretched by a factor 2.

This technique actually applies to any equation involving \((x,y)\) where we can clearly identify linear relations between the old and new coordinates. We can use the technique to find an easy representation for exponential functions as described in the next theorem.

Theorem2.10.8

The function \begin{equation*}y=A \cdot b^{(x-h)/k}\end{equation*} is a transformation of \(y=b^x\) so that it passes through the point \((h,A)\) and grows by a factor of \(b\) when \(x\) changes by a value \(k\). That is, the graph also passes through the points \begin{equation*}\ldots, (h-k, Ab^{-1}), (h,A), (h+k, Ab), \ldots.\end{equation*}

The function \(y=b^x\) passes through \((0,1)\) and \((1,b)\). The composition represented by the transformation is given by \begin{gather*}
\tilde x \mapsto x = \frac{\tilde x - h}{k}, \\
x \mapsto y = b^x, \\
y \mapsto \tilde y = Ay.
\end{gather*} Inverting the \(\tilde x \mapsto x\) to \(x \mapsto \tilde x\) gives the horizontal transformation \begin{equation*} \tilde x = k x + h. \end{equation*} Based on these transformations, we have \((x,y)=(0,1)\) transformed to \((\tilde x, \tilde y) = (h,A)\) and the point \((x,y)=(1,b)\) transformed to \((\tilde x, \tilde y) = (h+k,Ab)\).

Example2.10.10

A cell culture grows exponentially. After 5 hours, the culture is observed to have a mass of 3 mg and doubles after another 40 minutes. Find a model for the mass of the cell culture and use your model to determine the size at the beginning of the experiment.

First, we need to declare our variables. The state of our culture is described in terms of the time since the experiment began and the mass of the cell culture. Let \(t\) be the time since the experiment began, measured in hours, and let \(M\) be the mass of the cell culture, measured in milligrams.

Because the cell culture is being measured as doubling in 40 minutes, the exponential base for our model will be \(b=2\). We know the culture size when \(t=5\) as \(M=3\), so that the graph will pass through \((t,M)=(5,3)\). The time to double is \(\frac{2}{3}\) h, so our second point is \((t,M)=(5+\frac{2}{3}, 3 \cdot 2)\). This means that we will use \(h=5\), \(A=3\) and \(k=\frac{2}{3}\) to give a model \begin{equation*} M(t) = 3 \cdot 2^{(t-5)/(\frac{2}{3})} = 3 \cdot 2^{\frac{3}{2}(t-5)}.\end{equation*}

Once we have our model, we can use the model to find \(M\) when \(t=0\). This gives \begin{equation*}M(0) = 3 \cdot 2^{\frac{3}{2}(0-5)} = 3 \cdot 2^{-\frac{15}{2}} \approx 0.01657.\end{equation*} That is, the initial mass of the cell culture is being estimated as \(M = 0.01657\) mg.

Subsection2.10.5Applications of Transformations

Example2.10.11

One of the most important functions used to model the rate of
resource consumption begins with the relatively simple function
\begin{equation*} f:[0,\infty) \to [0,\infty); f(x) = \frac{x}{1+x}. \end{equation*}
This function captures the idea of saturation, as the graph \(y=f(x)\)
has a horizontal asymptote of \(y=1\). That is, \(x\), which plays
the role of resource availability, is related to a rate of resource
consumption \(y\). The more the resource is available, the greater the
rate the resource is consumed. However, saturation means that there
is some maximum consumption rate and further increase in resource
availability makes no difference. There is a half-saturation point
when \(x=1\) since \(f(1)=\frac{1}{2}\).

We can use the idea of transformation to model the rate of
resource consumption where the limiting rate has a value of 50
(units of resource per unit time) and a half-saturation
when the resource is available at 200 units.
We introduce variables, using \(V\) for the rate of resource consumption
(think v for velocity) and \(C\) for the resource availability
(measured in a concentration).

To find our transformation, we could relate points that are on the graph.
In reality, what we really need are the mappings \(x \mapsto C\)
and \(y \mapsto V\), and we can use values that are not necessarily
points on the graph so long as they follow the same transformation.
Our new relation should relate the values
\begin{align*}
x=0 &\mapsto C=0, \\
x=1 &\mapsto C=200, \\
y=0 &\mapsto V=0, \\
y=1 &\mapsto V=50.
\end{align*}
It should be clear that the transforming relations are scalings
\begin{equation*} x \mapsto C = 200 x, \quad y \mapsto V = 50 y. \end{equation*}
Consequently, the model for the relation \((C,V)\) will be given by
the chain of variables
\begin{align*}
C &\mapsto x = \frac{C}{200}, \\
x &\mapsto y = f(x) = \frac{x}{1+x}, \\
y &\mapsto V = 50 y.
\end{align*}
Composition through substitution gives us
\begin{align*}
V &= 50 y = 50\Big( \frac{x}{1+x} \Big) = \frac{50x}{1+x} \\
&= \frac{50(\frac{C}{200})}{1+\frac{C}{200}} = \frac{50C}{200+C}.
\end{align*}
That is, our final equation is
\begin{equation*} V = \frac{50C}{200+C}. \end{equation*}

In general, this function is called a Michaelis–Menten curve
and arises in enzyme kinetics (chemistry) as well as resource consumption (biology).
If the saturation value is \(V_{\mathrm{max}}\) (horizontal asymptote)
and the half-saturation concentration is \(K\) (where \(V=\frac{1}{2}V_{\mathrm{max}}\)),
then the curve follows the equation
\begin{equation*} V = \frac{V_{\mathrm{max}} \cdot C}{K + C}. \end{equation*}
The justification follows the same steps as described in this example.

Periodic functions are used to model patterns that repeat with cyclic regularity. The most important periodic functions are the trigonometric functions called the sine and cosine functions. These functions are based on rotating around a circle, measuring angles through radians. (See Appendix B.3 for more details.) The functions are periodic because there are infinitely many values for the angle of rotation that lead to the same position on the circle, and the difference between two such angles is always a multiple of \(2 \pi\) (the circumference of a circle with radius 1).

Definition2.10.14Periodic Function

A function \(f\) is periodic if there is a number \(p\) so that \(f(x+p)=f(x)\) for all \(x\). The smallest such number \(p\) is called the period of the function.

When we are given periodic data that we wish to model with sine or cosine, we can use basic information about that data which include the period, the amplitude, the center line (or mid-line) and the phase shift. Sine and cosine are very symmetric so that the maximum and minimum values are equally distant from the center line. That is, the center line is the midpoint of the maximum and minimum values. The amplitude is the distance between the center line and the extremes and is half the distance between the maximum and minimum values. The phase shift is the point that corresponds to an input of zero to the basic trigonometric functions.

Graphs of sine and cosine are shown below. These have a center line \(y=0\) and an amplitude \(A=1\) (since the maximum is \(y=1\) and the minimum is \(y=-1\)). The period is \(p=2\pi\). Since the functions are not transformed, the phase shift must be \(\phi=0\). For the sine function, the phase shift corresponds to where the graph is crossing the center line in an upward direction. For the cosine function, the phase shift corresponds to where the graph is at its maximum value.

To apply the idea of transformations to model periodic data with sine and cosine, we need to identify the same key features of the data: center line, amplitude, period and phase shift. Finding maximum and minimum values allow us to determine the center line and amplitude. If it is easy to find the value of the independent variable for the maximum or minimum value, then using cosine is a good choice. If it is easy to find the value where the graph up-crosses the center line, then using sine is a good choice. The transformation can then be determined by finding the map between the center lines and extremes (\(y\)-axis) and based on the phase shift and period (\(x\)-axis).

Example2.10.15

You are standing on a boat that is rocking every six seconds such that your height alternates between 5 and 10 feet above sea level. Find a sinusoidal model for your height \(h\) (feet) as a function of time \(t\) (seconds) and where \(t=0\) corresponded to one of the lows, \(h=5\).

When modeling a sinusoidal curve, we need to choose either a sine or cosine. In this example, it is easiest to identify when the model is at an extreme (high or low). So we will model using the cosine function, \(y=\cos(x)\). Our model uses time \(t\) as the independent variable and height \(h\) as the dependent variable. The transformation will be based on finding linear mappings, \begin{equation*} t \mapsto x \overset{\cos}{\mapsto} y \mapsto h.\end{equation*}

To find the linear maps, we identify features of cosine and the corresponding features of our model. The minimum and maximum values for cosine are \(y=-1\) and \(y=1\) while the corresponding values for the model are \(h=5\) and \(h=10\). Similarly, the period of cosine is \(2 \pi\) with the maximum at \(x=0\) and the subsequent minimum at \(x=\pi\). For our model, the period is \(6\) (s) with minima at \(t=0\) and \(t=6\) (a period later). The maximum must occur at \(t=3\). Since the cosine begins at its maximum, this value \(t=3\) is the phase shift.

We find a linear map \(y \mapsto h\), which involves the slope \begin{equation*}\frac{\Delta h}{\Delta y} = \frac{10-5}{1--1} = \frac{5}{2}.\end{equation*} Consequently, using the point–slope equation of a line, we write \begin{equation*}h-5 = \frac{5}{2}(y--1) \quad \Leftrightarrow \quad h = \frac{5}{2} y + \frac{15}{2} = 2.5 y + 7.5.\end{equation*} The value \(h=7.5\) is the center line (midpoint between extremes) and \(A=2.5\) is the amplitude of oscillation from the center line.

We also find a linear map \(t \mapsto x\), which needs to map \(t=3 \mapsto x=0\) (cosine maximum) and \(t=6 \mapsto x=\pi\) (cosine minimum). The slope for this map is \begin{equation*}\frac{\Delta x}{\Delta t} = \frac{\pi-0}{6-3} = \frac{\pi}{3}.\end{equation*} Again using the point–slope equation of a line, we obtain \begin{equation*}x-0 = \frac{\pi}{3}(t-3) \quad \Leftrightarrow \quad x = \frac{\pi}{3}(t-3).\end{equation*}

Using composition of our maps, we arrive at the overall model. The maps are summarized by \begin{gather*}
t \mapsto x = \frac{\pi}{3}(t-3),\\
x \mapsto y = \cos(x),\\
y \mapsto h = 2.5y + 7.5.
\end{gather*} The composition of these maps gives \(t \mapsto h\) using the equation \begin{equation*} h = 2.5 \cos\Big(\frac{\pi}{3}(t-3)\Big) + 7.5. \end{equation*}

This strategy works for general problems, summarized by the following theorem.

Theorem2.10.16Equations for Sinusoidal Models

A sinusoidal model with center line \(y=k\) and amplitude \(A\) and with period \(p\) and phase shift \(x=\phi\) is modeled by \begin{equation*}y = A \sin\Big(\frac{2 \pi}{p}(x-\phi)\Big) + k\end{equation*} when the model is up-crossing the center line at \(x=\phi\) or by \begin{equation*}y=A \cos\Big(\frac{2 \pi}{p}(x-\phi)\Big) + k\end{equation*} when the model is at a maximum at \(x=\phi\).

Using a reference curve \(\tilde y = \sin(\tilde x)\) (sine) or \(\tilde y = \cos(\tilde x)\) (cosine), our transformation will be found with linear mappings \(x \mapsto \tilde x\) and \(\tilde y \mapsto y\) such that \(x=\phi \mapsto \tilde x=0\) and \(x=\phi+p \mapsto \tilde x = 2\pi\). This corresponds to the mapping \begin{equation*}\tilde x = \frac{2\pi}{p}(x-\phi).\end{equation*} Using the center line and maximum values, we require \(\tilde y = 0 \mapsto y=k\) and \(\tilde y = 1 \mapsto y=k+A\). These give the second transformation mapping \begin{equation*}y = A\tilde y + k.\end{equation*} Composition of the maps gives the required formulas.