COLLEGE ALGEBRA • FUNCTIONS & GRAPHS

Composition of Functions, Domain of Composition — Composition of Functions and Domain of a Composition

Learn how to combine functions sequentially and precisely determine the domain of the resulting composition.

Historical Context & Motivation

The idea of applying one function to the output of another — what we now call function composition — is so fundamental to modern mathematics that it can be difficult to imagine a time when the concept lacked a formal definition. Yet for most of mathematical history, functions were described informally as 'rules' or 'correspondences,' and the systematic study of how they could be combined awaited the rigor of nineteenth-century analysis. Understanding the evolution of this concept illuminates why composition is not merely algebraic bookkeeping but rather a powerful structural principle that underpins fields from abstract algebra to computer science.

1694
Leibniz Introduces 'Function'
Gottfried Wilhelm Leibniz first uses the Latin word functio to describe quantities that depend on a variable. His notation and philosophical framework laid the groundwork for treating functions as mathematical objects in their own right.
1837
Dirichlet's Modern Definition
Peter Gustav Lejeune Dirichlet proposes the definition of a function as an arbitrary correspondence between two sets, freeing the concept from formulas and allowing compositions to be studied abstractly.
1870s
Set-Theoretic Foundations
Georg Cantor and Richard Dedekind develop set theory, providing the language of domains and ranges that makes the domain of a composition precise and computable.
1945
Category Theory and Composition
Samuel Eilenberg and Saunders Mac Lane formalize composition as a central operation in category theory, revealing that the associativity and domain-compatibility conditions of composition govern vast areas of mathematics.

The central question that composition addresses is deceptively simple: given two processes, each described by a function, how do we build a single function that performs both processes in sequence, and on what inputs is the combined process valid? Answering the second part — determining the domain of the composition — requires careful attention, because even when two functions individually have large domains, their composition may be far more restricted.

Core Principles & Definitions

Before diving into calculations, it is essential to internalize the foundational ideas that govern function composition. These principles clarify not only how to compute a composition but also why certain compositions fail and how to determine their domains systematically. The following grid summarizes the four pillars on which the entire topic rests.

1

Definition of Composition

Given two functions f and g, the composition (f ∘ g)(x) = f(g(x)). The function g is evaluated first, and its output becomes the input of f.
2

Order Matters

Composition is generally not commutative: f ∘ g ≠ g ∘ f in most cases. The inner function always acts first, so swapping the order changes the result and potentially the domain.
3

Domain Compatibility

For (f ∘ g)(x) to be defined, x must lie in the domain of g, and the output g(x) must lie in the domain of f. Both conditions must hold simultaneously.
4

Associativity

Composition is associative: (f ∘ g) ∘ h = f ∘ (g ∘ h). This means that when composing three or more functions, grouping does not affect the result, though the order of application still matters.
KEY TAKEAWAY
Think of function composition like a manufacturing assembly line. The output of the first machine (the inner function g) is fed directly into the second machine (the outer function f). The domain of the composition is the set of raw materials that the first machine can accept and whose processed output is compatible with the second machine. If machine g outputs a product that machine f cannot handle, that raw material is excluded from the domain of the entire line.

Visual Explanation — The Composition Pipeline

A diagram is often the fastest route to understanding composition. The following figure shows how an input x flows through the inner function g, produces an intermediate value g(x), and then that intermediate value is processed by the outer function f to yield the final output f(g(x)). The shaded region at the left represents the domain of the composition — the subset of the domain of g whose outputs land inside the domain of f.

The purple ellipse represents the domain of g. The dashed pink rectangle inside the cyan ellipse highlights the domain of f. An input x₀ whose image g(x₀) falls outside the domain of f (shown in red) must be excluded from the domain of the composition.

This diagram captures the two-condition rule visually: an input x belongs to the domain of f ∘ g if and only if (1) x is in the domain of g, and (2) g(x) is in the domain of f. Failing either condition means x must be excluded.

Mathematical Framework

With the intuitive picture established, we now formalize the definition and the domain rule using set-builder notation. These statements make the criteria for domain membership both precise and operational — they translate directly into the algebraic steps you will use in every problem.

DEFINITION OF COMPOSITION
(f ∘ g)(x) = f(g(x))
Read 'f composed with g of x.' The function g is the inner function (applied first), and f is the outer function (applied second).
DOMAIN OF COMPOSITION
Dom(f ∘ g) = { x ∈ Dom(g) : g(x) ∈ Dom(f) }
The domain of f ∘ g consists of all x in the domain of g such that the output g(x) also lies in the domain of f. In practice, start with Dom(g) and remove any x-values for which g(x) falls outside Dom(f).

The domain formula can be applied algorithmically in three steps. First, determine Dom(g) by finding all x-values for which g(x) is defined. Second, form the expression f(g(x)) algebraically by substituting g(x) into f. Third, identify which additional x-values must be excluded so that f(g(x)) remains defined — these are the values where g(x) would violate the domain restrictions of f. The intersection of 'x in Dom(g)' and 'g(x) in Dom(f)' is the final answer.

