Inverse Functions: 2ˣ and log₂ x

Category: Functions   Level: 201

y = 2x ⇔ x = log2 y; graphs mirror across y = x

An inverse function undoes the original. Swap every input and output pair, and the graph flips across the line y = x.

Step through it

Watch it

Animated walkthrough

Step by step

Step 1: Graph y = 2ˣ

Start with y = 2ˣ. Each step right doubles the height. List five points in the table.

y = 2x: (-1, 0.5), (0, 1), (1, 2), (2, 4), (3, 8)

Step 1: Graph y = 2ˣ

Step 2: Draw the mirror y = x

The line y = x holds every point whose two coordinates match. It is the mirror for inverses.

mirror: y = x

Step 2: Draw the mirror y = x

Step 3: Swap each pair

Swap x and y in each pair: (2, 4) becomes (4, 2). The dashed links cross the mirror at right angles, and the mirror cuts each one in half.

(x, y) → (y, x): (2, 4) → (4, 2), (3, 8) → (8, 3)

Step 3: Swap each pair

Step 4: Connect the swapped points

The orange points lie on y = log₂ x, the inverse of 2ˣ. It answers the question: 2 to what power gives x?

log2 8 = 3 because 23 = 8

Step 4: Connect the swapped points

Step 5: Swap domain and range

The swap trades the roles of the axes. 2ˣ takes any x and gives only positive outputs, so log₂ x takes only positive inputs and gives any output.

log2(2x) = x: the log undoes the power

Step 5: Swap domain and range

All steps at once

Storyboard

Generate it yourself

cd svg-generator
python3 -m svgmath render inverse-functions --out /tmp/inverse-functions

Source: svgmath/diagrams/function_operations.py