Composite Functions: Definition, Method and Examples

MathPublished

Understanding Composite Functions: Rules, Methods, and Examples

A composite function applies one function to the output of another, written as (f∘g)(x)=f(g(x))(f \circ g)(x) = f(g(x)). To evaluate a composition, apply the inner function first, then use its result as the input for the outer function. Because the order of operations changes the result, composing f(x)f(x) with g(x)g(x) usually produces a different answer than composing g(x)g(x) with f(x)f(x).

What is a composite function?

A composition of functions occurs when the output of one function becomes the input for a second function. Rather than evaluating two separate equations independently, a composite function links them into a single continuous process.


Understanding how to link functions in algebra is like working with a multi-step factory machine. An initial value enters the first machine (the inner function), which produces a result. That result immediately drops into the second machine (the outer function), which processes it to produce the final answer.

A machine diagram shows an input x entering an inner function box g(x). Its output, g(x), then enters an outer function box to produce the final output f(g(x)).

Read f composed with g

To write a composite function, mathematicians use a specific function notation. The symbol for composition is a small open circle (∘\circ).


When you see (f∘g)(x)(f \circ g)(x), it means the function gg is placed inside the function ff. This relationship can also be written with nested brackets as f(g(x))f(g(x)).


Both notations mean exactly the same thing. They are read aloud as "ff composed with gg" or "ff of gg of xx." Always identify the function closest to the variable xx as the inner function, which must be evaluated first.

Evaluate a composition

When you need to find the numerical value of a composite function, always work from the inside out.

  1. Substitute the given number into the inner function.
  2. Calculate the intermediate result.
  3. Substitute that result into the outer function to find the final answer.

Always evaluate the inner function first, then pass its output to the outer function.

Write a composite rule

Instead of finding a single number, you may need to write an algebraic rule for the combined function. To do this, substitute the entire expression of the inner function into the outer function wherever its variable appears.


The order of composition completely changes the resulting formula. Composing ff into gg is rarely the same as composing gg into ff.

A side-by-side comparison shows f(g(x)) equals x squared minus 6x plus 9, while g(f(x)) equals x squared minus 3, proving that changing the order changes the result.

Check domains in a composition

Finding the domain and range of a composite function requires checking restrictions at two different stages.


First, the input value must be valid for the inner function. If an xx-value causes a division by zero or a negative square root in the inner function, it is excluded immediately.


Second, the output of the inner function must be a valid input for the outer function. The final domain of (f∘g)(x)(f \circ g)(x) consists only of values that survive both checks.

Worked examples

Let's apply these steps to evaluate and simplify composite functions.


Example 1: Numerical evaluation of a composite function


Question: Let f(x)=3x−2f(x) = 3x - 2 and g(x)=x2g(x) = x^2. Find the value of (f∘g)(4)(f \circ g)(4).


Method:

  1. Identify the inner function, which is g(x)g(x).
  2. Substitute x=4x = 4 into g(x)g(x) to get g(4)=42=16g(4) = 4^2 = 16.
  3. Use this result as the input for the outer function, f(x)f(x).
  4. Substitute 1616 into f(x)f(x) to get f(16)=3(16)−2f(16) = 3(16) - 2.

Answer: (f∘g)(4)=46(f \circ g)(4) = 46.


Check: The algebraic rule is (f∘g)(x)=3(x2)−2(f \circ g)(x) = 3(x^2) - 2. Substituting x=4x = 4 gives 3(16)−2=48−2=463(16) - 2 = 48 - 2 = 46. The results match.


Example 2: Writing an algebraic expression for composition


Question: If p(x)=5xp(x) = 5x and q(x)=x+7q(x) = x + 7, what is the rule for q(p(x))q(p(x))?


Method:

  1. Identify the inner function, p(x)=5xp(x) = 5x.
  2. Identify the outer function, q(x)=x+7q(x) = x + 7.
  3. Substitute the entire expression for p(x)p(x) into every xx in q(x)q(x).
  4. q(p(x))=(5x)+7q(p(x)) = (5x) + 7.

