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.

Enter Functions
Use x as variable. Examples: 2*x+1, x^2, sqrt(x), 3/(x-2), log(x)
Same format. Use parentheses: 3/(x-2) not 3/x-2
Composition Order
Evaluate at Point (optional) Leave empty to skip evaluation

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.

  1. Identify the inner and outer functions. In (f∘g)(x), g is inner, f is outer.
  2. 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.
  3. 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:

  1. Exclude any x that makes g undefined (e.g., division by zero in g(x)).
  2. Ensure that g(x) falls within the allowable inputs for f (e.g., if f requires a positive input, then g(x) > 0).
  3. 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.

Frequently Asked Questions

What is a composite function?
A composite function is formed when one function is applied to the result of another. For functions f and g, the composition f∘g (read “f composed with g”) is defined as (f∘g)(x) = f(g(x)). It means you first evaluate g(x), then use that output as the input for f.
How do you find the domain of a composite function?
First, find the domain of the inner function g. Then determine the domain of the outer function f when its input is g(x). The final domain is all x that satisfy both: x must be in the domain of g, and g(x) must be in the domain of f. Restrictions like denominators or square roots in the composite expression also limit the domain.
What is the order of composition, f(g(x)) or g(f(x))?
The order depends on the notation. (f∘g)(x) means f(g(x)) – apply g first, then f. (g∘f)(x) means g(f(x)) – apply f first, then g. Reversing the order generally yields a different function, so it is essential to follow the correct notation.
Can you compose more than two functions?
Yes, you can compose any number of functions sequentially. For example, (f∘g∘h)(x) = f(g(h(x))). The inner function is evaluated first, and its output becomes the input for the next, and so on. The domain becomes more complex with each additional layer of composition.
What is an example of a composite function in real life?
In economics, a composite function can model tax applied after a discount. If the discount function is d(p)=0.8p and the tax function is t(p)=1.07p, then the final price is t(d(p))=1.07(0.8p)=0.856p, combining both effects into one function.
Why does the composite function calculator show domain restrictions?
The calculator automatically checks for values of x that make any denominator zero or take the square root of a negative number within the composite expression. It also ensures the inner function’s output stays within the outer function’s domain, preventing undefined results.
  1. Domain and Range Calculator – Find Functions Easily
  2. Cubic Equation Solver
  3. Quadratic Equation Solver – Free Online Calculator
  4. Algebra Calculator – Solve Equations Step by Step
  5. Absolute Value Calculator
  6. Make X the Subject Calculator