Composite Function

Composite functions apply one function to the output of another, letting you combine multiple transformations into a single operation.

(fg)(x)=f(g(x))(f \circ g)(x) = f\big(g(x)\big)

Solve a problem with Composite Function

Type the problem. The solver will use Composite Function where Composite Function is the right tool, and tell you when it is not.

Drag one in or paste from the clipboard. JPEG, PNG or WebP. You get the transcription to check before anything is solved.

How to get a better answer
  • Paste the whole problem, including the instruction word — "simplify", "solve for x" and "factor" lead to three different answers.
  • Say what you have already tried. "I got x = 4 and the book says 2" turns a solution into a diagnosis.
  • Set the level in the settings button. A calculus shortcut is not a better answer if you have not met derivatives yet.
  • For a photo, get the whole problem in frame and hold the page flat — you get the transcription to fix before anything is solved.

What each symbol means

What Composite Function takes
ff
gg
xx
Composite Function
SymbolMeaning
ffThe outer function, which takes the output of gg as its input; reading this as the inner function will reverse your order of operations and give the wrong result.
ggThe inner function, applied first to xx; confusing this with ff causes you to perform the operations backwards.
xxThe initial input value, which feeds into gg first, not into ff directly.

When to use it

Use composite functions when you need to see what happens when you apply one function to the result of another function.

Level

Usually taught in: Algebra II

Worked examples

1. Evaluate a composite function with linear functions

Problem

If f(x)=2x+3f(x) = 2x + 3 and g(x)=x1g(x) = x - 1, find (fg)(5)(f \circ g)(5).
  1. (fg)(5)=f(g(5))(f \circ g)(5) = f(g(5))

    by definition of composition

  2. g(5)=51=4g(5) = 5 - 1 = 4

    evaluate the inner function gg at 5

  3. f(4)=2(4)+3=8+3=11f(4) = 2(4) + 3 = 8 + 3 = 11

    evaluate the outer function ff at the result from step 2

Answer: 1111

The key is to work from the inside out: evaluate gg first at your starting value, then feed that result into ff. This is the definition of composition.

2. Compose functions with fractions

Problem

Let f(x)=1xf(x) = \frac{1}{x} and g(x)=x+2g(x) = x + 2. Find (fg)(3)(f \circ g)(3).
  1. (fg)(3)=f(g(3))(f \circ g)(3) = f(g(3))

    by definition of composition

  2. g(3)=3+2=5g(3) = 3 + 2 = 5

    evaluate gg at 3

  3. f(5)=15f(5) = \frac{1}{5}

    evaluate ff at the result

Answer: 15\frac{1}{5}

When working with fractions or more complex functions, the composition rule stays the same: evaluate the inner function first. Note that (gf)(3)=73(g \circ f)(3) = \frac{7}{3} while (fg)(3)=15(f \circ g)(3) = \frac{1}{5}—reversing the order of functions gives a different answer, showing that composition is not commutative.

3. Composite function in a word problem: road trip with stops

Problem

On a road trip, your distance from the starting point (in miles) after tt hours of actual driving is d(t)=60td(t) = 60t. Because of traffic and stops, the actual time you spend driving (out of total elapsed time) is h(n)=3n4h(n) = \frac{3n}{4}, where nn is the total elapsed time in hours. If the trip has taken 4 hours total, how far have you actually driven? Find (dh)(4)(d \circ h)(4).
  1. (dh)(4)=d(h(4))(d \circ h)(4) = d(h(4))

    use composition to find distance after 4 hours total

  2. h(4)=344=124=3h(4) = \frac{3 \cdot 4}{4} = \frac{12}{4} = 3

    the actual driving time is 3 hours

  3. d(3)=603=180d(3) = 60 \cdot 3 = 180

    after 3 hours of driving, you are 180 miles away

Answer: 180 miles180 \text{ miles}

This shows how composition handles multi-stage processes: the total elapsed time goes into hh first to find actual driving time, and that result goes into dd to find distance. Without composition, you might mistakenly compute 604=24060 \cdot 4 = 240 miles, which ignores the stops.

Common mistakes

