Algebra 2Functions and Their GraphsF-BF.A.1c

Composition of Functions

f(g(x)) feeds the output of g into f.

Not started Jump to practice

In Adding, Subtracting, Multiplying and Dividing Functions you combined two outputs. Composition does something different: the output of one function becomes the input of the next, like two machines on an assembly line.

Key idea

$(f \circ g)(x) = f(g(x))$. Work from the inside out: apply $g$ first, then apply $f$ to the result. To get a formula, replace every $x$ in $f$ with the whole expression $g(x)$.

Why it works

Read $f(g(3))$ like a set of instructions. The parentheses say $g$ acts on 3 first; its output is the only thing $f$ ever sees. Order matters because the processes are different: putting on socks and then shoes is not the same as shoes and then socks. The little circle $\circ$ is read "after": $f \circ g$ is "$f$ after $g$."
Two machines in a row. Change the input and press "Swap the order" to see that $f(g(x))$ and $g(f(x))$ are usually different.

Worked examples

Worked example: Numbers first

Let $f(x) = x^2 + 1$ and $g(x) = 2x - 3$. Find $f(g(2))$ and $g(f(2))$.
  1. $g(2) = 4 - 3 = 1$, then $f(1) = 1 + 1 = 2$. So $f(g(2)) = 2$.
  2. $f(2) = 4 + 1 = 5$, then $g(5) = 10 - 3 = 7$. So $g(f(2)) = 7$.

Answer: $f(g(2)) = 2$ and $g(f(2)) = 7$: the order changes the answer.

Worked example: A formula for the composition

With the same functions, find $f(g(x))$ and $g(f(x))$.
  1. Replace $x$ in $f$ with $(2x - 3)$: $f(g(x)) = (2x - 3)^2 + 1$.
  2. Expand: $4x^2 - 12x + 9 + 1 = 4x^2 - 12x + 10$.
  3. Replace $x$ in $g$ with $(x^2 + 1)$: $g(f(x)) = 2(x^2 + 1) - 3 = 2x^2 - 1$.
  4. Check with $x = 2$: $4(4) - 24 + 10 = 2$ and $2(4) - 1 = 7$, matching the first example.

Answer: $f(g(x)) = 4x^2 - 12x + 10$ and $g(f(x)) = 2x^2 - 1$

Worked example: Reading a table

$f(1) = 4$, $f(3) = -2$, $g(2) = 3$ and $g(4) = 1$. Find $f(g(2))$.
  1. Inside first: $g(2) = 3$.
  2. Then $f(3) = -2$.

Answer: $f(g(2)) = -2$

Common mistake

Multiplying instead of composing. $f(g(x))$ is not $f(x) \cdot g(x)$. In the first example, $f(2) \cdot g(2) = 5 \cdot 1 = 5$, but $f(g(2)) = 2$. Another slip is working in the wrong order. Check yourself by plugging in one number and evaluating step by step from the inside out.

Practice

Pass with 3 right answers, the last 2 in a row. Each right answer earns 2 XP.

Loading practice…

Builds on

Leads to

Also used in other ladders:

Sources and further reading

  • OpenStax College Algebra 2e, Section 3.4 Composition of Functions
  • Common Core State Standards, F-BF.A.1c
@teddyrookbook GitHub