Algebra • Function Operations

Composite Function Evaluator

Evaluate composite functions (f ∘ g)(x) = f(g(x)), (g ∘ f)(x) = g(f(x)), and self-compositions with intermediate step-by-step value tracing and domain verification.

|
Last Updated: September 2026
|
Verified Accurate: Real Analysis & Abstract Algebra
Quick Presets

Composition Order

Select which function is the outer function vs. inner function

Variable: x
f(x) =
Variable: x
g(x) =

Compute exact numerical value at this real number (or enter expression like 3, -1/2, pi/4)

x =
Composite Result f(g(x₀))
9
Exact: 9
Inner Output u g(x₀)
3
u = g(2) = 3
Symbolic Formula Algebraic
2x² + 1
f(x² - 1) = 2(x² - 1) + 3
Domain Check Valid Point
x = 2 in Domain
g(2) & f(g(2)) real

3-Stage Function Pipeline (Inside-Out Process)

Stage flow: x → Inner → Outer
Stage 1: Input
x = 2
Initial Argument
feeds g(x)
Stage 2: Inner Machine g(x)
g(2) = 2² - 1
Output u = 3
feeds f(u)
Stage 3: Outer Machine f(u)
f(3) = 2(3) + 3
Final: 9

Step-by-Step Composition Solution

Verified algebraic steps

All 4 Compositions Comparison at x₀

Demonstrates that (f ∘ g)(x) ≠ (g ∘ f)(x) in general
(f ∘ g)(x)
2x² + 1
9
(g ∘ f)(x)
(2x+3)² - 1
48
(f ∘ f)(x)
4x + 9
17
(g ∘ g)(x)
(x²-1)² - 1
8

Composite Curves & Point (x₀, y₀)

Range: x ∈ [-4, 4]
f(x)
g(x)
(f ∘ g)(x)
Point (x₀, y₀)

Sample Values Table

Integer x
x g(x) f(g(x)) g(f(x))
Direct Answer & Overview
Verified Educational Guide

How to Evaluate a Composite Function f(g(x))

To evaluate a composite function, work strictly from the inside out: for a given input value x = c, first compute the inner function value u = g(c). Then, plug that intermediate output u into the outer function f(u). Remember that function composition is non-commutative: f(g(x)) ≠ g(f(x)) in general.

Primary Mathematical Formula Inside-Out Chained Evaluation Model
Standard Equation
ƒ(x)
Q.E.D.
(fcircg)(x)=f(g(x))quadextandquad(gcircf)(x)=g(f(x))(f circ g)(x) = f(g(x)) quad ext{and} quad (g circ f)(x) = g(f(x))
Evaluation order: x → Inner Function g → Output u → Outer Function f → Final Result.
Exact Formula
Input Parameters
Required
1
Outer Function f(x): Mathematical rule evaluated second.
2
Inner Function g(x): Mathematical rule evaluated first on input x.
3
Input Value (x): Numeric value passed into the inner function.
Expected Outputs
Calculated
Intermediate Output u = g(x): Output of the inner function.
Final Evaluated Value f(u): Final result of the outer function.
Worked Numerical Example
Instant Verification
Evaluate (f ∘ g)(3) given f(x) = 2x + 1 and g(x) = x²
→ Step 1: g(3) = 3² = 9. Step 2: f(9) = 2(9) + 1 = 18 + 1 = 19
(f ∘ g)(3) = 19

What Is a Composite Function? (Definition & Notation)

In mathematics, function composition is the algebraic operation that takes two functions, f and g, and produces a new function by applying one after the other.

Formally, given a function g: A → B and a function f: B → C, the composite function f ∘ g: A → C is defined for every element x ∈ A by:

(f ∘ g)(x) = f(g(x))

Circle Notation (f ∘ g)(x)

Read as "f circle g", "f composed with g", or "f of g". The small circle is an operation symbol, exactly like addition (+) or multiplication (×).

Nested Parentheses f(g(x))

Shows the actual computational order: g(x) is the complete input expression placed inside the outer function f.

The Inside-Out Evaluation Rule

When evaluating a composite function at a specific number x = c, always follow the inside-out pipeline rule:

1. Evaluate inner function first: u = g(c)
2. Substitute intermediate output u into outer function: f(u) = f(g(c))
The output of the inner function becomes the sole input of the outer function.

Proof: Function Composition Is Non-Commutative

In ordinary arithmetic, multiplication is commutative (a × b = b × a). However, function composition is strictly non-commutative:

