Composition of Functions
Composition of functions is the process of applying one function to the output of another, creating a new function called a composite function. If you think of a function as a machine that takes an input and produces an output, then composing two functions means feeding the output of the first machine directly into the second. This chaining of operations appears throughout mathematics, science, and computer science whenever transformations are applied in sequence. The composition of function g followed by function f is written as (f ∘ g)(x), read 'f composed with g of x' or 'f of g of x'. The key idea is that g acts first on the input x, and then f acts on whatever g produces. Order matters enormously: f ∘ g and g ∘ f are generally different functions, so composition is not commutative. Understanding this directional nature is essential for working correctly with composite functions. Composition arises naturally in everyday contexts. Converting a temperature from Celsius to Kelvin involves adding 273.15, while converting Fahrenheit to Celsius involves subtracting 32 and dividing by 1.8. Composing these two unit-conversion functions gives a single function from Fahrenheit to Kelvin. In calculus, the chain rule for differentiation is built entirely on the structure of composite functions, making this concept a critical foundation for advanced mathematics.
- Identify the inner and outer functions
- Substitute the inner function into the outer function
- Simplify the resulting expression
- Determine the domain of the composite function
- Evaluate the composite at a specific value
Identify the inner and outer functions
In the notation (f ∘ g)(x), the inner function is g and the outer function is f. The inner function receives the original input x first. Always determine which function acts first before attempting any substitution. For example, if f(x) = x² + 1 and g(x) = 3x − 2, then in (f ∘ g)(x) the inner function is g(x) = 3x − 2 and the outer function is f.
Substitute the inner function into the outer function
Replace every occurrence of x in the outer function f(x) with the entire expression for g(x). Using the example above: (f ∘ g)(x) = f(g(x)) = f(3x − 2) = (3x − 2)² + 1. Every x in f's formula becomes the expression '3x − 2'. Use parentheses carefully to avoid sign errors, especially when the outer function involves subtraction or multiplication.
Simplify the resulting expression
Expand and combine like terms to write the composite function in its simplest form. Continuing the example: (3x − 2)² + 1 = 9x² − 12x + 4 + 1 = 9x² − 12x + 5. The composite function (f ∘ g)(x) = 9x² − 12x + 5 is now a single polynomial formula that encodes both operations at once.
Determine the domain of the composite function
The domain of (f ∘ g)(x) consists of all x values in the domain of g for which g(x) also lies in the domain of f. Formally: domain of f ∘ g = {x ∈ dom(g) : g(x) ∈ dom(f)}. For instance, if g(x) = √x (domain: x ≥ 0) and f(x) = 1/(x − 2) (domain: x ≠ 2), then (f ∘ g)(x) = 1/(√x − 2) requires x ≥ 0 AND √x ≠ 2, meaning x ≥ 0 and x ≠ 4.
Evaluate the composite at a specific value
To find (f ∘ g)(a) for a specific number a, you may either substitute a into the fully simplified formula, or evaluate step-by-step: compute g(a) first, then apply f to that result. For example, (f ∘ g)(2) = 9(4) − 12(2) + 5 = 36 − 24 + 5 = 17. Alternatively, g(2) = 3(2) − 2 = 4, then f(4) = 4² + 1 = 17. Both methods give the same answer.
The Key Equation
- f \circ g — Composite function (none): The new function formed by applying g first, then f. The circle symbol ∘ denotes function composition.
- x — Input variable (none): The original input value supplied to the inner function g.
- g(x) — Output of the inner function (none): The value produced by the inner function g; this becomes the input to the outer function f.
- f\bigl(g(x)\bigr) — Output of the composite (none): The final output obtained by applying f to the intermediate result g(x).
Worked Example
Problem. Let f(x) = 2x + 5 and g(x) = x² − 3. Find (a) (f ∘ g)(x) and (b) (g ∘ f)(x), then evaluate each at x = 1 and confirm they are different.
Answer. (f ∘ g)(x) = 2x² − 1 and (g ∘ f)(x) = 4x² + 20x + 22; they are distinct functions.
Origins · 1 minLeonhard Euler and how this was discovered
Leonhard Euler was the first mathematician to treat functions as central objects of study in analysis, introducing the modern notation f(x) in 1734. His systematic treatment of functions as mappings—distinct from the specific formulas defining them—laid the conceptual groundwork for operations on functions, including composition. Euler's prolific output in analysis, algebra, and number theory made him the most published mathematician in history. Euler continued to produce groundbreaking mathematics even after losing sight in both eyes, dictating his results from memory. He is said to have produced nearly half of his total published work after becoming completely blind.
Related Concepts
- Domain and Range of a Function — The domain of a composite function depends directly on the domains of both component functions, making domain analysis an essential prerequisite for composition.
- Inverse Functions — A function and its inverse are defined by the property that their compositions yield the identity: (f ∘ f⁻¹)(x) = x and (f⁻¹ ∘ f)(x) = x, so composition is the core tool for verifying and constructing inverses.
- Chain Rule for Differentiation — The chain rule in calculus computes the derivative of a composite function, making a thorough understanding of function composition essential for differential calculus.
- Definition of a Function — Understanding what a function is—a well-defined mapping from inputs to outputs—is necessary before combining functions through composition.