Learning Objectives
In this section, you will:
- Combine functions using algebraic operations.
- Create a new function by composition of functions.
- Evaluate composite functions.
- Find the domain of a composite function.
- Decompose a composite function into its component functions.
Suppose we want 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 in turn, the average daily temperature depends on the particular day of the year. Notice how we have just defined two relationships: The cost depends on the temperature, and the temperature depends on the day.
Using descriptive variables, we can notate these two functions. The function C(T)πΆ(π) gives the cost CπΆ of heating a house for a given average daily temperature in Tπ degrees Celsius. The function T(d)π(π) gives the average daily temperature on day dπ of the year. For any given day, Cost=C(T(d))Cost=πΆ(π(π)) means that the cost depends on the temperature, which in turns depends on the day of the year. Thus, we can evaluate the cost function at the temperature T(d).π(π). For example, we could evaluate T(5)π(5) to determine the average daily temperature on the 5th day of the year. Then, we could evaluate the cost function at that temperature. We would write C(T(5)).πΆ(π(5)).
By combining these two relationships into one function, we have performed function composition, which is the focus of this section.
Combining Functions Using Algebraic Operations
Function composition is only one way to combine existing functions. Another way is to carry out the usual algebraic operations on functions, such as addition, subtraction, multiplication and division. We do this by performing the operations with the function outputs, defining the result as the output of our new function.
Suppose we need to add two columns of numbers that represent a husband and wifeβs separate annual incomes over a period of years, with the result being their total household income. We want to do this for every year, adding only that yearβs incomes and then collecting all the data in a new column. If w(y)π€(π¦) is the wifeβs income and h(y)β(π¦) is the husbandβs income in year y,π¦, and we want Tπ to represent the total income, then we can define a new function.
T(y)=h(y)+w(y)π(π¦)=β(π¦)+π€(π¦)
If this holds true for every year, then we can focus on the relation between the functions without reference to a year and write
T=h+wπ=β+π€
Just as for this sum of two functions, we can define difference, product, and ratio functions for any pair of functions that have the same kinds of inputs (not necessarily numbers) and also the same kinds of outputs (which do have to be numbers so that the usual operations of algebra can apply to them, and which also must have the same units or no units when we add and subtract). In this way, we can think of adding, subtracting, multiplying, and dividing functions.
For two functions f(x)π(π₯) and g(x)π(π₯) with real number outputs, we define new functions f+g,fβg,fg,π+π,πβπ,ππ, and fgππ by the relations
(f+g)(x)(fβg)(x) (fg)(x)(fg)(x)====f(x)+g(x)f(x)βg(x)f(x)g(x)f(x)g(x)whereg(x)β 0(π+π)(π₯)=π(π₯)+π(π₯)(πβπ)(π₯)=π(π₯)βπ(π₯) (ππ)(π₯)=π(π₯)π(π₯)(ππ)(π₯)=π(π₯)π(π₯)whereπ(π₯)β 0
EXAMPLE 1
Performing Algebraic Operations on Functions
Find and simplify the functions (gβf)(x)(πβπ)(π₯) and (gf)(x),(ππ)(π₯), given f(x)=xβ1π(π₯)=π₯β1 and g(x)=x2β1.π(π₯)=π₯2β1. Are they the same function?
Solution
Begin by writing the general form, and then substitute the given functions.
(gβf)(x)(gβf)(x)(gβf)(x)(gβf)(x)(gf)(x)(gf)(x)(gf)(x)(gf)(x)========g(x)βf(x)x2β1β(xβ1)x2βxx(xβ1)g(x)f(x)x2β1xβ1(x+1)(xβ1)xβ1x+1wherexβ 1(πβπ)(π₯)=π(π₯)βπ(π₯)(πβπ)(π₯)=π₯2β1β(π₯β1)(πβπ)(π₯)=π₯2βπ₯(πβπ)(π₯)=π₯(π₯β1)(ππ)(π₯)=π(π₯)π(π₯)(ππ)(π₯)=π₯2β1π₯β1(ππ)(π₯)=(π₯+1)(π₯β1)π₯β1whereπ₯β 1(ππ)(π₯)=π₯+1
No, the functions are not the same.
Note: For (gf)(x),(ππ)(π₯), the condition xβ 1π₯β 1 is necessary because when x=1,π₯=1, the denominator is equal to 0, which makes the function undefined.
TRY IT #1
Find and simplify the functions (fg)(x)(ππ)(π₯) and (fβg)(x).(πβπ)(π₯).
f(x)=xβ1 and g(x)=x2β1π(π₯)=π₯β1 and π(π₯)=π₯2β1
Are they the same function?
Create a Function by Composition of Functions
Performing algebraic operations on functions combines them into a new function, but we can also create functions by composing functions. When we wanted to compute a heating cost from a day of the year, we created a new function that takes a day as input and yields a cost as output. The process of combining functions so that the output of one function becomes the input of another is known as a composition of functions. The resulting function is known as a composite function. We represent this combination by the following notation:
(fβg)(x)=f(g(x))(πβπ)(π₯)=π(π(π₯))
We read the left-hand side as βfβπ composed with gπ at x,βπ₯,β and the right-hand side as βfβπ of gπ of x.βπ₯.β The two sides of the equation have the same mathematical meaning and are equal. The open circle symbol ββ is called the composition operator. We use this operator mainly when we wish to emphasize the relationship between the functions themselves without referring to any particular input value. Composition is a binary operation that takes two functions and forms a new function, much as addition or multiplication takes two numbers and gives a new number. However, it is important not to confuse function composition with multiplication because, as we learned above, in most cases f(g(x))β f(x)g(x).π(π(π₯))β π(π₯)π(π₯).
It is also important to understand the order of operations in evaluating a composite function. We follow the usual convention with parentheses by starting with the innermost parentheses first, and then working to the outside. In the equation above, the function gπ takes the input xπ₯ first and yields an output g(x).π(π₯). Then the function fπ takes g(x)π(π₯) as an input and yields an output f(g(x)).π(π(π₯)).
In general, fβgπβπ and gβfπβπ are different functions. In other words, in many cases f(g(x))β g(f(x))π(π(π₯))β π(π(π₯)) for all x.π₯. We will also see that sometimes two functions can be composed only in one specific order.
For example, if f(x)=x2π(π₯)=π₯2 and g(x)=x+2,π(π₯)=π₯+2, then
f(g(x))===f(x+2)(x+2)2×2+4x+4π(π(π₯))=π(π₯+2)=(π₯+2)2=π₯2+4π₯+4
but
g(f(x))==g(x2)x2+2π(π(π₯))=π(π₯2)=π₯2+2
These expressions are not equal for all values of x,π₯, so the two functions are not equal. It is irrelevant that the expressions happen to be equal for the single input value x=β12.π₯=β12.
Note that the range of the inside function (the first function to be evaluated) needs to be within the domain of the outside function. Less formally, the composition has to make sense in terms of inputs and outputs.
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. For any input xπ₯ and functions fπ and g,π, this action defines a composite function, which we write as fβgπβπ such that
(fβg)(x)=f(g(x))(πβπ)(π₯)=π(π(π₯))
The domain of the composite function fβgπβπ is all xπ₯ such that xπ₯ is in the domain of gπ and g(x)π(π₯) is in the domain of f.π.
It is important to realize that the product of functions fgππ is not the same as the function composition f(g(x)),π(π(π₯)), because, in general, f(x)g(x)β f(g(x)).π(π₯)π(π₯)β π(π(π₯)).
EXAMPLE 2
Determining whether Composition of Functions is Commutative
Using the functions provided, find f(g(x))π(π(π₯)) and g(f(x)).π(π(π₯)). Determine whether the composition of the functions is commutative.
f(x)=2x+1g(x)=3βxπ(π₯)=2π₯+1π(π₯)=3βπ₯
Solution
Letβs begin by substituting g(x)π(π₯) into f(x).π(π₯).
f(g(x))===2(3βx)+16β2x+17β2xπ(π(π₯))=2(3βπ₯)+1=6β2π₯+1=7β2π₯
Now we can substitute f(x)π(π₯) into g(x).π(π₯).
g(f(x))===3β(2x+1)3β2xβ1β2x+2π(π(π₯))=3β(2π₯+1)=3β2π₯β1=β2π₯+2
We find that g(f(x))β f(g(x)),π(π(π₯))β π(π(π₯)), so the operation of function composition is not commutative.
EXAMPLE 3
Interpreting Composite Functions
The function c(s)π(π ) gives the number of calories burned completing sπ sit-ups, and s(t)π (π‘) gives the number of sit-ups a person can complete in tπ‘ minutes. Interpret c(s(3)).π(π (3)).
Solution
The inside expression in the composition is s(3).π (3). Because the input to the s-function is time, t=3π‘=3 represents 3 minutes, and s(3)π (3) is the number of sit-ups completed in 3 minutes.
Using s(3)π (3) as the input to the function c(s)π(π ) gives us the number of calories burned during the number of sit-ups that can be completed in 3 minutes, or simply the number of calories burned in 3 minutes (by doing sit-ups).
EXAMPLE 4
Investigating the Order of Function Composition
Suppose f(x)π(π₯) gives miles that can be driven in xπ₯ hours and g(y)π(π¦) gives the gallons of gas used in driving yπ¦ miles. Which of these expressions is meaningful: f(g(y))π(π(π¦)) or g(f(x))?π(π(π₯))?
Solution
The function y=f(x)π¦=π(π₯) is a function whose output is the number of miles driven corresponding to the number of hours driven.
number of miles =f(number of hours)number of miles =π(number of hours)
The function g(y)π(π¦) is a function whose output is the number of gallons used corresponding to the number of miles driven. This means:
number of gallons =g(number of miles)number of gallons =π(number of miles)
The expression g(y)π(π¦) takes miles as the input and a number of gallons as the output. The function f(x)π(π₯) requires a number of hours as the input. Trying to input a number of gallons does not make sense. The expression f(g(y))π(π(π¦)) is meaningless.
The expression f(x)π(π₯) takes hours as input and a number of miles driven as the output. The function g(y)π(π¦) requires a number of miles as the input. Using f(x)π(π₯) (miles driven) as an input value for g(y),π(π¦), where gallons of gas depends on miles driven, does make sense. The expression g(f(x))π(π(π₯)) makes sense, and will yield the number of gallons of gas used, g,π, driving a certain number of miles, f(x),π(π₯), in xπ₯ hours.
Q&A
Are there any situations where f(g(y))π(π(π¦)) and g(f(x))π(π(π₯)) would both be meaningful or useful expressions?
Yes. For many pure mathematical functions, both compositions make sense, even though they usually produce different new functions. In real-world problems, functions whose inputs and outputs have the same units also may give compositions that are meaningful in either order.
TRY IT #2
The gravitational force on a planet a distance r from the sun is given by the function G(r).πΊ(π). The acceleration of a planet subjected to any force FπΉ is given by the function a(F).π(πΉ). Form a meaningful composition of these two functions, and explain what it means.
Evaluating Composite Functions
Once we compose a new function from two existing functions, we need to be able to evaluate it for any input in its domain. We will do this with specific numerical inputs for functions expressed as tables, graphs, and formulas and with variables as inputs to functions expressed as formulas. In each case, we evaluate the inner function using the starting input and then use the inner functionβs output as the input for the outer function.
Evaluating Composite Functions Using Tables
When working with functions given as tables, we read input and output values from the table entries and always work from the inside to the outside. We evaluate the inside function first and then use the output of the inside function as the input to the outside function.
EXAMPLE 5
Using a Table to Evaluate a Composite Function
UsingΒ Table 1, evaluateΒ f(g(3))π(π(3))Β andΒ g(f(3)).π(π(3)).
| xπ₯ | f(x)π(π₯) | g(x)π(π₯) |
|---|---|---|
| 1 | 6 | 3 |
| 2 | 8 | 5 |
| 3 | 3 | 2 |
| 4 | 1 | 7 |
Solution
To evaluate f(g(3)),π(π(3)), we start from the inside with the input value 3. We then evaluate the inside expression g(3)π(3) using the table that defines the function g:π: g(3)=2.π(3)=2. We can then use that result as the input to the function f,π, so g(3)π(3) is replaced by 2 and we get f(2).π(2). Then, using the table that defines the function f,π, we find that f(2)=8.π(2)=8.
g(3)f(g(3))==2f(2)=8π(3)=2π(π(3))=π(2)=8
To evaluate g(f(3)),π(π(3)), we first evaluate the inside expression f(3)π(3) using the first table: f(3)=3.π(3)=3. Then, using the table for g,βπ,β we can evaluate
g(f(3))=g(3)=2π(π(3))=π(3)=2
Table 2Β shows the composite functionsΒ fβgπβπΒ andΒ gβfπβπΒ as tables.
| xπ₯ | g(x)π(π₯) | f(g(x))π(π(π₯)) | f(x)π(π₯) | g(f(x))π(π(π₯)) |
| 3 | 2 | 8 | 3 | 2 |
TRY IT #3
UsingΒ Table 1, evaluateΒ f(g(1))π(π(1))Β andΒ g(f(4)).π(π(4)).
Evaluating Composite Functions Using Graphs
When we are given individual functions as graphs, the procedure for evaluating composite functions is similar to the process we use for evaluating tables. We read the input and output values, but this time, from the x-π₯- and y-π¦- axes of the graphs.
HOW TO
Given a composite function and graphs of its individual functions, evaluate it using the information provided by the graphs.
- Locate the given input to the inner function on theΒ x-π₯-Β axis of its graph.
- Read off the output of the inner function from theΒ y-π¦-Β axis of its graph.
- Locate the inner function output on theΒ x-π₯-Β axis of the graph of the outer function.
- Read the output of the outer function from theΒ y-π¦-Β axis of its graph. This is the output of the composite function.
EXAMPLE 6
Using a Graph to Evaluate a Composite Function
UsingΒ Figure 1, evaluateΒ f(g(1)).π(π(1)).
Figure 1
Solution
To evaluateΒ f(g(1)),π(π(1)),Β we start with the inside evaluation. SeeΒ Figure 2.
Figure 2
We evaluate g(1)π(1) using the graph of g(x),π(π₯), finding the input of 1 on the x-π₯- axis and finding the output value of the graph at that input. Here, g(1)=3.π(1)=3. We use this value as the input to the function f.π.
f(g(1))=f(3)π(π(1))=π(3)
We can then evaluate the composite function by looking to the graph of f(x),π(π₯), finding the input of 3 on the x-π₯- axis and reading the output value of the graph at this input. Here, f(3)=6,π(3)=6, so f(g(1))=6.π(π(1))=6.
Analysis
Figure 3Β shows how we can mark the graphs with arrows to trace the path from the input value to the output value.
Figure 3
TRY IT #4
UsingΒ Figure 1, evaluateΒ g(f(2)).π(π(2)).
Evaluating Composite Functions Using Formulas
When evaluating a composite function where we have either created or been given formulas, the rule of working from the inside out remains the same. The input value to the outer function will be the output of the inner function, which may be a numerical value, a variable name, or a more complicated expression.
While we can compose the functions for each individual input value, it is sometimes helpful to find a single formula that will calculate the result of a composition f(g(x)).π(π(π₯)). To do this, we will extend our idea of function evaluation. Recall that, when we evaluate a function like f(t)=t2βt,π(π‘)=π‘2βπ‘, we substitute the value inside the parentheses into the formula wherever we see the input variable.
HOW TO
Given a formula for a composite function, evaluate the function.
- Evaluate the inside function using the input value or variable provided.
- Use the resulting output as the input to the outside function.
EXAMPLE 7
Evaluating a Composition of Functions Expressed as Formulas with a Numerical Input
Given f(t)=t2βtπ(π‘)=π‘2βπ‘ and h(x)=3x+2,β(π₯)=3π₯+2, evaluate f(h(1)).π(β(1)).
Solution
Because the inside expression is h(1),β(1), we start by evaluating h(x)β(π₯) at 1.
h(1)h(1)==3(1)+25β(1)=3(1)+2β(1)=5
Then f(h(1))=f(5),π(β(1))=π(5), so we evaluate f(t)π(π‘) at an input of 5.
f(h(1))f(h(1))f(h(1))===f(5)52β520π(β(1))=π(5)π(β(1))=52β5π(β(1))=20
Analysis
It makes no difference what the input variables tπ‘ and xπ₯ were called in this problem because we evaluated for specific numerical values.
TRY IT #5
Given f(t)=t2βtπ(π‘)=π‘2βπ‘ and h(x)=3x+2,β(π₯)=3π₯+2, evaluate
- βΒ h(f(2))β(π(2))
- βΒ h(f(β2))β(π(β2))
Finding the Domain of a Composite Function
As we discussed previously, the domain of a composite function such as fβgπβπ is dependent on the domain of gπ and the domain of f.π. It is important to know when we can apply a composite function and when we cannot, that is, to know the domain of a function such as fβg.πβπ. Let us assume we know the domains of the functions fπ and gπ separately. If we write the composite function for an input xπ₯ as f(g(x)),π(π(π₯)), we can see right away that xπ₯ must be a member of the domain of gπ in order for the expression to be meaningful, because otherwise we cannot complete the inner function evaluation. However, we also see that g(x)π(π₯) must be a member of the domain of f,π, otherwise the second function evaluation in f(g(x))π(π(π₯)) cannot be completed, and the expression is still undefined. Thus the domain of fβgπβπ consists of only those inputs in the domain of gπ that produce outputs from gπ belonging to the domain of f.π. Note that the domain of fπ composed with gπ is the set of all xπ₯ such that xπ₯ is in the domain of gπ and g(x)π(π₯) is in the domain of f.π.
DOMAIN OF A COMPOSITE FUNCTION
The domain of a composite function f(g(x))π(π(π₯)) is the set of those inputs xπ₯ in the domain of gπ for which g(x)π(π₯) is in the domain of f.π.
HOW TO
Given a function composition f(g(x)),π(π(π₯)), determine its domain.
- Find the domain ofΒ g.π.
- Find the domain ofΒ f.π.
- Find those inputsΒ xπ₯Β in the domain ofΒ gπΒ for whichΒ g(x)π(π₯)Β is in the domain ofΒ f.π.Β That is, exclude those inputsΒ xπ₯Β from the domain ofΒ gπΒ for whichΒ g(x)π(π₯)Β is not in the domain ofΒ f.π.Β The resulting set is the domain ofΒ fβg.πβπ.
EXAMPLE 8
Finding the Domain of a Composite Function
Find the domain of
(fβg)(x)wheref(x)=5xβ1andg(x)=43xβ2(πβπ)(π₯)whereπ(π₯)=5π₯β1andπ(π₯)=43π₯β2
Solution
The domain of g(x)π(π₯) consists of all real numbers except x=23,π₯=23, since that input value would cause us to divide by 0. Likewise, the domain of fπ consists of all real numbers except 1. So we need to exclude from the domain of g(x)π(π₯) that value of xπ₯ for which g(x)=1.π(π₯)=1.
43xβ246x====13xβ23×243π₯β2=14=3π₯β26=3π₯π₯=2
So the domain of fβgπβπ is the set of all real numbers except 2323 and 2.2. This means that
xβ 23orxβ 2π₯β 23orπ₯β 2
We can write this in interval notation as
(ββ,23)βͺ(23,2)βͺ(2,β)(ββ,23)βͺ(23,2)βͺ(2,β)
EXAMPLE 9
Finding the Domain of a Composite Function Involving Radicals
Find the domain of
(fβg)(x) wheref(x)=x+2βββββ and g(x)=3βxβββββ(πβπ)(π₯) whereπ(π₯)=π₯+2 and π(π₯)=3βπ₯
Solution
Because we cannot take the square root of a negative number, the domain of gπ is (ββ,3].(ββ,3]. Now we check the domain of the composite function
(fβg)(x)=3βxβββββ+2ββββββββββ(πβπ)(π₯)=3βπ₯+2
For (fβg)(x)=3βxβββββ+2ββββββββββ,3βxβββββ+2β₯0,(πβπ)(π₯)=3βπ₯+2,3βπ₯+2β₯0, since the radicand of a square root must be positive. Since square roots are positive, 3βxββββββ₯0,3βπ₯β₯0, or, 3βxβ₯0,3βπ₯β₯0, which gives a domain of (ββ,3](-β,3] .
Analysis
This example shows that knowledge of the range of functions (specifically the inner function) can also be helpful in finding the domain of a composite function. It also shows that the domain of fβgπβπ can contain values that are not in the domain of f,π, though they must be in the domain of g.π.
TRY IT #6
Find the domain of
(fβg)(x) wheref(x)=1xβ2 and g(x)=x+4βββββ(πβπ)(π₯) whereπ(π₯)=1π₯β2 and π(π₯)=π₯+4
Decomposing a Composite Function into its Component Functions
In some cases, it is necessary to decompose a complicated function. In other words, we can write it as a composition of two simpler functions. There may be more than one way to decompose a composite function, so we may choose the decomposition that appears to be most expedient.
EXAMPLE 10
Decomposing a Function
Write f(x)=5βx2ββββββπ(π₯)=5βπ₯2 as the composition of two functions.
Solution
We are looking for two functions, gπ and h,β, so f(x)=g(h(x)).π(π₯)=π(β(π₯)). To do this, we look for a function inside a function in the formula for f(x).π(π₯). As one possibility, we might notice that the expression 5βx25βπ₯2 is the inside of the square root. We could then decompose the function as
h(x)=5βx2and g(x)=xββββ(π₯)=5βπ₯2and π(π₯)=π₯
We can check our answer by recomposing the functions.
g(h(x))=g(5βx2)=5βx2ββββββπ(β(π₯))=π(5βπ₯2)=5βπ₯2
TRY IT #7
Write f(x)=43β4+x2βπ(π₯)=43β4+π₯2 as the composition of two functions.
RELATED POSTS
View all