Lesson 4 — Function Composition & Inverses

Overview

Every function is a process: you give it an input, it performs a rule, and you receive an output.
But what happens when one process feeds into another, or when you want to reverse a process entirely?

That’s where composition and inverses enter.
Composition lets you chain functions like gears in a machine.
Inverses let you undo what a function does—like rewinding a movie perfectly frame by frame.

By the end of this lesson you’ll understand:

  1. How composite functions work

  2. How to find and verify an inverse

  3. Why graphs of inverses are mirror images across y=xy = xy=x

1 — Composite Functions: Functions Inside Functions

A composite function performs two actions in sequence: first ggg, then fff.
We write this as:

(f∘g)(x)=f(g(x))(f ∘ g)(x) = f(g(x))(f∘g)(x)=f(g(x))

Read “fofgf of gfofg”—you plug xxx into ggg first, then feed that result into fff.

Example 1

Let

f(x)=2x+3,g(x)=x2f(x)=2x+3,\qquad g(x)=x^2f(x)=2x+3,g(x)=x2

Then

(f∘g)(x)=f(g(x))=2(x2)+3=2x2+3(f ∘ g)(x)=f(g(x))=2(x^2)+3=2x^2+3(f∘g)(x)=f(g(x))=2(x2)+3=2x2+3(g∘f)(x)=g(f(x))=(2x+3)2=4x2+12x+9(g ∘ f)(x)=g(f(x))=(2x+3)^2=4x^2+12x+9(g∘f)(x)=g(f(x))=(2x+3)2=4x2+12x+9

🚩 Composition is not commutative—order completely changes the outcome.

Example 2: Real-World View

Let
g(x)g(x)g(x) = the temperature in ° C,
f(C)f(C)f(C) = the temperature in ° F = 1.8C + 32.

Then
(f∘g)(x)(f ∘ g)(x)(f∘g)(x) converts from input x to Celsius, then to Fahrenheit—two stages of one pipeline.

2 — Decomposing Functions

Sometimes you’ll unpack a function into simpler parts.

Example:

h(x)=3x+2h(x)=\sqrt{3x+2}h(x)=3x+2​

You can think of it as
g(x)=3x+2,  f(u)=ug(x)=3x+2,\; f(u)=\sqrt{u}g(x)=3x+2,f(u)=u​.
Then h(x)=f(g(x))h(x)=f(g(x))h(x)=f(g(x)).

Recognizing these layers helps in substitution, differentiation, and graph shifts later.

3 — Evaluating Composite Functions

  1. Find the inner value: compute g(x)g(x)g(x).

  2. Feed it into the outer function fff.

Example:

f(x)=x+1,g(x)=2x2f(x)=x+1,\quad g(x)=2x^2f(x)=x+1,g(x)=2x2

Find (f∘g)(3)(f ∘ g)(3)(f∘g)(3):

g(3)=2(3)2=18,f(18)=18+1=19g(3)=2(3)^2=18,\quad f(18)=18+1=19g(3)=2(3)2=18,f(18)=18+1=19

✅ Answer: 19

4 — Inverse Functions: Undoing the Process

An inverse function reverses another.
If fff takes you from x→yx → yx→y, then f−1f^{-1}f−1 takes you back from y→xy → xy→x.

Formally:

f(f−1(x))=x,f−1(f(x))=xf(f^{-1}(x)) = x,\quad f^{-1}(f(x)) = xf(f−1(x))=x,f−1(f(x))=x

Not every function has an inverse—it must be one-to-one: each output comes from only one input.
You can test this with the horizontal-line test: any horizontal line should hit the graph once at most.

5 — Finding the Inverse Algebraically

Step-by-Step Method

  1. Replace f(x)f(x)f(x) with yyy.

  2. Swap xxx and yyy.

  3. Solve for yyy.

  4. Rename that yyy as f−1(x)f^{-1}(x)f−1(x).

Example 1

f(x)=3x−7f(x)=3x-7f(x)=3x−7

  1. y=3x−7y=3x-7y=3x−7

  2. Swap: x=3y−7x=3y-7x=3y−7

  3. Solve: y=x+73y=\tfrac{x+7}{3}y=3x+7​
    ✅ f−1(x)=x+73f^{-1}(x)=\tfrac{x+7}{3}f−1(x)=3x+7​

Check:

f(f−1(x))=3 ⁣(x+73)−7=xf(f^{-1}(x))=3\!\left(\tfrac{x+7}{3}\right)-7=xf(f−1(x))=3(3x+7​)−7=x

Perfect inverse!

Example 2

f(x)=x−45f(x)=\frac{x-4}{5}f(x)=5x−4​

  1. y=x−45y=\tfrac{x-4}{5}y=5x−4​

  2. Swap: x=y−45x=\tfrac{y-4}{5}x=5y−4​

  3. Multiply: 5x=y−45x=y-45x=y−4

  4. y=5x+4y=5x+4y=5x+4

