We've updated our
Privacy Policy effective December 15. Please read our updated Privacy Policy and tap

TEXT

Study Guides > College Algebra

Compositions of Functions

Learning Objectives

  • Combine functions using algebraic operations.
  • Create a new function by composition of functions.

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 [latex]w\left(y\right)[/latex] is the wife’s income and [latex]h\left(y\right)[/latex] is the husband’s income in year [latex]y[/latex], and we want [latex]T[/latex] to represent the total income, then we can define a new function.

[latex]T\left(y\right)=h\left(y\right)+w\left(y\right)[/latex]

If this holds true for every year, then we can focus on the relation between the functions without reference to a year and write

[latex]T=h+w[/latex]

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 [latex]f\left(x\right)[/latex] and [latex]g\left(x\right)[/latex] with real number outputs, we define new functions [latex]f+g,f-g,fg[/latex], and [latex]\frac{f}{g}[/latex] by the relations

[latex]\begin{array}{c}\left(f+g\right)\left(x\right)=f\left(x\right)+g\left(x\right)\hfill \\ \left(f-g\right)\left(x\right)=f\left(x\right)-g\left(x\right)\hfill \\ \text{ }\left(fg\right)\left(x\right)=f\left(x\right)g\left(x\right)\hfill \\ \text{ }\left(\frac{f}{g}\right)\left(x\right)=\frac{f\left(x\right)}{g\left(x\right)}\hfill \end{array}[/latex]

Example: Performing Algebraic Operations on Functions

Find and simplify the functions [latex]\left(g-f\right)\left(x\right)[/latex] and [latex]\left(\frac{g}{f}\right)\left(x\right)[/latex], given [latex]f\left(x\right)=x - 1[/latex] and [latex]g\left(x\right)={x}^{2}-1[/latex]. Give the domain of your result. Are they the same function?

Answer:

Begin by writing the general form, and then substitute the given functions.

[latex]\begin{array}{c}\left(g-f\right)\left(x\right)=g\left(x\right)-f\left(x\right) \\ \left(g-f\right)\left(x\right)={x}^{2}-1-\left(x - 1\right)\\ \text{ }={x}^{2}-x \\ \text{ }=x\left(x - 1\right) \\\end{array}[/latex] [latex]\begin{array}{c}\text{ }\left(\frac{g}{f}\right)\left(x\right)=\frac{g\left(x\right)}{f\left(x\right)} \\ \text{ }\left(\frac{g}{f}\right)\left(x\right)=\frac{{x}^{2}-1}{x - 1}\\ \text{ }=\frac{\left(x+1\right)\left(x - 1\right)}{x - 1}\text{ where }x\ne 1 \\ \text{ }=x+1 \end{array}[/latex]
  The domain of the result is [latex]x\ne1[/latex]

No, the functions are not the same.

Note: For [latex]\left(\frac{g}{f}\right)\left(x\right)[/latex], the condition [latex]x\ne 1[/latex] is necessary because when [latex]x=1[/latex], the denominator is equal to 0, which makes the function undefined.

 

Try It now

Find and simplify the functions [latex]\left(fg\right)\left(x\right)[/latex] and [latex]\left(f-g\right)\left(x\right)[/latex].
[latex]f\left(x\right)=x - 1\text{ and }g\left(x\right)={x}^{2}-1[/latex]

Are they the same function?

Answer: [latex]\begin{array}{c}\left(fg\right)\left(x\right)=f\left(x\right)g\left(x\right)=\left(x - 1\right)\left({x}^{2}-1\right)={x}^{3}-{x}^{2}-x+1\\ \left(f-g\right)\left(x\right)=f\left(x\right)-g\left(x\right)=\left(x - 1\right)-\left({x}^{2}-1\right)=x-{x}^{2}\end{array}[/latex] No, the functions are not the same.

try it now

Now we will explore the graph of a composition of functions. Use Desmos to graph the following functions:
  1. [latex]f(x) = x^2+3x-4[/latex]
  2. [latex]g(x) = \frac{1}{x-1}[/latex]
Now define a new function:
  1. [latex]h(x) = f(f(x))[/latex]
Now zoom in (use the plus sign in the upper right-hand corner of the graph) on the point [latex](0.23607,-3.236)[/latex], notice that both graphs pass through this point. Continue this pattern for a few more iterations: define a new function that contains another composition of [latex]f(x)[/latex] with itself. For example: [latex]p(x) = f(f(f(x)))[/latex], and so on. Continue to use the zoom as you iterate. The point [latex](0.23607,-3.236)[/latex] is called a fixed point of the function [latex]f(x)=x^2+3x-4[/latex]. Fixed points are used in mathematical applications such as the page rank algorithm that Google uses to generate internet search results. Read more about fixed points here, and page rank here.
 

Example: Interpreting Composite Functions

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].

Answer: 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. 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).

 

Example: Investigating the Order of Function Composition

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]

Answer: 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-display]\text{number of miles }=f\left(\text{number of hours}\right)[/latex-display] 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-display]\text{number of gallons }=g\left(\text{number of miles}\right)[/latex-display] 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. 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.

Try it now

Licenses & Attributions

CC licensed content, Original

  • Revision and Adaptation. Provided by: Lumen Learning License: CC BY: Attribution.
  • Question ID 111999. Authored by: Lumen Learning. License: CC BY: Attribution. License terms: IMathAS Community License CC-BY + GPL.

CC licensed content, Shared previously

  • College Algebra. Provided by: OpenStax Authored by: Abramson, Jay et al.. Located at: https://openstax.org/books/college-algebra/pages/1-introduction-to-prerequisites. License: CC BY: Attribution. License terms: Download for free at http://cnx.org/contents/[email protected].
  • Question ID 32907. Authored by: Smart, Jim. License: CC BY: Attribution. License terms: IMathAS Community License CC-BY + GPL.
  • Question ID 5727. Authored by: Pepe,Mike. License: CC BY: Attribution. License terms: IMathAS Community License CC-BY + GPL.
  • Question ID 3674. Authored by: Rasmussen,Melonie, mb Lippman,David. License: CC BY: Attribution. License terms: IMathAS Community License CC-BY + GPL.