2.2 Algebra of Functions
Composition of Functions
Suppose we wanted to calculate how much it costs to heat a house on a particular day of the year. The cost to heat a house will depend on the average daily temperature, and the average daily temperature depends on the particular day of the year. Notice how we have just defined two relationships: The temperature depends on the day, and the cost depends on the temperature. Using descriptive variables, we can notate these two functions.
The first function,
Composition of Functions
When the output of one function is used as the input of another, we call the entire operation a composition of functions. We write
An alternate notation for composition uses the composition operator:
Example 1
Suppose
When we are asked to interpret a function, we are being asked to explain the meaning of the expression in words. The inside expression in the composition is
Composition of Functions using Tables and Graphs
When working with functions given as tables and graphs, we can look up values for the functions using a provided table or graph. We start evaluation from the provided input, and first evaluate the inside function. We can then use the output of the inside function as the input to the outside function. To remember this, always work from the inside out.
Example 2
Using the graphs below, evaluate
g of x
f of x

To evaluate
Composition using Formulas
When evaluating a composition of functions where we have either created or been given formulas, the concept of working from the inside out remains the same. First we evaluate the inside function using the input value provided, then use the resulting output as the input to the outside function.
Example 3
Given
Since the inside evaluation is
Then
We are not limited, however, to using a numerical value as the input to the function. We can put anything into the function: a value, a different variable, or even an algebraic expression, provided we use the input expression everywhere we see the input variable.
Example 4
Let
To find
We then use the expression
We then evaluate the function
Since
This gives us the formula for the composition:
Likewise, to find
Example 5
A city manager determines that the tax revenue,
Since we want tax revenue as a function of the year, we want year to be our initial input, and revenue to be our final output. To find revenue, we will first have to predict the city population, and then use that result as the input to the tax function. So we need to find
This composition gives us a single formula which can be used to predict the tax revenue during a given year, without needing to find the intermediary population value.
For example, to predict the tax revenue in 2017, when
Later in this course, it will be desirable to work backwards and decompose a function – to write it as a composition of two simpler functions.
Example 6
Write
We are looking for two functions, g and h, so
We can check our answer by recomposing the functions:
Note that this is not the only solution to the problem. Another non-trivial decomposition would be
Transformations of Functions
Transformations allow us to construct new equations from our basic toolkit functions. The most basic transformations are shifting the graph vertically or horizontally.
Vertical Shift
Given a function
If
If
Horizontal Shift
Given a function
If
If
Example 7
Given
The function
Given f (x) = x , sketch a graph of h(x) = f (x + 1) − 3 = x + 1 − 3 .

Example 8
Write a formula for the graph shown, a transformation of the toolkit square root function.

The graph of the toolkit function starts at the origin, so this graph has been shifted 1 to the right, and up 2. In function notation, we could write that as
Note that this transformation has changed the domain and range of the function. This new graph has domain
Another transformation that can be applied to a function is a reflection over the horizontal or vertical axis.
Reflections
Given a function
If we define a new function
Example 9
A common model for learning has an equation similar to

Long description: The left side of the graph is asymptotic to x-axis and the right side of the graph is increasing. The graph passes through the point (0, 1). This equation combines three transformations into one equation.
A horizontal reflection:
a vertical reflection:
a vertical shift up 1:
We can sketch a graph by applying these transformations one at a time to the original function:
The original graph
Horizontally reflected
Then vertically reflected

Long description: The left side of the graph is asymptotic to x-axis and the right side of the graph is increasing. The graph passes through the point (0, 1).

Long description: The left side of the graph is increasing and the right side of the graph is asymptotic to x-axis. The graph passes through the point (0, 1).

Long description: The graph is increasing from left to right. The graph approaches negative infinity on the left side and the graph is asymptotic to x-axis from below on the right side. The graph passes through the point (0, -1).
Then, after shifting up 1, we get the final graph:

Long description: The graph is increasing from left to right. The graph approaches negative infinity on the left side and the graph is asymptotic the horizontal line y = 1 from below on the right side. The graph passes through the point (0, 0). Note: As a model for learning, this function would be limited to a domain of
With shifts, we saw the effect of adding or subtracting to the inputs or outputs of a function. We now explore the effects of multiplying the outputs.
Vertical Stretch/Compression
Given a function
- If
, then the graph will be stretched - If
, then the graph will be compressed - If
then there will be combination of a vertical stretch or compression with a vertical reflection
Example 10
The graph below is a transformation of the toolkit function

Long description: The graph is increasing from left to right. The graph approaches negative infinity on the left side and the graph approaches negative infinity on the right side. The graph passes through the point (0, 0). When trying to determine a vertical stretch or shift, it is helpful to look for a point on the graph that is relatively clear. In this graph, it appears that
We can write a formula for
Combining Transformations
When combining vertical transformations, it is very important to consider the order of the transformations. For example, vertically shifting by 3 and then vertically stretching by 2 does not create the same graph as vertically stretching by 2 and then vertically shifting by 3. The order follows nicely from order of operations.
Combining Vertical Transformations
When combining vertical transformations written in the form
Example 11
Write an equation for the transformed graph of the quadratic function shown.

Since this is a quadratic function, first consider what the basic quadratic tool kit function looks like and how this has changed. Observing the graph, we notice several transformations:
The original tool kit function has been flipped over the x axis, some kind of stretch or compression has occurred, and we can see a shift to the right 3 units and a shift up 1 unit.
In total there are four operations:
- Vertical reflection, requiring a negative sign outside the function
- Vertical Stretch
- Horizontal Shift Right 3 units, which tells us to put
on the inside of the function - Vertical Shift up 1 unit, telling us to add 1 on the outside of the function
By observation, the basic tool kit function has a vertex at (0, 0) and symmetrical points at (1, 1) and (-1, 1). These points are one unit up and one unit over from the vertex. The new points on the transformed graph are one unit away horizontally but 2 units away vertically. They have been stretched vertically by two.
Not everyone can see this by simply looking at the graph. If you can, great, but if not, we can solve for it. First, we will write the equation for this graph, with an unknown vertical stretch.
We now know our graph is going to have an equation of the form
This tells us that to produce the graph we need a vertical stretch by two.
Thus the function that produces this graph is
Example 12
On what interval(s) is the function
This is a transformation of the toolkit reciprocal squared function,
The basic reciprocal squared function is increasing on
