Combinations and Compositions of Functions: Learn It 2
Create a Function by Composition of 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.
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.
composite function
The composition of functions is a way of combining two functions to form a new function.
If we have two functions [latex]f[/latex] and [latex]g[/latex], the composition of [latex]f[/latex] and [latex]g[/latex], written as [latex]f\circ g[/latex], is defined by:
[latex](f \circ g)(x) = f(g(x))[/latex]
We read the left-hand side as “[latex]f[/latex] composed with [latex]g[/latex] at [latex]x[/latex], ” and the right-hand side as “[latex]f[/latex] of [latex]g[/latex] of [latex]x[/latex].”
The domain of [latex]f\circ g[/latex] is the set of all [latex]x[/latex] in the domain of [latex]g[/latex] such that [latex]g(x)[/latex] is in the domain of [latex]f[/latex]. In other words, [latex]x[/latex] must satisfy both the domain requirements of [latex]g[/latex] and the domain requirements of [latex]f(g(x))[/latex]
The open circle symbol [latex]\circ[/latex] 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.The function [latex]c\left(s\right)[/latex] gives the number of calories burned completing [latex]s[/latex] sit-ups, and [latex]s\left(t\right)[/latex] gives the number of sit-ups a person can complete in [latex]t[/latex] minutes. Interpret [latex]c\left(s\left(3\right)\right)[/latex].
The inside expression in the composition is [latex]s\left(3\right)[/latex]. Because the input to the s-function is time, [latex]t=3[/latex] represents 3 minutes, and [latex]s\left(3\right)[/latex] is the number of sit-ups completed in 3 minutes.
[latex]\\[/latex]
Using [latex]s\left(3\right)[/latex] as the input to the function [latex]c\left(s\right)[/latex] 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).
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. Additionally, in applied settings, function composition usually only makes sense in one specific order.
Suppose [latex]f\left(x\right)[/latex] gives miles that can be driven in [latex]x[/latex] hours and [latex]g\left(y\right)[/latex] gives the gallons of gas used in driving [latex]y[/latex] miles. Which of these expressions is meaningful: [latex]f\left(g\left(y\right)\right)[/latex] or [latex]g\left(f\left(x\right)\right)?[/latex]
The function [latex]y=f\left(x\right)[/latex]is a function whose output is the number of miles driven corresponding to the number of hours driven.
[latex]\text{number of miles }=f\left(\text{number of hours}\right)[/latex]
The function [latex]g\left(y\right)[/latex] is a function whose output is the number of gallons used corresponding to the number of miles driven. This means:
[latex]\text{number of gallons }=g\left(\text{number of miles}\right)[/latex]
The expression [latex]g\left(y\right)[/latex] takes miles as the input and a number of gallons as the output. The function [latex]f\left(x\right)[/latex] requires a number of hours as the input. Trying to input a number of gallons does not make sense. The expression [latex]f\left(g\left(y\right)\right)[/latex] is meaningless.
[latex]\\[/latex]
The expression [latex]f\left(x\right)[/latex] takes hours as input and a number of miles driven as the output. The function [latex]g\left(y\right)[/latex] requires a number of miles as the input. Using [latex]f\left(x\right)[/latex] (miles driven) as an input value for [latex]g\left(y\right)[/latex], where gallons of gas depends on miles driven, does make sense. The expression [latex]g\left(f\left(x\right)\right)[/latex] makes sense, and will yield the number of gallons of gas used, [latex]g[/latex], driving a certain number of miles, [latex]f\left(x\right)[/latex], in [latex]x[/latex] hours.
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 general [latex]f\circ g[/latex] and [latex]g\circ f[/latex] are different functions. In other words in many cases [latex]f\left(g\left(x\right)\right)\ne g\left(f\left(x\right)\right)[/latex] for all [latex]x[/latex].Given [latex]f(x) = x^2[/latex] and [latex]g(x) = x + 2[/latex], find [latex]f\circ g[/latex] and [latex]g\circ f[/latex]. Also, find its domain.
In our example, we clearly see that [latex](f \circ g)(x) = x^2 + 4x + 4[/latex] is different from [latex](g \circ f)(x) = x^2 + 2[/latex]. This difference occurs because we are performing the operations in a different sequence. Therefore, when composing functions, always pay close attention to the order to ensure you get the correct result.Remember: [latex](f \circ g)(x) \neq (g \circ f)(x)[/latex] in general!
Domain of [latex](f \circ g)(x)[/latex]:
The domain of [latex]g(x) = x+2[/latex] is all real numbers, [latex](-\infty, \infty)[/latex].
[latex]f(x) = x^2[/latex] is also defined for all real numbers, [latex](-\infty, \infty)[/latex].
Therefore, the domain of [latex](f \circ g)(x) = x^2 + 4x + 4[/latex] is all real numbers, [latex](-\infty, \infty)[/latex].
Following the same reasoning, the domain of [latex](g \circ f)(x) = x^2 + 2[/latex] is also all real numbers, [latex](-\infty, \infty)[/latex].
It’s important to remember that function composition is not the same as multiplication of functions. When we compose two functions, we are plugging one function into another, not multiplying their outputs.
[latex](f \circ g)(x) \ne (f \cdot g)(x)[/latex]
Given [latex]f(x) = x-3[/latex] and [latex]g(x) = \sqrt{x}[/latex], find [latex](f \circ g)(x)[/latex] and its domain.
Determine the Domain of [latex]g(x) = \sqrt{x}[/latex]: The function is defined for [latex]x \geq 0[/latex]. So, the domain is [latex][0, \infty)[/latex].
Determine the Domain of [latex]f(g(x)) = \sqrt{x} - 3[/latex]: Since [latex]\sqrt{x}[/latex] must be a non-negative number, the composition [latex]\sqrt{x} - 3[/latex] is defined for [latex]x \geq 0[/latex].
Note: There are no additional restrictions from the function [latex]f(x) = x-3[/latex].
Therefore, the domain of [latex](f \circ g)(x) = \sqrt{x} - 3[/latex] is [latex][0, \infty)[/latex].