PRACTICAL THREE-STEP ALGORITHM
Step 1: Find Dom(g). Step 2: Compute f(g(x)). Step 3: Exclude x where g(x) ∉ Dom(f).
Common domain restrictions to watch for include division by zero, even roots of negative numbers, and logarithms of non-positive arguments.
⚠️ Common Pitfall
Students frequently find the simplified algebraic form of f(g(x)) and then find the domain of that simplified expression alone. This approach can give an incorrect domain because algebraic simplification may mask restrictions inherited from the inner function g. Always apply the three-step algorithm rather than reading the domain off the simplified formula.

Domain Analysis — Common Function Types

Different families of functions impose different domain restrictions. When two functions are composed, the restrictions of both the inner and the outer function interact in ways that depend heavily on the types involved. The following table catalogs the most frequently encountered cases in college algebra and summarizes the domain conditions that each composition inherits.

Domain conditions for common composition scenarios
Outer f(u)Inner g(x)Domain Conditions for f ∘ g
1/uAny g(x)x ∈ Dom(g) and g(x) ≠ 0
√uAny g(x)x ∈ Dom(g) and g(x) ≥ 0
ln(u)Any g(x)x ∈ Dom(g) and g(x) > 0
1/(x − 3)x ∈ ℝ, x ≠ 3 (only inner restriction)
√u1/(x − 2)x ∈ Dom(g) and 1/(x − 2) ≥ 0, so x > 2
Number-line analysis for f(u) = √u composed with g(x) = 2x − 6. The green region in Step 1 shows Dom(g) = (−∞, ∞). The red/green split in Step 2 shows where g(x) ≥ 0. The final purple interval is the domain of f ∘ g: [3, ∞).

The number-line technique illustrated above scales to more complex situations: compositions involving rational expressions introduce vertical asymptotes that must be excluded, logarithmic compositions require strictly positive arguments, and compositions of piecewise functions require case-by-case analysis across subdomains. In every scenario, the disciplined approach of intersecting the domain of the inner function with the preimage of the domain of the outer function yields the correct answer.

Worked Example

Let us work through a detailed example that involves both a rational function and a square root, combining multiple domain restrictions into a single answer.

Find (f ∘ g)(x) and its domain where f(x) = √(x − 1) and g(x) = 5/(x + 2)
1
Step 1 — Determine Dom(g)The function g(x) = 5/(x + 2) is undefined when the denominator equals zero: x + 2 = 0, so x = −2. Therefore Dom(g) = {x ∈ ℝ : x ≠ −2}, which is (−∞, −2) ∪ (−2, ∞).
Dom(g) = (−∞, −2) ∪ (−2, ∞)
2
Step 2 — Compute f(g(x)) algebraicallySubstitute g(x) into f: f(g(x)) = f(5/(x + 2)) = √(5/(x + 2) − 1). Simplify the radicand by combining over a common denominator: 5/(x + 2) − 1 = (5 − (x + 2))/(x + 2) = (3 − x)/(x + 2). So (f ∘ g)(x) = √((3 − x)/(x + 2)).
(f ∘ g)(x) = √((3 − x)/(x + 2))
3
Step 3 — Apply the domain condition g(x) ∈ Dom(f)The outer function f(u) = √(u − 1) requires u − 1 ≥ 0, i.e., the input u to f must satisfy u ≥ 1. Since u = g(x) = 5/(x + 2), this condition becomes 5/(x + 2) ≥ 1, or equivalently 5/(x + 2) − 1 ≥ 0. Combining these terms over a common denominator gives (3 − x)/(x + 2) ≥ 0, which matches the simplified radicand from Step 2. We now analyze the sign of this rational expression using a sign chart.
4
Step 4 — Sign chart analysisThe critical values are x = 3 (numerator = 0) and x = −2 (denominator = 0). On (−∞, −2): both (3 − x) > 0 and (x + 2) < 0, so the fraction is negative. On (−2, 3]: (3 − x) ≥ 0 and (x + 2) > 0, so the fraction is non-negative. On (3, ∞): (3 − x) < 0 and (x + 2) > 0, so the fraction is negative. Therefore (3 − x)/(x + 2) ≥ 0 on the interval (−2, 3].
(3 − x)/(x + 2) ≥ 0 when x ∈ (−2, 3]
5
Step 5 — Intersect with Dom(g)Dom(g) already excludes x = −2, and the sign analysis also excludes x = −2 (open parenthesis). The intersection of (−∞, −2) ∪ (−2, ∞) with (−2, 3] is simply (−2, 3]. The final domain is (−2, 3].
Dom(f ∘ g) = (−2, 3]
💡 Why not just read the domain from √((3 − x)/(x + 2))?
In this particular example, analyzing the simplified expression directly happens to give the same domain. However, this coincidence does not always hold. Whenever algebraic simplification cancels a factor, the cancellation can 'hide' a restriction inherited from the inner function. The three-step algorithm guards against this error by explicitly tracking Dom(g) throughout.