Where Composite Function usually goes wrong
Answer came out wrong
Writing (fg)(x)=f(x)g(x)(f \circ g)(x) = f(x) \cdot g(x)
Remember that (fg)(x)(f \circ g)(x) means f(g(x))f(g(x))—feed the output of gg into ff, do not multiply them.
Applying the functions in the wrong order, computing g(f(x))g(f(x)) when the problem asks for (fg)(x)(f \circ g)(x)
Always remember: (fg)(f \circ g) means ff is the outer function and gg is the inner function, so evaluate g(x)g(x) first, then apply ff to that result.
Plugging the variable xx into the wrong function, such as computing f(x)f(x) instead of first computing g(x)g(x)
Start with the innermost function: substitute xx into gg first to get g(x)g(x), then substitute that result into ff.
The mistakeWhy it is wrongThe fix
Writing (fg)(x)=f(x)g(x)(f \circ g)(x) = f(x) \cdot g(x)The circle symbol means composition (applying one function to the output of another), not multiplication; this mistake tries to multiply the function values instead of nesting them.Remember that (fg)(x)(f \circ g)(x) means f(g(x))f(g(x))—feed the output of gg into ff, do not multiply them.
Applying the functions in the wrong order, computing g(f(x))g(f(x)) when the problem asks for (fg)(x)(f \circ g)(x)It is easy to mix up which function goes first, but (fg)(x)=f(g(x))(f \circ g)(x) = f(g(x)) always means gg is applied first; applying them backwards gives a completely different answer.Always remember: (fg)(f \circ g) means ff is the outer function and gg is the inner function, so evaluate g(x)g(x) first, then apply ff to that result.
Plugging the variable xx into the wrong function, such as computing f(x)f(x) instead of first computing g(x)g(x)Since xx is the starting input to the composite function, it must go into the inner function first; putting it directly into the outer function skips the inner transformation.Start with the innermost function: substitute xx into gg first to get g(x)g(x), then substitute that result into ff.

Tips and when to use something else

  • Work from the inside out: always apply the inner function first, then feed its output into the outer function.
  • Composition is not commutative—(fg)(x)(f \circ g)(x) is usually different from (gf)(x)(g \circ f)(x), so the order matters.
  • If you need to reverse or undo a composite function, use Inverse Function; don't try to solve it algebraically without the proper technique.
  • When finding a formula for (fg)(x)(f \circ g)(x), substitute the entire expression for g(x)g(x) into ff carefully using Function Notation rules.

Frequently asked questions

What is the difference between (fg)(x)(f \circ g)(x) and f(x)g(x)f(x) \cdot g(x)?
The circle symbol \circ means composition, which is stacking functions—you evaluate g(x)g(x) first, then plug that result into ff. Multiplication uses the symbol \cdot or is written as f(x)g(x)f(x) g(x), and gives you the product of two values. They are completely different operations.
Why can't I just write (fg)(x)=(gf)(x)(f \circ g)(x) = (g \circ f)(x)?
Composition is not commutative, meaning the order matters. When you swap the functions, you are changing the sequence of operations, which almost always gives a different result. For example, if f(x)=2xf(x) = 2x and g(x)=x+1g(x) = x + 1, then (fg)(x)=2(x+1)=2x+2(f \circ g)(x) = 2(x+1) = 2x + 2, but (gf)(x)=2x+1(g \circ f)(x) = 2x + 1, which are different.
How do I find the domain of a composite function (fg)(x)(f \circ g)(x)?
The domain of (fg)(f \circ g) is all values of xx in the domain of gg such that g(x)g(x) is also in the domain of ff. This is more restrictive than just the domain of gg alone, because you have to make sure gg's output is a valid input for ff.
Do I need to find the full formula for (fg)(x)(f \circ g)(x), or can I just plug in a number?
It depends on the problem. If the problem asks for (fg)(5)(f \circ g)(5), just plug in the number and compute. If it asks for the function (fg)(x)(f \circ g)(x) or to simplify it, then you need to substitute the entire expression for g(x)g(x) into ff and simplify.

Need a different method?

The full solver is not scoped to one formula — type any problem and it will pick the method.

Open the math solver

Reviewed 2026-09-18