Answer: q(p(x))=5x+7q(p(x)) = 5x + 7.


Check: Test a random value like x=2x = 2. Using the separate functions: p(2)=10p(2) = 10, then q(10)=17q(10) = 17. Using the composite rule: 5(2)+7=175(2) + 7 = 17. The results match perfectly.


Example 3: Checking domain restrictions


Question: Let f(x)=1xf(x) = \dfrac{1}{x} and g(x)=x−3g(x) = x - 3. What is the domain of f(g(x))f(g(x))?


Method:

  1. Check the inner function, g(x)=x−3g(x) = x - 3. There are no domain restrictions here.
  2. Form the composite rule: f(g(x))=1x−3f(g(x)) = \dfrac{1}{x - 3}.
  3. Check the outer function's restriction. The denominator cannot be zero.
  4. Set the denominator to zero to find the excluded value: x−3=0x - 3 = 0, so x=3x = 3.

Answer: The domain is all real numbers except x=3x = 3.


Check: Pick x=3x = 3. The inner function gives g(3)=3−3=0g(3) = 3 - 3 = 0. The outer function becomes f(0)=10f(0) = \dfrac{1}{0}, which is mathematically undefined. This confirms 33 must be excluded.

Common mistakes

A frequent error is confusing the composition symbol (∘\circ) with the multiplication symbol (×\times or ⋅\cdot). The expression (f∘g)(x)(f \circ g)(x) means substitution, not multiplication. Do not multiply f(x)f(x) by g(x)g(x).


Another common mistake is evaluating the outer function first. If you are asked for f(g(2))f(g(2)), calculating f(2)f(2) and plugging that result into g(x)g(x) will give the wrong answer. Always calculate from the inside out.

Frequently asked questions

Can you compose a function with itself?

Yes, you can substitute a function into itself. This is written as (f∘f)(x)(f \circ f)(x) or f(f(x))f(f(x)). For example, if f(x)=2xf(x) = 2x, then f(f(x))=2(2x)=4xf(f(x)) = 2(2x) = 4x.


Does function composition relate to inverse functions?

Yes, composing a function with its inverse undoes the original operation. If two types of functions are exact inverses of each other, then both f(g(x))f(g(x)) and g(f(x))g(f(x)) will equal xx. This is the standard test to prove two equations are inverse functions.

Practice questions

Question

A mapping diagram shows an initial input of negative 1 passing through function g to output 4, which then passes through function f to output 16.

The mapping diagram shows how an initial input passes through function gg and then function ff. Which expression correctly represents the final output of 1616?

  • f(g(−1))f(g(-1))

  • g(f(−1))g(f(-1))

  • f(−1)×g(4)f(-1) \times g(4)

  • f(g(4))f(g(4))

Answer:

f(g(−1))f(g(-1))

Question

Let f(x)=3x−2f(x) = 3x - 2 and g(x)=x2+1g(x) = x^2 + 1. What is the value of g(f(3))g(f(3))?

  • 2828

  • 5050

  • 7070

  • 1010

Answer:

5050

Question

Let f(x)=4xf(x) = 4x and g(x)=x−5g(x) = x - 5. What is the rule for the composite function (f∘g)(x)(f \circ g)(x)?

  • 4x−204x - 20

  • 4x−54x - 5

  • 4x2−20x4x^2 - 20x

  • x−5x - 5

Answer:

4x−204x - 20

Question

Let f(x)=xf(x) = \sqrt{x} and g(x)=x−4g(x) = x - 4. What is the domain of (f∘g)(x)(f \circ g)(x)?

  • x≥4x \geq 4

  • x≥0x \geq 0

  • x>4x > 4

  • x≤4x \leq 4

Answer:

x≥4x \geq 4

Question

A coordinate plane shows an orange line for f(x) passing through (0, 2) and (2, 4), and a blue line for g(x) passing through (0, 4) and (4, 0).

Using the given graphs of f(x)f(x) and g(x)g(x), what is the value of f(g(2))f(g(2))?

  • 44

  • 00

  • 88

  • 66

Answer:

44