Function composition (modeling and non-commutativity)
Function Composition
Function Composition is the opening topic of Functions in the Texas Essential Knowledge and Skills (Precalculus, §111.42). It is aligned to Standard P.2(A), P.2(B), which requires students to use function composition to model real-world problems and to demonstrate that composition is not always commutative.
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.
Theory
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).
The two composites and the domain rule:
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\):
How to find a composite function
- Identify the inner and outer functions; for \(f\circ g\), \(g\) is inner.
- Substitute the entire inner function into every \(x\) of the outer function.
- Simplify, and state the domain — keep any restriction the inner function needs, then require its output to be valid in the outer function.
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.
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\) |
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.
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)\).
Common pitfalls
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\).