Composition vs. Other Function Operations

Students often conflate composition with arithmetic operations on functions. While addition, subtraction, multiplication, and division of functions combine outputs, composition chains processes — a fundamentally different operation. The table below highlights the key distinctions and clarifies when each operation is appropriate.

Arithmetic vs. Composition of Functions
FeatureArithmetic CombinationComposition f ∘ g
Notation(f + g)(x), (f − g)(x), (fg)(x), (f/g)(x)(f ∘ g)(x) = f(g(x))
EvaluationBoth f and g are evaluated at the same x, then combined.g is evaluated at x first; that output is fed into f.
DomainDom(f) ∩ Dom(g) (with g(x) ≠ 0 for division){x ∈ Dom(g) : g(x) ∈ Dom(f)}
Commutativityf + g = g + f and fg = gf; subtraction/division are not.Generally f ∘ g ≠ g ∘ f.
Typical useCombining additive effects, scaling, ratios.Sequential transformations, substitution, inverse verification.
KEY TAKEAWAY
Arithmetic operations on functions are like mixing two audio tracks at the same time — each signal is sampled at the same instant and blended. Composition, by contrast, is like routing the output of one audio processor into the input of another: the order of the chain matters, and the second processor can only accept signals within its operating range. Recognizing this distinction prevents domain errors and conceptual confusion.

Connections to Advanced Theory

Function composition is not merely a computational technique for algebra courses — it is a gateway concept that reappears throughout higher mathematics, often in more abstract guises. Two particularly important extensions deserve mention: inverse functions and the chain rule from calculus. Understanding composition deeply now will pay dividends in both areas.

How composition connects to advanced mathematics
ConceptRole of CompositionDomain Considerations
Inverse Functionsf⁻¹ ∘ f = id and f ∘ f⁻¹ = id. Composition verifies that two functions 'undo' each other.The domain of f must equal the range of f⁻¹, and vice versa, for both compositions to yield the identity.
Chain Rule (Calculus)d/dx [f(g(x))] = f′(g(x)) · g′(x). Differentiation of a composition requires recognizing outer and inner functions.The derivative exists only where f ∘ g is defined and both f and g are differentiable — domain analysis remains essential.
Iterated Functions / Dynamical SystemsStudying f ∘ f ∘ f ∘ … (repeated self-composition) generates orbits used in fractal geometry and chaos theory.The domain may shrink with each iteration; fixed points and periodic orbits depend critically on domain structure.

As you progress through calculus and linear algebra, you will find that composition provides the conceptual backbone for transformations, operator theory, and even the structure of computer programs. The habits formed here — carefully identifying inner and outer functions, meticulously tracking domains, and respecting the non-commutativity of the operation — transfer directly to these higher-level contexts.

Practice Problems

PROBLEM 1CONCEPTUAL
Explain in your own words why, in general, f ∘ g ≠ g ∘ f. Provide a simple example with f(x) = x² and g(x) = x + 1 to illustrate.
PROBLEM 2BASIC CALCULATION
Let f(x) = 3x − 4 and g(x) = x² + 1. Find (f ∘ g)(x) and (g ∘ f)(x).
PROBLEM 3INTERMEDIATE
Let f(x) = 1/(x − 4) and g(x) = √x. Find (f ∘ g)(x) and determine its domain.
PROBLEM 4APPLIED
A manufacturer models the cost of producing x units as C(x) = 50x + 2000, and the number of units produced in t hours as x(t) = 12t. Write the cost as a function of time using composition, state the composed function, and find the domain if the factory operates between 0 and 8 hours per shift.
PROBLEM 5CRITICAL THINKING
Let f(x) = (x + 3)/(x − 1) and g(x) = 2/(x + 5). Find (f ∘ g)(x), simplify, and determine the domain. Then explain why reading the domain from the simplified expression alone would be incomplete.

Lesson Summary

Function composition creates a new function by chaining two existing functions: (f ∘ g)(x) = f(g(x)), where the inner function g is applied first and its output is fed into the outer function f. Because the order of application matters, composition is not commutative — swapping f and g generally produces a different function with a potentially different domain.

The domain of f ∘ g is determined by the set-builder condition {x ∈ Dom(g) : g(x) ∈ Dom(f)}. In practice, follow a three-step algorithm: find the domain of g, substitute g(x) into f, and exclude any x-values for which g(x) violates the domain restrictions of f. Always use this algorithm rather than reading the domain off a simplified algebraic expression, because algebraic cancellation can mask inherited restrictions. Mastery of composition and its domain prepares you for inverse functions, the chain rule in calculus, and broader applications in mathematical modeling.

Varsity Tutors • College Algebra • Composition of Functions, Domain of Composition