Grade 12 IB Math is live, AA and AI · see the IB course

Grade 12 · MHF4U · Advanced Functions

MHF4U: Composition of Functions

A composite function feeds the output of one function into another. f(g(x))f(g(x)), also written (f∘g)(x)(f \circ g)(x), means: apply gg to xx first, then apply ff to the result. Read it from the inside out.

How It Works

Evaluating at a number. Work from the inside: to find f(g(3))f(g(3)), find g(3)g(3), then put that number into ff. You do not need the composite equation for this.

Finding the composite equation. Replace every xx in the outer function with the whole inner function, in brackets. For f(x)=x−4f(x) = x - 4 and g(x)=3x2g(x) = 3x^2, f(g(x))=3x2−4f(g(x)) = 3x^2 - 4, but g(f(x))=3(x−4)2g(f(x)) = 3(x - 4)^2. These are different functions: in general f(g(x))≠g(f(x))f(g(x)) \ne g(f(x)), so the order matters.

The domain of a composite. xx has to be in the domain of the inner function, and the inner function's output has to be in the domain of the outer one. Simplifying can hide a restriction. With f(x)=x−2f(x) = \sqrt{x - 2} and g(x)=x2+1g(x) = x^2 + 1, g(f(x))g(f(x)) simplifies to x−1x - 1, which looks defined everywhere, but ff only accepts x≥2x \ge 2, so the composite does too.

Decomposing. Going the other way, a complicated function can often be written as a composite of two simple ones. h(x)=(3x−5)4h(x) = (3x - 5)^4 is f(g(x))f(g(x)) with g(x)=3x−5g(x) = 3x - 5 inside and f(x)=x4f(x) = x^4 outside. When one of ff and f(g(x))f(g(x)) is given and the other unknown, solve for the unknown inside function algebraically.

Inverses. A function and its inverse undo each other: f(f−1(x))=xf(f^{-1}(x)) = x and f−1(f(x))=xf^{-1}(f(x)) = x. This is a quick check of an inverse you have found.

5 Worked Examples

Easy first, test level last. Try each one on paper, then open the solution.

  1. Easy

    For f(x)=2x+1f(x) = 2x + 1 and g(x)=x2g(x) = x^2, find f(g(3))f(g(3)) and g(f(3))g(f(3)).
    Show solution
    1. g(3)=9g(3) = 9, so f(g(3))=f(9)=19f(g(3)) = f(9) = 19.
    2. f(3)=7f(3) = 7, so g(f(3))=g(7)=49g(f(3)) = g(7) = 49.

    Answer: f(g(3))=19f(g(3)) = 19 and g(f(3))=49g(f(3)) = 49

  2. Easy

    For f(x)=x−4f(x) = x - 4 and g(x)=3x2g(x) = 3x^2, find f(g(x))f(g(x)) and g(f(x))g(f(x)).
    Show solution
    1. f(g(x))=f(3x2)=3x2−4f(g(x)) = f(3x^2) = 3x^2 - 4.
    2. g(f(x))=g(x−4)=3(x−4)2=3x2−24x+48g(f(x)) = g(x - 4) = 3(x - 4)^2 = 3x^2 - 24x + 48.

    Answer: f(g(x))=3x2−4f(g(x)) = 3x^2 - 4; g(f(x))=3x2−24x+48g(f(x)) = 3x^2 - 24x + 48

  3. Medium

    For f(x)=x−2f(x) = \sqrt{x - 2} and g(x)=x2+1g(x) = x^2 + 1, find f(g(x))f(g(x)) and g(f(x))g(f(x)) with their domains.
    Show solution
    1. f(g(x))=x2+1−2=x2−1f(g(x)) = \sqrt{x^2 + 1 - 2} = \sqrt{x^2 - 1}. It needs x2≥1x^2 \ge 1, so x≤−1x \le -1 or x≥1x \ge 1.
    2. g(f(x))=(x−2)2+1=x−1g(f(x)) = (\sqrt{x - 2})^2 + 1 = x - 1.
    3. But ff is applied first, so x≥2x \ge 2. The domain is x≥2x \ge 2, not all real numbers.

    Answer: f(g(x))=x2−1f(g(x)) = \sqrt{x^2 - 1} for x≤−1x \le -1 or x≥1x \ge 1; g(f(x))=x−1g(f(x)) = x - 1 for x≥2x \ge 2

  4. Medium

    For f(x)=1x−3f(x) = \frac{1}{x - 3} and g(x)=2x+1g(x) = 2x + 1, find f(g(x))f(g(x)) and g(f(x))g(f(x)) and state each domain.
    Show solution
    1. f(g(x))=12x+1−3=12x−2f(g(x)) = \frac{1}{2x + 1 - 3} = \frac{1}{2x - 2}. The denominator is 00 at x=1x = 1.
    2. g(f(x))=2x−3+1=2+x−3x−3=x−1x−3g(f(x)) = \frac{2}{x - 3} + 1 = \frac{2 + x - 3}{x - 3} = \frac{x - 1}{x - 3}.
    3. ff is applied first and excludes x=3x = 3.

    Answer: f(g(x))=12x−2f(g(x)) = \frac{1}{2x - 2} for x≠1x \ne 1; g(f(x))=x−1x−3g(f(x)) = \frac{x - 1}{x - 3} for x≠3x \ne 3

  5. Test level

    f(x)=2x−3f(x) = 2x - 3 and f(g(x))=6x2+4x−1f(g(x)) = 6x^2 + 4x - 1. Find g(x)g(x), then evaluate g(f(2))g(f(2)).
    Show solution
    1. f(g(x))=2g(x)−3f(g(x)) = 2g(x) - 3, so 2g(x)−3=6x2+4x−12g(x) - 3 = 6x^2 + 4x - 1.
    2. 2g(x)=6x2+4x+22g(x) = 6x^2 + 4x + 2, so g(x)=3x2+2x+1g(x) = 3x^2 + 2x + 1.
    3. Check: 2(3x2+2x+1)−3=6x2+4x−12(3x^2 + 2x + 1) - 3 = 6x^2 + 4x - 1.
    4. f(2)=1f(2) = 1, so g(f(2))=g(1)=3+2+1=6g(f(2)) = g(1) = 3 + 2 + 1 = 6.

    Answer: g(x)=3x2+2x+1g(x) = 3x^2 + 2x + 1; g(f(2))=6g(f(2)) = 6

Learn It on Martian Lab

Martian Lab teaches this in the Composition of Functions lesson of its MHF4U Combining Functions unit. Watch it, then take the Combining Functions practice tests to see if it stuck.

Watch the Composition of Functions lesson free

Start Practicing

No credit card required to start.

Get started