Section 2.5 Transformations of Functions
¶Overview.
As a final section in the chapter on functions, we turn our attention to transformations. We think of functions as a relation between variables, \(x \mapsto y\text{.}\) In general, a transformation maps the state \((x,y)\) to another pair \((u,v)\text{.}\) Sometimes, we will think of starting with a function \(x \mapsto y\) and describe the transformation by describing what happens to each of the coordinates, \(x \mapsto u\) and \(y \mapsto v\text{.}\) This is how we might normally think about elementary transformations including translations or shifts, scaling or stretching, and reflections.
In modeling settings, on the other hand, we might think of \((u,v)\) as being physical variables which show a relationship similar to a well-known mathematical relationship. That relationship might seen in a graph as a parabola, as exponential growth or decay, or as periodic cycles that look like a sine wave. Here, we might think of \((x,y)\) as describing the mathematically simple function. In order to understand the function \(u \mapsto v\) based on the function \(x \mapsto y\text{,}\) we will more naturally think of the transformation as finding a way to map \(u \mapsto x\) and \(y \mapsto v\text{.}\) Elementary transformations that include translations, scaling, and reflections correspond to \(u \mapsto x\) and \(y \mapsto v\) that are linear functions.
Subsection 2.5.1 Elementary Transformations
The elementary transformations of a graph include translation, scaling, and reflection. In algebra courses, we are often given a summary of the equations of such transformations.
Elementary Transformations of Graphs.
Suppose we know the graph of a function \(y=f(x)\text{.}\) The following equations define the specified transformations of that graph.
- Vertical translation, shifting the graph \(c\) units vertically,\begin{equation*} y=f(x)+c\text{.} \end{equation*}
- Horizontal translation, shifting the graph \(c\) units horizontally,\begin{equation*} y=f(x-c)\text{.} \end{equation*}
- Vertical scaling, stretching or compressing all vertical coordinates by a factor \(a\text{,}\)\begin{equation*} y=af(x)\text{.} \end{equation*}
- Horizontal scaling, stretching or compressing all horizontal coordinates by a factor \(a\text{,}\)\begin{equation*} y=f(\frac{x}{a})\text{.} \end{equation*}
- Vertical reflection across the horizontal axis,\begin{equation*} y=-f(x)\text{.} \end{equation*}
- Horizontal reflection across the vertical axis,\begin{equation*} y=f(-x)\text{.} \end{equation*}
There are some key patterns to these equations of transformation. All of the vertical transformations occur outside the function, while all of the horizontal transformations occur on the input to the function. Vertical transformations involve arithmetic consistent with the operation. For example, to move the graph up 3 units, you add \(+3\) to the output of the function. Horizontal transformations involve arithmetic opposite of the desired operation. To move a graph 3 units to the right, you add \(-3\) to the independent variable.
The following interactive graphs allow you to explore transformations of the graph \(y=\sin(x)\) by dragging sliders.
Example 2.5.1.
Explore horizontal and vertical translations using the equation
using parameters \(a\) and \(b\text{.}\) Notice that because the input to the sine function is \(x+a=x--a\text{,}\) the direction of translation is opposite the value of \(a\) chosen. The values \(a=0\) and \(b=0\) correspond to no transformation.
Example 2.5.3.
Explore horizontal and vertical scaling using the equation
using parameters \(a\) and \(b\text{.}\) Notice that negative multiples result in reflections. The values \(a=1\) and \(b=1\) correspond to no transformation.
We will explore a new approach to understanding transformations that will help us understand more complicated transformations. This approach will also help us understand why horizontal transformations seem to be opposite of what we want.
We start by thinking of the original graph \(y=f(x)\) as a relation between two variables. The transformation will define a relation between two other variables, which usually will have some physical interpretation that we want to model. In this section, we will name the physical variables \(u\) and \(v\text{.}\) If our physical variables should be named \(x\) and \(y\text{,}\) then we need a way to distinguish between the original relation and the transformed relation representing physical variables. We might use uppercase \(X\) and \(Y\) or decorate the variables \(\tilde{x}\) and \(\tilde{y}\text{.}\)
In our general approach to transformations, we will describe the transformation as the composition of a chain of mappings. Because we ultimately want a function \(u \mapsto v\text{,}\) we start with the physical variable \(u\) and need to map it to the mathematical variable \(x\text{,}\) \(u \overset{d}{\mapsto} x\text{.}\) The original function \(f\) provides the relation \(x \overset{f}\mapsto y\text{.}\) Then we need to find a map from the mathematical dependent variable \(y\) to the physical dependent variable \(v\text{,}\) \(y \overset{r}{\mapsto} v\text{.}\) This is summarized by the following notation:
That is, we are going to think of the original graph as some function representing an operation. Our transformed graph is going to be a sequence of operations that includes that operation in addition to operations that transform the values in the domain and range. All operations that occur before the function operation represented by the original graph affect the domain values, represented above by the function \(d : u \mapsto x\text{.}\) All operations that occur after the function operation affect the range values, represented above by the function \(r : y \mapsto v\text{.}\)
Example 2.5.5.
Consider the function \(f(x) = 2(x-3)^2+4\text{.}\) This is a transformation of the squaring function \(y=x^2\text{.}\) Identify the operations affecting the domain and range in the transformation.
Let \(\mathrm{sq}(x)=x^2\) represent the operation that squares the input value. Then our function \(f(x)\) can be written as a composition of operations that occur before squaring and after squaring as
where \(r(y) = 2y+4\) and \(d(x)=x-3\text{.}\) That is, the function \(f\) performs the following operations:
- Take the input \(x\text{,}\)
- Subtract 3,
- Square the result,
- Multiply the result by 2 and add 4.
The function \(d\) describes steps before squaring, and the function \(r\) describes the steps after squaring.
The physical meaning of the variables in the graph of \(y=f(x)\) are different from the meaning of the variables in the graph of \(y=x^2\text{,}\) even though we use the same symbols. If we use the decorated variables \((\tilde x, \tilde y)\) for our transformed graph, then we will think of \(f\) as a map \(\tilde x \mapsto \tilde y\text{.}\) We have a chain:
On the other hand, when we geometrically describe a transformation, we usually describe how we take the original graph in \((x,y)\)-coordinates in order to find the graph for the physical relation in \((u,v)\)-coordinates. Describing the horizontal transformation corresponds to a mapping \(x \mapsto u\text{.}\) Our composition was stated in terms of the inverse operation \(d : u \mapsto x\text{.}\) This means that the geometric description of a transformation of the domain involves the inverse of the function used in the actual composition. This explains why horizontal transformations use operations that are the inverse of what we expect.
Example 2.5.6.
Describe how the graph of the function \(y = f(x) = 2(x-3)^2+4\) is a transformation of the elementary parabola \(y=x^2\text{.}\)
Based on the work in the previous example, we saw that \(f(x) = r \circ \mathrm{sq} \circ d(x)\text{.}\) The transformation is geometrically described by taking a point \((x,y)\) on the parabola and mapping it to a new point \((\tilde x, \tilde y)\) on our transformed parabola. The domain is transformed using the inverse function for \(d\text{,}\)
That is, the graph is translated (shifted) to the right by \(+3\) units. The range is transformed by the function \(r\text{,}\)
That is, the \(y\)-value of every point is first multiplied by \(2\) and then increased by adding \(4\text{.}\)
To illustrate the transformation, \((\tilde x, \tilde y) = (x+3, 2y+4)\text{,}\) consider some actual points from \(y=x^2\text{.}\)
A graph that includes these points is shown below, in comparison with the original parabola.
We consider one more example of interpreting the transformation of a known graph.
Example 2.5.7.
Describe \(y=2^{-3x}+5\) as a transformation of the graph \(y=2^x\text{.}\)
To make the distinction between variables more clear with two equations, let \((\tilde x, \tilde y)\) be the variables in the new equation
and \(y=2^x\text{.}\) The steps prior to the exponential base \(b=2\) identify \(x = -3 \tilde x\) and the steps after the exponential give \(\tilde y = y + 5\text{.}\) If we solve the first equation for \(\tilde x\) to obtain \(\tilde x = -\frac{1}{3} x\text{,}\) we have our geometric description of the transformation:
That is, the graph is horizontally compressed by a factor of \(\frac13\) and reflected across the \(y\)-axis. Vertically, the graph is shifted up by 5 units.
Examples of points on the original graph \(y=2^x\) include \((0,1)\text{,}\) \((1,2)\text{,}\) and \((2,4)\text{.}\) The transformed graph results in these points being mapped to point \((\tilde x, \tilde y)\) given by \((0,6)\text{,}\) \((-\frac13, 7)\text{,}\) and \((-\frac23, 9)\text{.}\) In addition, the original graph includes a horizontal asymptote of \(y=0\text{.}\) The transformation \(\tilde y = y + 5\) also applies to the asymptote, which is mapped to \(\tilde y = 5\text{.}\)
Subsection 2.5.2 Creating a Model by Transformations
The elementary transformations correspond to coordinates that are mapped using linear functions for \(u \mapsto x\) and \(y \mapsto v\text{.}\) The slope affects scaling and reflection and a non-zero intercept corresponds affects translation. If we know where corresponding points are found in the original and the transformed graphs, then we can find linear functions that map the coordinates. We use these functions to find the equation of the transformed graph.
Pay particular attention to the order of the mappings. The horizontal transformation that will be used in the composition is \(u \mapsto x\text{.}\) That is, we map from our physical independent variable (what we model) to a corresponding value of the independent variable in the elementary model. This is the inverse map of the geometric description of the transformation. On the other hand, the vertical transformation matches the geometric description, \(y \mapsto v\text{.}\) We map from the value of the dependent variable in the elementary model to our dependent physical variable.
Example 2.5.8.
Find the equation of a parabola whose vertex is at \((2,3)\) and which has another point at \((4,5)\) by finding a transformation of \(y=x^2\) using the points \((0,0)\) and \((1,1)\text{.}\)
Our original graph uses coordinates \((x,y)\text{.}\) For our transformed graph, we will use coordinates \((u,v)\text{.}\) Based on the description of the problem, we need a geometric transformation of coordinates
and
We will work with one coordinate variable at a time.
The transformation of \(x\)-coordinates, \(u \mapsto x\text{,}\) is illustrated in the following map. The \(u\)-coordinate \(u=2\) of the vertex should map to the \(x\)-coordinate \(x=0\text{,}\) and the \(u\)-coordinate \(u=4\) of the second point should map to the \(x=1\text{.}\)
This map is a linear function. To help reinforce what we are doing in this map, we also illustrate the map using a graph. The input variable for the map is \(u\text{,}\) which will be on the horizontal axis. The output variable of the map is \(x\text{,}\) which will be on the vertical axis. From our map, we know that \((u,x) = (2,0)\) should be on our graph. We also know that \((u,x) = (4,1)\) should be on the graph. Our linear function corresponds to the equation of the line in this graph.
To find the equation of the function, we need the slope,
Using the given point \((u,x)=(2,0)\) and the point–slope equation, we find
The transformation of \(y\)-coordinates is similar, illustrated as another map below. The given points correspond to \(y=0 \mapsto v=3\) and \(y=1 \mapsto v=5\text{.}\)
We can create the equation of the linear function describing this map. We don't need to draw the graph so long as we recognize the points that would be on the line. These two points are \((y,v) = (0,3)\) and \((y,v)=(1,5)\text{.}\) The equation for the map \(y \mapsto v\) requires the slope,
and the known point \((y,v)=(0,3)\text{.}\) The transformation is given by
We find the equation of the transformation by finding the composition represented by the chain,
Simplifying this composition gives
If we wanted our transformed variables to be \((x,y)\text{,}\) then we just substitute those variables and the resulting equation would be
A graph of \(y=x^2\) and the transformation are shown in the figure below.
To find the equations used in the composition for a transformation, you don't need to use the same points for both maps. All that you need to do is find the linear equation required to transform each coordinate separately. Sometimes, it is more convenient to choose different features to describe \(u \mapsto x\) and \(y \mapsto y\text{.}\) The following example illustrates this for a sinusoidal graph.
Example 2.5.9.
The sine function \(y=\sin(x)\) is a periodic function with a period \(2\pi\) and range \([-1,1]\text{.}\) Key points on the graph include \((0,0)\text{,}\) \((\frac{\pi}{2},1)\text{,}\) \((\pi,0)\text{,}\) \((\frac{3\pi}{2},-1)\text{,}\) and \((2\pi,0)\text{.}\) Any graph that is an elementary transformation of the sine function is called sinusoidal.
Use transformations of the sine function to model the height \(H\) (in cm) of a mass bouncing on a spring as function of time \(t\) (in s). The mass completes one cycle every 2 seconds and reaches a maximum height of 10 cm and minimum height of 2 cm. The mass is known to be at its minimum at \(t=0\text{.}\)
In order to find our model \(t \mapsto H\text{,}\) we need to determine a composition of maps
We will need to find the functions relating the independent and dependent variables separately.
We start by finding the map corresponding to the independent variables, \(t \mapsto x\text{.}\) Because our mass is at its minimum at \(t=0\) and the sine function is at its minimum at \(x=\frac{3\pi}{2}\text{,}\) we can use the point \((t,x)=(0,\frac{3\pi}{2})\text{.}\) We use the period to find a second point. The mass will return to its minimum at \(t=2\text{.}\) The sine function returns to its minimum at \(x=\frac{3\pi}{2} + 2\pi\text{.}\)
We use the points \((t,x)=(0,\frac{3\pi}{2})\) and \((t,x)=(2,\frac{3\pi}{2}+2\pi)\) to find the transformation \(t \mapsto x\text{.}\) First, we find the slope or rate of change,
Note that this is the ratio of the period of the elementary model \(2\pi\) to the period of the oscillating mass \(p=2\text{.}\) We then write down the equation using the point–slope form of a line,
To find the transformation for the dependent variables \(y \mapsto H\text{,}\) we can use the minimum and maximum values. The sine function has minimum \(y=-1\) and maximum \(y=1\text{.}\) The mass has minimum height \(H=2\) and maximum height \(H=10\text{.}\) Our map \(y \mapsto H\) includes the points \((y,H)=(-1,2)\) and \((y,H)=(1,10)\text{.}\) The equation is based on the slope or rate of change
and the point–slope equation
We put these together as a chain or composition,
using the individual relations found above,
Combining these equations, we find our model equation
A graph shows that this model matches the description given.
In general, a sinusoidal graph can be characterized by a centerline \(v=c\text{,}\) an amplitude \(A\text{,}\) a period \(p\text{,}\) and a phase shift \(u=\phi\text{.}\) The standard period of the elementary sine and cosine functions is \(2\pi\text{.}\) The phase shift \(\phi\) is the value of the physical variable \(u=\phi\) that corresponds to \(x=0\text{.}\) These two pieces of information completely determine the map \(u \mapsto x\text{,}\) with slope \(\frac{\Delta x}{\Delta u} = \frac{2\pi}{p}\text{,}\) with a point–slope equation
The centerline \(v=c\) physically corresponds to the elementary centerline of \(y=0\text{.}\) The amplitude \(A\) corresponds to the elementary amplitude of 1. Consequently, the slope of the transformation map \(y \mapsto v\) is \(\frac{\Delta v}{\Delta y} = A\) so that the point–slope equation of the map is
The composition of the chain of mappings with the sine function results in
while a composition with the cosine function results in
We use the sine function when the phase shift corresponds to where the graph crosses the centerline \(v=c\text{;}\) the cosine function is used when the phase shift corresponds to the locations of maximum values at \(v=c+A\text{.}\)
Subsection 2.5.3 Summary
- Elementary transformations of a graph of a function include translation, scaling, and reflection.
- Vertical transformations are applied to the output of the function directly.
- Horizontal transformations are applied to the input of the function as inverse operations.
-
Elementary transformations can be found using linear functions that map the original coordinates \((x,y)\) to the transformed coordinates \((X,Y)\) with \(x \overset{T_x}\mapsto X \) and \(y \overset{T_y}\mapsto Y\) using composition,
\begin{equation*} X \overset{T_x^{-1}}\mapsto x \mapsto y \overset{T_y}\mapsto Y. \end{equation*}- Addition by a constant (intercept) corresponds to translation.
- Multiplication by a constant (slope) corresponds to rescaling.
- A negative multiple (slope) corresponds to reflection.
- Nonlinear transformations using invertible maps can also be useful. A common transformation is the logarithm, corresponding to viewing a graph with logarithmic scales.
- Data \((x,y)\) that appear linear on a semi-log plot (with the \(y\)-axis in logarithmic scale) means that \((x,\ln(y))\) will have a linear relation. Subsequently, \(x \mapsto y\) will be an exponential model.
- Data \((x,y)\) that appear linear on a log-log plot (with both axes in logarithmic scale) means that \((\ln(x),\ln(y))\) will have a linear relation. Subsequently, \(x \mapsto y\) will be a power function model.
Exercises 2.5.4 Exercises
1.
Find the equation of a parabola with a vertex at \((3,2)\) and a second point at \((6,0)\text{.}\)
2.
View a graph of \(y=|x|\text{,}\) which forms the shape of a “V”. Find the equation of a transformation that moves the vertex to \((-3,2)\text{,}\) opens downward, and has a second point at \((0,0)\text{.}\)
3.
The function \(\displaystyle f(x)=\frac{x}{1+x}\) is a simple increasing, concave down function that passes through \(f(0)=0\) and has a horizontal asymptote \(y=1\) and half-saturation constant \(x=1\text{.}\) This basic function is often used to model the reaction rate of enzyme-catalyzed reactions.
Suppose that \(C\) is the concentration of a reactant in an enzyme-catalyzed reaction and \(V\) is the rate of reaction. Use transformations of \(y=\frac{x}{1+x}\) to find a model for \(C \mapsto V\) such that the \((C,V)=(0,0)\) is a possible state, the saturating rate is \(V=50\text{,}\) and the half-saturation occurs at \(C=80\text{.}\)
4.
The Gaussian function \(f(x)=e^{-\frac{1}{2}x^2}\) is symmetric about \(x=0\) with a maximum \(f(0)=1\text{,}\) has a horizontal asymptote \(y=0\) as \(x \to \pm \infty\text{,}\) and has inflection points at \(x=\pm 1\text{.}\) This function is often used in statistics to describe normally distributed data.
The height of individuals in a population were recorded and observed to have a normal distribution. A histogram plot showing the number of individuals \(N\) with the same height \(H\text{,}\) rounded to the nearest centimeter, could be modeled \(H \mapsto N\) as a transformation of \(f\text{.}\) The maximum in the histogram (line of symmetry) is at \(H=152\) cm with \(N=250\text{.}\) The inflection points were observed to be at \(H=144\) cm and \(H=160\) cm. The horizontal asymptote is still \(N=0\text{.}\) Find a Gaussian curve to model the distribution.
5.
Find an equation for a sinusoidal graph \((x,y)\) with a period 10, a center line (midpoint between the maximum and minimum) of \(y=8\text{,}\) and has a maximum at \((x,y)=(2,11)\text{.}\)
6.
The number of hours of daylight \(H\) is a periodic function of the time \(D\text{,}\) measured in days after the year begins. The cycle repeats every 365 days. The longest day is on the summer solstice, which occurs at \(D=172.25\text{,}\) with \(H=14.85\text{.}\) The shortest day is the winter solstice, which occurs at \(D=354.75\text{,}\) with \(H=9.48\text{.}\) Find a sinusoidal model for \(D \mapsto H\text{.}\) Use your model to determine the number of hours of daylight on \(pi\)-day, \(D=72\text{.}\)
7.
The cosine is another trigonometric function with period \(2\pi\) and range \([-1,1]\) and has the identical graph shape as sine. However, the maximum for cosine occurs at \(\cos(0)=1\) and the minimum occurs at \(\cos(\pi)=-1\text{.}\) Find the equation of cosine in terms of the sine function by using transformations.
8.
The square of the cosine function, \(\cos^2(x)\text{,}\) has the same shape as the sine and cosine graphs, except that the period is \(\pi\) and the minimum and maximum values are \(0\) and \(1\text{,}\) respectively. We know \(\cos^2(0)=1\) and \(\cos^2(\frac{\pi}{2})=0\text{.}\) Find the equation of \(\cos^2(x)\) in terms of the sine or cosine function by using transformations.
9.
The square of the sine function, \(\sin^2(x)\text{,}\) has the same shape as the sine and cosine graphs, except that the period is \(\pi\) and the minimum and maximum values are \(0\) and \(1\text{,}\) respectively. We know \(\sin^2(0)=0\) and \(\sin^2(\frac{\pi}{2})=1\text{.}\) Find the equation of \(\sin^2(x)\) in terms of the sine or cosine function by using transformations.
10.
A population \(P\) grows exponentially in time \(t\) such that \(P=500\) when \(t=2\) and triples every 12 years. Use the semi-log transform to find a linear model \(t \mapsto \ln(P)\) and then find the model \(t \mapsto P\text{.}\) What was the population when \(t=0\text{?}\)
11.
In a simple electrical circuit, the voltage \(V\) on a capacitor decays exponentially as a function of time \(t\text{.}\) After \(t=5\) seconds, we find \(V=8\) volts; after another 5 seconds, we find \(V=6.4\) volts. Use the semi-log transform to find a linear model \(t \mapsto \ln(V)\) and then find the exponential model \(t \mapsto V\text{.}\) When will the circuit reach \(V=1\) volt?
12.
During childhood development, the head grows at a different rate than the rest of the body. This is why the heads of young children look larger proportional to their body than older children and adults. Such growth is called allometry and is often observed to follow a power law.
According to the World Health Organization's statistics for child development, the median circumference \(C\) of the head for a one-year-old girl is 45 cm and the median height \(H\) is 74.5 cm. For a five-year-old, the median head size is \(C=50\) cm and the median height is \(H=109.5\) cm. Use a log-log transform to find a linear model \(\ln(H) \mapsto \ln(C)\) and then find the power function model \(H \mapsto C\text{.}\) If this pattern continues, predict the head circumference for a ten-year-old where the median height is \(H=140\) cm.
13.
Chemical reactions generally occur at a rate \(R\) that is proportional to a power of the reactant concentration \(C\text{.}\) Such a reaction will have a graph \((C,R)\) that appears linear in a log-log plot. Suppose you have a reaction such that \(R=0.5\) when \(C=0.2\) and \(R=1.5\) when \(C=0.4\text{.}\) Use a log-log transform to find a linear model \(\ln(C) \mapsto \ln(R)\) and then find the power function model \(C \mapsto R\text{.}\)