Composite Function Calculator
Composing functions is a fundamental operation in algebra and precalculus. It allows you to combine two functions f and g into a single function (f∘g)(x) = f(g(x)). Whether you need to simplify an expression, evaluate at a specific x, or check domain restrictions, our composite function calculator provides instant results with step-by-step explanation. Enter your f(x) and g(x) below to see the composition and its domain.
What Is Function Composition?
Function composition is the process of applying one function to the output of another. For two functions f and g, the composition (f∘g)(x) is defined as f(g(x)). Here, g is the inner function–evaluated first–and f is the outer function–applied to the result of g. As Khan Academy explains, composition means you always begin with the rightmost function.
For example, if f(x) = 2x + 1 and g(x) = x^2, then (f∘g)(x) = 2(x^2) + 1 = 2x^2 + 1. The notation f∘g is read “f composed with g,” and it always implies applying the rightmost function first.
Reversing the order usually produces a different function: (g∘f)(x) = g(2x + 1) = (2x + 1)^2 = 4x^2 + 4x + 1, which is not the same as 2x^2 + 1.
How to Compute a Composite Function Manually
While the calculator above automates the process, understanding the manual steps clarifies the concept and helps verify results.
- Identify the inner and outer functions. In (f∘g)(x), g is inner, f is outer.
- Substitute the inner function everywhere x appears in the outer function. Replace every instance of x in the expression for f(x) with the entire expression for g(x). Use parentheses around g(x) to avoid algebraic errors.
- Simplify the resulting expression. Expand, combine like terms, and reduce fractions to obtain the simplest form.
Example: Let f(x) = 3/x and g(x) = x – 2.
- Substitute: f(g(x)) = 3 / (g(x)) = 3 / (x – 2).
- Simplify: The result is 3/(x – 2), with the domain restriction x ≠ 2.
Try this step-by-step method with simple functions, then check your work with the composite function calculator.
Domain of Composite Functions
The domain of a composite function is the set of all real numbers x for which:
- x is in the domain of the inner function g, and
- g(x) is in the domain of the outer function f.
Additionally, the final simplified expression may introduce its own restrictions, such as a denominator that must not be zero or a square root that must have a non-negative argument. Finding the domain therefore requires three checks:
- Exclude any x that makes g undefined (e.g., division by zero in g(x)).
- Ensure that g(x) falls within the allowable inputs for f (e.g., if f requires a positive input, then g(x) > 0).
- Exclude any x that makes the final composite expression undefined (e.g., denominator zero after simplification).
For instance, if f(x) = √x and g(x) = x – 4, then f(g(x)) = √(x – 4). The inner function g is defined for all real numbers, but the outer f requires its input to be ≥ 0. So we need x – 4 ≥ 0 → x ≥ 4. The domain of the composite is [4, ∞).
The calculator automatically analyzes these conditions and displays the domain of the composition, saving you from manual algebraic verification.
Practical Uses of Function Composition
Composite functions appear in many real-world scenarios where one process feeds directly into another.
- Finance: A discount followed by sales tax. If price after a 20% discount is 0.8p, and tax is 7%, the final cost is 1.07(0.8p) = 0.856p.
- Physics: Chained unit conversions. Converting inches to meters might involve inches → centimeters → meters: m = (cm/100) ∘ (inches × 2.54).
- Economics: Demand for a product modeled as a function of price, which itself depends on supply.
- Computer graphics: Multiple geometric transformations (rotation, scaling, translation) are often combined into one composite transformation matrix.
Recognizing these patterns as function compositions helps simplify complex systems into a single, compact expression.
After you understand the concept, use the calculator above to quickly evaluate composite functions, check domain constraints, and explore variations–whether you are studying precalculus or solving applied problems.