The idea: repeated multiplication, and the question that undoes it

An exponential multiplies by the same factor every step: 2ˣ doubles each time x grows by 1. A logarithm asks the reverse question: which power gives this number? log₂ 64 = 6 because 2⁶ = 64. The two are inverse functions: one undoes the other, so their graphs are mirror images across the line y = x.

The curve y = 2ˣ in blue and y = log₂ x in orange on equal axes, with the grey line y = x between them. The points (1, 2) and (2, 4) on 2ˣ are joined to their mirror points (2, 1) and (4, 2) on log₂ x by short segments that cross y = x at a right angle
Swap x and y and 2ˣ becomes log₂ x: (1, 2) ↔ (2, 1), (2, 4) ↔ (4, 2).

Compound interest and e

Put $1 in a bank that pays 100% a year. Paid once, you get $2. Paid twice, each half-year adds 50%: 1.5² = $2.25. Paid n times, each period adds 1/n, so the year ends with (1 + 1/n)ⁿ. More payments always give more, but less and less more:

npaid(1 + 1/n)ⁿbelow e by
1yearly2.0000000.7183
4quarterly2.4414060.2769
12monthly2.6130350.1052
365daily2.7145670.0037
525600every minute2.7182792.6e−6

The limit is the number e = 2.718281828…. Paying interest continuously at rate r for time t gives ert, which is why e and the natural logarithm ln (log base e) show up wherever something grows in proportion to its size. (Demo 1: compounding creeps up to e)

Doubling and half-life

Exponential growth adds, at each step, as much as it already has: 1, 2, 4, 8, 16, 32, 64. The same rule backwards is exponential decay. A drug with a half-life of one hour leaves 64·(½)ᵗ mg of a 64 mg dose after t hours: 64, 32, 16, 8, 4, 2, 1. How long until 1 mg is left? That is a log question: log₂(64 / 1) = 6 half-lives. The doubling time of anything growing by p% per step is about 70 / p steps, because ln 2 ≈ 0.69. (Demo 2: doubling, then halving)

The log as the inverse

2ᵃ = b and log₂ b = a say the same thing. So every point (a, b) of y = 2ˣ is a point (b, a) of y = log₂ x: −1 ↦ ½ becomes ½ ↦ −1, 0 ↦ 1 becomes 1 ↦ 0. Swapping the coordinates reflects the plane across y = x, which turns one graph into the other. That also gives the log's shape for free: 2ˣ is always positive, so log₂ x is only defined for x > 0; 2ˣ passes through (0, 1), so log₂ 1 = 0; 2ˣ grows fast, so log₂ x grows very slowly. (Demo 3: log₂ is 2ˣ mirrored in y = x)

Logs turn multiplication into addition

Because 2ᵃ · 2ᵇ = 2ᵃ⁺ᵇ, the log of a product is the sum of the logs:

log(a·b) = log a + log b        log(a/b) = log a − log b        log(aᵏ) = k·log a

A slide rule is this rule in wood. Each scale is marked at distance log₁₀ x from its 1. Slide the C scale so its 1 sits over a on D, find b on C, and the D scale under it reads a·b, because the two lengths log a and log b add up to log ab. For 2 × 3: 0.3010 + 0.4771 = 0.7782 = log₁₀ 6. (Demo 4: slide rule)

Two log scales C and D from 1 to 10. C is shifted right so that its 1 is over 2 on D. A red hairline at 3 on C lines up with 6 on D. A blue bar marks the length log 2 and an orange bar the length log 3; together they reach log 6
Length log 2 + length log 3 = length log 6: adding on a log scale multiplies.

Log scales make exponentials straight

On an ordinary y-axis, 2ˣ for x = 0..10 is a hockey stick: 1024 sets the scale and the first half of the data hugs the floor. On a log y-axis the height of y is log₁₀ y, and each doubling adds the same log₁₀ 2 = 0.301. Equal ratios become equal steps, so the points line up on a straight line whose slope is the log of the growth factor. That is how to spot exponential growth in real data (epidemics, transistor counts) and why decibels, the Richter scale and pH are logs. (Demo 5: log y-axis)

Left: 2ˣ for x = 0 to 10 on a linear y-axis from 0 to 1024; the points stay near zero and then shoot up. Right: the same points on a log y-axis with grid lines at 1, 10, 100 and 1000; they lie on a straight line
The same eleven numbers: a curve on a linear axis, a straight line on a log axis.

Where it shows up in computing

  • Binary search and balanced trees take log₂ n steps; an exponential algorithm takes 2ⁿ. See Big-O Growth.
  • The number of digits of n in base b is ⌊log_b n⌋ + 1: a 64-bit number has up to 20 decimal digits. See Number Bases.
  • eˣ = 1 + x + x²/2! + …, and putting x = 1 into it is a faster way to compute e than (1 + 1/n)ⁿ. See Taylor Series.
  • Computing aᵇ mod m fast squares and multiplies, using about log₂ b steps. See Modular Exponentiation.
  • eˣ → 0 as x → −∞, so y = 0 is a horizontal asymptote on the left only, and ln x has the vertical asymptote x = 0. See Types of Asymptotes.

What each number in y = a·b^(x − h) + k does to the graph (growth or decay, the asymptote y = k, reflection, and why a shift is a stretch) is on Exponential Graphs: What a, b, h, k Do.

For half-life in a circuit, see RC Circuit: a capacitor's voltage halves every RC·ln 2.

What the page leaves out

Proving that (1 + 1/n)ⁿ increases and is bounded, and the calculus fact that eˣ is its own derivative (so ln x has derivative 1/x). Change of base, log_b x = ln x / ln b, beyond a mention. Log-log plots, where a power law xᵏ becomes a straight line. Logs of negative and complex numbers, and how hardware computes exp and log (range reduction plus a short polynomial).