The Non-Commutative Rule
(f ∘ g)(x) ≠ (g ∘ f)(x)
(Except in the special case where f and g are inverse functions: f(g(x)) = g(f(x)) = x)

The Two-Step Domain Rule

An input x must safely navigate both functions to belong to the domain of (f ∘ g)(x):

Step 1: Domain of Inner Function

x must be in Domain(g). If g(x) is undefined (e.g. division by zero), evaluation stops immediately.

Step 2: Domain of Outer Function

The intermediate result g(x) must be in Domain(f). If f cannot accept g(x), the composite value does not exist.

Step-by-Step Worked Examples

Worked Problem Numerical Evaluation

Given f(x) = 2x + 1 and g(x) = x², evaluate (f ∘ g)(3) and (g ∘ f)(3)

1. Compute (f ∘ g)(3): g(3) = 3² = 9 ⇒ f(9) = 2(9) + 1 = 19
2. Compute (g ∘ f)(3): f(3) = 2(3) + 1 = 7 ⇒ g(7) = 7² = 49
(f ∘ g)(3) = 19  |  (g ∘ f)(3) = 49  (Confirms non-commutativity!)

The Calculus Connection: The Chain Rule

Composite functions form the backbone of differential calculus. You cannot differentiate a composite function by simply differentiating each part independently. Instead, you apply the Chain Rule:

d/dx [ f(g(x)) ] = f'(g(x)) · g'(x)

In words: differentiate the outer function f while keeping the inner function g(x) completely untouched inside, and then multiply by the derivative of the inner function g'(x).

Common Pitfalls & Composition Errors

Confusing Composition with Multiplication

(f ∘ g)(x) ≠ f(x) · g(x). Composition plugs one function into another; multiplication computes both values separately and takes their product.

Missing Outer Parentheses

When substituting g(x) = x + 2 into f(x) = x², students often write x + 2² = x + 4 instead of (x + 2)² = x² + 4x + 4.

Evaluating in Reverse Order

In (f ∘ g)(x), the right-hand function g must execute first. Evaluating f(x) first gives (g ∘ f)(x), which is completely different.

Ignoring the Inner Function Domain

Never determine the domain strictly from the simplified result formula. Any value of x that produces division by zero or an imaginary number in the inner function remains excluded forever.

Fact-Checked & Verified • Computational Accuracy Standards
Updated September 2026 • Editorial Policy
Authored By
Sanjay Samanta

Lead Developer & Founder of Basic Math Tools. Specializes in browser-native computational algorithms and applied mathematics.

Reviewed & Verified By
Academic Review Board

Mathematics & curriculum specialists. Audited against standard algebraic and arithmetic principles.

Found an error or have an improvement suggestion? Report a calculation issue

Frequently Asked Questions

How do you evaluate a composite function f(g(x))?
To evaluate a composite function f(g(x)) at a given input x = c: First compute the inner function value u = g(c). Next, take that result u and substitute it into the outer function f(u). The final value is f(g(c)). Always evaluate from the inside out.
What is the circle notation (f ∘ g)(x)?
The small open circle symbol ∘ denotes function composition. (f ∘ g)(x) is mathematically identical to f(g(x)). It reads "f composed with g of x" or "f of g of x".
Why does f(g(x)) not equal g(f(x)) in general?
Function composition is non-commutative. For example, if f(x) = x² and g(x) = x + 3: (f ∘ g)(2) = f(5) = 25, while (g ∘ f)(2) = g(4) = 7. Because 25 ≠ 7, reversing the composition order fundamentally changes the calculation.
How do you determine the domain of a composite function f(g(x))?
The domain of f(g(x)) consists of all x in the domain of g such that g(x) is in the domain of f. First, determine any restrictions on g(x) itself. Then, find any values of x that make g(x) violate a restriction of f(x). The composite domain is the intersection of these two conditions.
What happens if the output of g(x) is outside the domain of f(x)?
If g(x) produces a value that causes division by zero, a negative square root, or an undefined logarithm in f(u), the composite function f(g(x)) is completely undefined for that input x. That x cannot be included in the domain.
What are self-compositions like f(f(x))?
A self-composition applies the same function repeatedly to its own output. For example, if f(x) = 2x + 1, then f(f(x)) = 2(2x + 1) + 1 = 4x + 3. Self-compositions form the foundation of iterative algorithms, fractals, and dynamical systems theory.