Resources For Teachers For Tutors For Students & Parents Pricing
Algebra 2 Relations and functions (advanced)

Function composition

20 practice questions 0 video lessons Theory + worked examples

Function Composition

Texas Algebra II (TEKS) • Standard 2A.2(D) • Relations & Functions

Function Composition is a topic in Relations & Functions in the Texas Essential Knowledge and Skills (Algebra II, §111.40). It is aligned to Standard 2A.2(D), which requires students to use the composition of two functions to model and solve problems.

Function composition \((f\circ g)(x)=f(g(x))\) applies the inner function \(g\) first and then the outer function \(f\); order matters.

Texas Algebra II (TEKS) › Relations & Functions › Function Composition  —  Standard 2A.2(D)

Create a free accountTrack your progress and save your work as you go.
Create free account

Theory

Composition combines two functions by using the output of one as the input of the other:
\[(f\circ g)(x)=f\big(g(x)\big).\]

The inner function \(g\) runs first; its result is fed into the outer function \(f\).

Order matters: in general \((f\circ g)(x)\neq(g\circ f)(x)\).
Composition Composition Composition (f ∘ g)(x) = f( g(x) ) inner function g runs first outer function f runs on the result
Composition applies the inner function, then the outer.
Composition as two machines Composition feeds x through g, then feeds that output through f. g f x g(x) f(g(x))
\(x\to g\to f\) gives \(f(g(x))\).

The composition rule:

\[(f\circ g)(x)=f\big(g(x)\big)\]
f composed with g of x is f of g of x
Work inside out: evaluate the inner function first.

How to compose functions

  1. Identify the inner function \(g\) and outer function \(f\).
  2. Substitute \(g(x)\) wherever \(x\) appears in \(f\).
  3. Simplify.
  4. For a value, evaluate the inner function first, then the outer.
Example 1 β€” Evaluate a composition
For \(f(x)=x^2\) and \(g(x)=x+3\), find \((f\circ g)(2)\).
Solution

Work inside out: find \(g(2)\), then apply \(f\).

\(g(2)\)\(=\)\(2+3=5\)
\(f(5)\)\(=\)\(5^2=25\)
f composed with g at 2 is 25
Example 2 β€” Compose symbolically
With the same \(f\) and \(g\), find \((f\circ g)(x)\).
Solution

Substitute \(g(x)\) into \(f\).

\((f\circ g)(x)\)\(=\)\(f(x+3)\)
\(=\)\((x+3)^2\)
f composed with g of x is x plus 3 squared
Example 3 β€” Order matters
Find \((g\circ f)(x)\) for the same functions and compare.
Solution

Now \(f\) runs first.

\((g\circ f)(x)\)\(=\)\(g(x^2)\)
\(=\)\(x^2+3\)

\((x+3)^2\neq x^2+3\), so composition is not commutative.

g composed with f is x squared plus 3, different from the other order
Example 4 β€” Decompose a function
Write \(h(x)=\sqrt{x^2+1}\) as a composition \(f(g(x))\).
Solution

Let the inside be \(g\) and the outside be \(f\).

\(g(x)\)\(=\)\(x^2+1\)
\(f(x)\)\(=\)\(\sqrt{x}\)
\(f(g(x))\)\(=\)\(\sqrt{x^2+1}\)
g is x squared plus 1 and f is the square root

Common pitfalls

Order matters: \((f\circ g)\) usually differs from \((g\circ f)\).
Substitute the whole inner function, then simplify β€” don't drop parentheses.
Mind the domain: \(g(x)\) must be a valid input for \(f\).

Frequently asked questions

What is function composition?

Using one function's output as another's input: \((f\circ g)(x)=f(g(x))\).

Which function runs first in \(f(g(x))\)?

The inner function \(g\) runs first, then \(f\).

Is composition commutative?

No. \((f\circ g)(x)\) generally does not equal \((g\circ f)(x)\).

How do you decompose a function?

Choose an inner function for the “inside” expression and an outer function for what is done to it.