← All skill guides

Function Composition: Step-by-Step Guide

Function composition means using the output of one function as the input of another. (f o g)(x) is the same as f(g(x)). You apply g to x first, and then apply f to that result. The order matters, because f(g(x)) is usually different from g(f(x)).

Math Racer skill guide · Algebra 2 · Grade 11

How to solve it, step by step

  1. Find the inner and outer functions. In f(g(x)), the inner function is g, and the outer function is f. The inner function goes first.
    \[(f\circ g)(x) = f(g(x))\]
  2. Put the inner function into the outer one. Wherever you see x in f(x), replace it with the whole expression g(x), in parentheses.
    \[f(x)\to f\bigl(g(x)\bigr)\]
  3. Simplify. Multiply out and combine like terms to get a clean expression.
    \[f(g(x)) = \text{simplified polynomial / expression}\]
  4. Find the domain. x must be allowed in g, and g(x) must be allowed in f. Leave out any values where that fails.
    \[\text{dom}(f\circ g) = \{x \in \text{dom}(g)\,:\,g(x)\in \text{dom}(f)\}\]
  5. Check with a number. Pick a number for x. Find g of it, then f of that result. Compare with your composed expression.
    \[f(g(c)) \stackrel{?}{=} (f\circ g)(c)\]

Worked example

Given f(x) = 2x + 1 and g(x) = x^2 - 3, find (f o g)(x).

Step 1: The inner function is g(x) = x^2 - 3. The outer function is f(x) = 2x + 1.

Step 2: Replace x in f(x) with g(x): f(g(x)) = 2(x^2 - 3) + 1.

Step 3: Simplify: 2(x^2 - 3) + 1 = 2x^2 - 6 + 1 = 2x^2 - 5.

Step 4: Domain: g works for every real number, and f accepts any number, so the domain is all real numbers.

Step 5: The answer is (f o g)(x) = 2x^2 - 5.

Check: Let x = 2. g(2) = 4 - 3 = 1, and f(1) = 2 + 1 = 3. Using the answer: 2(4) - 5 = 3. They match.

Tips and common mistakes

  • Order matters. f(g(x)) and g(f(x)) are usually different, so read the notation carefully.
  • Always put g(x) in parentheses when you substitute. It stops mistakes when you multiply out.
  • Composition is not multiplication. f(g(x)) does not mean f(x) times g(x).
  • If the inner function has a square root or a fraction, make sure its outputs are allowed as inputs for the outer function.
  • (f o g)(x) is read 'f of g of x'. The function closest to x goes first.
  • Trying one number is a quick way to catch most mistakes.

Practice in Explorer · More skill guides