✅ f−1(x)=5x+4f^{-1}(x)=5x+4f−1(x)=5x+4

Example 3 (non-linear)

f(x)=x2+2,x≥0f(x)=x^2+2,\quad x\ge0f(x)=x2+2,x≥0

  1. y=x2+2y=x^2+2y=x2+2

  2. Swap: x=y2+2x=y^2+2x=y2+2

  3. y=x−2y=\sqrt{x-2}y=x−2​

✅ f−1(x)=x−2, x≥2f^{-1}(x)=\sqrt{x-2},\ x\ge2f−1(x)=x−2​, x≥2

Restriction x≥0x\ge0x≥0 was necessary so the original passes the horizontal-line test.

6 — Verifying an Inverse

Compute both compositions:

f(f−1(x)) and f−1(f(x))f(f^{-1}(x)) \text{ and } f^{-1}(f(x))f(f−1(x)) and f−1(f(x))

If each simplifies to xxx, they’re true inverses.

Example

f(x)=2x+5,  f−1(x)=x−52f(x)=2x+5,\; f^{-1}(x)=\tfrac{x-5}{2}f(x)=2x+5,f−1(x)=2x−5​

f(f−1(x))=2 ⁣(x−52)+5=xf(f^{-1}(x))=2\!\left(\tfrac{x-5}{2}\right)+5=xf(f−1(x))=2(2x−5​)+5=xf−1(f(x))=(2x+5)−52=xf^{-1}(f(x))=\tfrac{(2x+5)-5}{2}=xf−1(f(x))=2(2x+5)−5​=x

✅ Verified.

7 — Graphical Relationship of Inverses

Graphically, fff and f−1f^{-1}f−1 are mirror images across the line y=xy = xy=x.

  • Their points swap coordinates: if (a,b)(a,b)(a,b) is on fff, then (b,a)(b,a)(b,a) is on f−1f^{-1}f−1.

  • Their domains and ranges trade places:

    Domain(f)=Range(f−1),Range(f)=Domain(f−1)\text{Domain}(f)=\text{Range}(f^{-1}),\quad \text{Range}(f)=\text{Domain}(f^{-1})Domain(f)=Range(f−1),Range(f)=Domain(f−1)

Example Visualization

If f(x)=x2+2f(x)=x^2+2f(x)=x2+2 for x≥0x\ge0x≥0, its inverse f−1(x)=x−2f^{-1}(x)=\sqrt{x-2}f−1(x)=x−2​ is its mirror across y=xy=xy=x.
The parabola and square-root curve intersect exactly on that diagonal.

8 — Common Inverse Pairs

Function f(x)f(x)f(x)Inverse f−1(x)f^{-1}(x)f−1(x)Domain → Rangex+3x+3x+3x−3x-3x−3R↔R\mathbb{R}\leftrightarrow\mathbb{R}R↔R2x2x2xx2\tfrac{x}{2}2x​R↔R\mathbb{R}\leftrightarrow\mathbb{R}R↔Rx2x^2x2 (restricted x≥0x\ge0x≥0)x\sqrt{x}x​[0,∞)↔[0,∞)[0,\infty)\leftrightarrow[0,\infty)[0,∞)↔[0,∞)exe^xexln⁡(x)\ln(x)ln(x)R↔(0,∞)\mathbb{R}\leftrightarrow(0,\infty)R↔(0,∞)sin⁡(x)\sin(x)sin(x) (−π2≤x≤π2-\tfrac{\pi}{2}\le x\le\tfrac{\pi}{2}−2π​≤x≤2π​)arcsin⁡(x)\arcsin(x)arcsin(x)[−1,1]↔[−π2,π2][-1,1]\leftrightarrow[-\tfrac{\pi}{2},\tfrac{\pi}{2}][−1,1]↔[−2π​,2π​]

9 — Common Mistakes to Avoid

  1. Forgetting to restrict domain on non-one-to-one functions like x2x^2x2 or ∣x∣|x|∣x∣.

  2. Mixing composition order—f(g(x))≠g(f(x))f(g(x))\neq g(f(x))f(g(x))=g(f(x)).

  3. Algebra sign errors when solving for yyy.

  4. Neglecting graphical checks—verify mirror symmetry across y=xy=xy=x.

10 — Concept Reflection

Function composition and inverses complete the story of relationships and reversibility.
Composition shows how outputs become new inputs—how systems connect in layers.
Inverses reveal balance—how every process can, under the right conditions, be undone.

Later in calculus, these ideas evolve into the Chain Rule and Inverse Derivative Rule, giving you the tools to understand change forward and backward.