Resources For Teachers For Tutors For Students & Parents Pricing
Pre-Calculus Functions (advanced)

Function composition (modeling and non-commutativity)

20 practice questions 0 video lessons Theory + worked examples

Function Composition

California Pre-Calculus • Standard F-BF.1c • Functions

Function Composition is the opening topic of Functions in the California Common Core State Standards. It is aligned to Standard F-BF.1c, which requires students to compose functions and interpret the composition in a modeling context.

Function composition builds a new function by applying one function to the output of another, written \((f\circ g)(x)=f(g(x))\) — you work from the inside out.

California Pre-Calculus › Functions › Function Composition  —  Standard F-BF.1c

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

Theory

Function composition applies one function to the output of another. The composite \(f\circ g\) is defined by
\[(f\circ g)(x)=f\big(g(x)\big),\]

read “\(f\) of \(g\) of \(x\).” You work from the inside out: apply the inner function \(g\) first, then feed its result into the outer function \(f\).

Composition is a way to build a new function from two simpler ones — useful for modeling a process that happens in stages (a discount then a tax, a radius that grows with time feeding an area formula).

Key idea: composition is not commutative. In general \(f\circ g\neq g\circ f\), so the order matters. Always check which function acts first.
Function composition machine: x into g into f x enters the inner function g to produce g of x, which then enters the outer function f to produce f of g of x. xgg(x)ff(g(x))(f ∘ g)(x) = f(g(x)) — apply g first, then f
\((f\circ g)(x)=f(g(x))\): \(g\) runs first, then \(f\).
Function composition is not commutative With f of x equals 2x plus 1 and g of x equals x squared, the input 3 gives f of g of 3 equals 19 but g of f of 3 equals 49, so the two orders differ. f∘g:3g9f19g∘f:3f7g4919 ≠ 49
Order matters: with \(f(x)=2x+1,\ g(x)=x^2\), \((f\circ g)(3)=19\) but \((g\circ f)(3)=49\).

The two composites and the domain rule:

\[(f\circ g)(x)=f(g(x)),\qquad (g\circ f)(x)=g(f(x))\]
f composed with g is f of g of x; g composed with f is g of f of x

The domain of \(f\circ g\) is the set of \(x\) for which \(g(x)\) is defined and \(g(x)\) lies in the domain of \(f\):

\[x\in\text{dom}(g)\ \text{ and }\ g(x)\in\text{dom}(f)\]
Composition is not multiplication. \((f\circ g)(x)=f(g(x))\), which is different from the product \(f(x)\cdot g(x)\).

How to find a composite function

  1. Identify the inner and outer functions; for \(f\circ g\), \(g\) is inner.
  2. Substitute the entire inner function into every \(x\) of the outer function.
  3. Simplify, and state the domain — keep any restriction the inner function needs, then require its output to be valid in the outer function.
To evaluate at a number, work inside out: compute the inner value first, then apply the outer function to it.
Example 1 — Form both composites
For \(f(x)=2x+1\) and \(g(x)=x^2\), find \((f\circ g)(x)\) and \((g\circ f)(x)\).
Solution

For \(f\circ g\), substitute \(g(x)=x^2\) into \(f\):

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

For \(g\circ f\), substitute \(f(x)=2x+1\) into \(g\), then expand the square:

\((g\circ f)(x)\)\(=\)\(g(2x+1)\)
\(=\)\((2x+1)^2\)
\(=\)\(4x^2+4x+1\)

They are different — composition is not commutative.

f of g is 2x squared plus 1; g of f is 4x squared plus 4x plus 1
Example 2 — Evaluate a composite
Using \(f(x)=2x+1\) and \(g(x)=x^2\), find \((f\circ g)(3)\).
Solution

Work from the inside out: find \(g(3)\) first, then apply \(f\).

\(g(3)\)\(=\)\(3^2=9\)
\((f\circ g)(3)=f(9)\)\(=\)\(2\cdot 9+1=19\)
composite equals 19
Example 3 — A real-world model
A store takes \(20\%\) off, then adds \(8\%\) sales tax. With price \(p\), the discount is \(D(p)=0.8p\) and the tax is \(T(x)=1.08x\). Find the composite that gives the final price.
Solution

Apply the discount first, then the tax: \(T(D(p))\).

\(T(D(p))\)\(=\)\(T(0.8p)\)
\(=\)\(1.08(0.8p)\)
\(=\)\(0.864p\)

The final price is \(0.864p\) — about \(86.4\%\) of the original.

final price is 0.864 times p
Example 4 — Domain of a composite
For \(f(x)=\sqrt{x}\) and \(g(x)=x-4\), find \((f\circ g)(x)\) and its domain.
Solution

Substitute \(g(x)=x-4\) into \(f\), then require the radicand to be \(\ge 0\).

\((f\circ g)(x)\)\(=\)\(f(x-4)\)
\(=\)\(\sqrt{x-4}\)
\(x-4\)\(\ge\)\(0\)
\(x\)\(\ge\)\(4\)

Domain: \(x\ge 4\), or \([4,\infty)\).

domain is x greater than or equal to 4

Common pitfalls

Order matters (right to left). \(f\circ g\) means apply \(g\) first, then \(f\) — not the other way around.
Composition is not multiplication. \((f\circ g)(x)=f(g(x))\), not \(f(x)\cdot g(x)\).
Watch the domain. A composite can lose values the outer function cannot accept, even when each piece looks fine on its own.

Frequently asked questions

What is function composition?

Applying one function to the output of another: \((f\circ g)(x)=f(g(x))\). You run the inner function \(g\) first, then feed its result into the outer function \(f\).

How do you find (f of g)(x)?

Substitute the whole inner function \(g(x)\) into every \(x\) of the outer function \(f\), then simplify.

Is function composition commutative?

No. In general \(f\circ g\neq g\circ f\); the order in which you apply the functions changes the result.

In f of g, which function do you apply first?

The inner one, \(g\). Composition works right to left: \(g\) acts on \(x\) first, then \(f\) acts on the result.

How do you find the domain of a composite function?

Keep every restriction the inner function needs, then also require its output to lie in the domain of the outer function. For \(\sqrt{x-4}\), that gives \(x\ge 4\).