Monocurl Essays
Series Download

What a logarithm is: turning multiplication into addition

A logarithm answers "what exponent gives this number?". Because exponents add when powers multiply, logarithms turn every product into a sum.

19 min·High school·

AssumesWhy x⁰ = 1, and negative and fractional exponentsShifting and stretching graphs: why f(x - 2) moves right

A slide rule: two rulers on which each number is printed at a distance proportional to its logarithm. Sliding the top ruler until its 1 sits over 2 puts every top number over its double; sliding to 4 puts 5 over 20.
Monocurl source
let RY = -0.3
# arrows pointing at the scale position of u from above the top ruler and from below the bottom one
let Point = |u, col| [
    Tip([pos(u), RY + RH + 0.5, 0], [pos(u), RY + RH + 0.08, 0], col, 3.5, 0.17),
    Tip([pos(u), RY - RH - 0.48, 0], [pos(u), RY - RH - 0.08, 0], col, 3.5, 0.17)
]
mesh bottom = shift{[0, RY, 0]} Ruler(0)
mesh top = shift{delta: [0, RY, 0]} Ruler(1)
mesh marks = []

slide "rule"
    play Wait(0.6)
    top.delta = [DEC * log10(2), RY, 0]
    play Lerp(1.8, [&top])
    marks = [
        Point(2, EMBER),
        Point(6, LEAF),
        center{[0, 1.9, 0]} Math("2 \times 3 = 6", 1.15, INK)
    ]
    play Fade(0.5, [&marks])
    play Wait(1.6)
    marks = []
    play Fade(0.4, [&marks])
    top.delta = [DEC * log10(4), RY, 0]
    play Lerp(1.8, [&top])
    marks = [
        Point(4, EMBER),
        Point(20, LEAF),
        center{[0, 1.9, 0]} Math("4 \times 5 = 20", 1.15, INK)
    ]
    play Fade(0.5, [&marks])
    play Wait(2.2)

Uses the shared definitions for this lesson's figures.

Light travels 299,792 kilometers in a second, and a year has 31,557,600 seconds. To find the length of a light-year you have to multiply those two numbers. For an astronomer in 1620, a product of numbers that long meant most of a page of long multiplication, with every digit a chance to slip. Kepler’s work on the orbit of Mars required an enormous amount of such multiplication.

Yet by 1630 astronomers were doing such a multiplication in about a minute, without multiplying anything. They looked up two numbers in a book, added them, and looked up the sum. The book was a table of logarithms. This lesson explains what was in the book, why adding could do the work of multiplying, and why the same idea is now built into the way we measure earthquakes and sound.

Multiplying by adding

The trick is easiest to see on numbers chosen to make it work. Here are the powers of 2.

$n$0123456789101112
$2^n$1248163264128256512102420484096

Suppose you want $32 \times 128$. Both numbers are in the bottom row.

  1. Find 32 and 128 in the bottom row. Above them are the exponents 5 and 7.
  2. Add the exponents: 5 + 7 = 12.
  3. Look up 12 in the top row. Below it is 4096, so 32 × 128 = 4096, and nothing was multiplied.
Multiplying $32 \times 128$ with a table of powers of 2. Look up the two exponents, add them, and look up the sum.
Monocurl source
let col_x = |i| -3.3 + 0.55 * i
let Lit = |i, col| Box([col_x(i), 1.25, 0], [0.5, 1.2], col, 0.3, 2.5)
mesh lit = []
mesh table = block {
    . Seg([-3.9, 1.25, 0], [3.6, 1.25, 0], MIST, 2)
    . center{[-3.78, 1.56, 0]} Math("n", 0.78, SLATE)
    . center{[-3.74, 0.94, 0]} Math("2^n", 0.72, SLATE)
    for (i in range(0, 13)) {
        . center{[col_x(i), 1.56, 0]} Math(to_string(i), 0.8, SLATE)
        . center{[col_x(i), 0.94, 0]} Math(to_string(2 ^ i), 0.72, INK)
    }
}
mesh work = []
mesh question = center{[0, -1.5, 0]} Math("32 \times 128 = \ ?", 1.15, INK)

slide "Find 32 and 128 in the bottom row. Above them are the exponents 5 and 7."
    lit = [Lit(5, AZURE), Lit(7, EMBER)]
    work = [
        Tip([col_x(5), 0.58, 0], [col_x(5), -0.1, 0], AZURE, 3, 0.15),
        Tip([col_x(7), 0.58, 0], [col_x(7), -0.1, 0], EMBER, 3, 0.15),
        center{[col_x(5), -0.45, 0]} Math("5", 1.1, AZURE),
        center{[col_x(7), -0.45, 0]} Math("7", 1.1, EMBER)
    ]
    play Fade(0.6)

slide "Add the exponents: 5 + 7 = 12."
    work .= center{[col_x(6), -0.45, 0]} Math("+", 1.1, INK)
    work .= center{[col_x(8.6), -0.45, 0]} Math("= \ 12", 1.1, LEAF)
    play Fade(0.6, [&work])

slide "Look up 12 in the top row. Below it is 4096, so 32 × 128 = 4096, and nothing was multiplied."
    question = []
    play Fade(0.3, [&question])
    lit .= Lit(12, LEAF)
    work .= Tip([col_x(9.7), -0.3, 0], [col_x(12) - 0.12, 0.55, 0], LEAF, 3, 0.15)
    question = center{[0, -1.5, 0]} Math("32 \times 128 = 4096", 1.15, INK)
    play Fade(0.6)

Uses the shared definitions for this lesson's figures.

The reason is the first law of exponents. $2^5$ is five 2s multiplied together and $2^7$ is seven, so their product is twelve 2s:

$$ 2^5 \times 2^7 = 2^{5 + 7} = 2^{12}. $$

In the top row of the table, multiplication has become addition. Division becomes subtraction in the same way, since $2^m \div 2^n = 2^{m - n}$.

Pause and try

Use the table, and no multiplication, to find $64 \times 16$, then $4096 \div 128$, then $8^4$.

Show answerHide answer

$64 \times 16 = 2^6 \times 2^4 = 2^{10} = 1024$. $4096 \div 128 = 2^{12} \div 2^7 = 2^5 = 32$. For the last one, $8 = 2^3$, so $8^4 = 2^3 \times 2^3 \times 2^3 \times 2^3 = 2^{12} = 4096$: raising to the fourth power multiplied the exponent by 4.

The exponent for a number that is not in the table

The method has an obvious weakness: it only handles numbers in the bottom row. To multiply $3 \times 5$ this way we would need exponents $x$ and $y$ with $2^x = 3$ and $2^y = 5$, and no whole number will do, because $2^1 = 2$ is too small and $2^2 = 4$ is too big.

So we are stuck unless exponents can fall between whole numbers. They can. The lesson on exponents showed that keeping the law $2^x \times 2^y = 2^{x+y}$ true forces $2^{1/2} = \sqrt2$ and, in general, $2^{m/n} = \sqrt[n]{2^m}$. Let us hunt for the exponent of 3. Halfway between 1 and 2 we get $2^{1.5} = 2\sqrt2 \approx 2.828$, which is too small. Then $2^{1.75} \approx 3.364$ is too big, $2^{1.625} \approx 3.084$ is too big, and $2^{1.5625} \approx 2.954$ is too small. The exponent we want is trapped between $1.5625$ and $1.625$, and each further halving traps it more tightly.

Pause and try

The next halving point is $1.59375$, and $2^{1.59375} \approx 3.018$. Between which two of the exponents tried so far does the answer now lie? How many more halvings until the interval is shorter than $0.01$?

Show answerHide answer

$3.018$ is too big, so the exponent lies between $1.5625$ and $1.59375$, an interval of length $0.03125$. Two more halvings give lengths $0.0156$ and then $0.0078 < 0.01$. Carried further, the search gives $1.585$ to three decimal places.

On the graph of $y = 2^x$, the hunt is a search for the place where the curve reaches height 3.

The graph of $y = 2^x$ read backwards. Choose a height $y$ on the vertical axis, go across to the curve and down to the horizontal axis: the number you land on is the exponent $x$ with $2^x = y$. The curve rises through every positive height exactly once.
Monocurl source
let fb = Frame(-1.5, 3.5, 0, 9, [-0.75, 0.1, 0], 5.0, 3.3)
let Read = |y| [
    Dash(at(fb, -1.5, y), at(fb, log2(y), y), LEAF, 3),
    Tip(at(fb, log2(y), y), at(fb, log2(y), 0.1), LEAF, 3, 0.14),
    Pt(at(fb, -1.5, y), EMBER, 0.09),
    Pt(at(fb, log2(y), y), LEAF, 0.09),
    center{[3.0, 0.55, 0]} scale{1.35} color{EMBER} Number(y, 2),
    center{[3.0, -1.0, 0]} scale{1.35} color{LEAF} Number(log2(y), 3)
]
mesh plane = Plane(fb, [-1, 0, 1, 2, 3], [1, 2, 3, 4, 5, 6, 7, 8])
mesh base = [
    Curve(fb, |x| 2 ^ x, -1.5, 3.16, AZURE),
    center{[3.0, 1.85, 0]} Math("y = 2^x", 0.85, AZURE),
    center{[3.0, 1.1, 0]} Note("height y", 0.74),
    center{[3.0, -0.45, 0]} Note("exponent x", 0.74)
]
mesh read = Read(y: 1)

slide "read"
    play Wait(0.6)
    read.y = 3
    play Lerp(2, [&read])
    play Wait(1.4)
    read.y = 8
    play Lerp(2, [&read])
    play Wait(1)
    read.y = 0.5
    play Lerp(2.4, [&read])
    play Wait(1.2)

Uses the shared definitions for this lesson's figures.

Two things have to be true for this reading-backwards to define a number. Some exponent must work, and only one must work. Here is the precise statement, for any base.

Half of this theorem is proved here and half is cited.

Both clauses matter. In the language of functions, “at most one” says $b^x$ is one-to-one, and “at least one” says its range is all of the positive numbers. Together they say that swapping inputs and outputs gives a function, defined on the positive numbers. That function gets a name.

So $\log_2 8 = 3$ because $2^3 = 8$, $\log_2 \frac12 = -1$ because $2^{-1} = \frac12$, and $\log_2 3 = 1.58496\ldots$ is the number we were hunting. A logarithm is an exponent. The definition says at once that the two operations undo each other:

$$ b^{\log_b y} = y \ \text{ for } y > 0, \qquad \log_b (b^x) = x \ \text{ for all real } x. $$

The exclusions are forced. Base 1 is useless because $1^x = 1$ for every $x$: the equation $1^x = 5$ has no solution and $1^x = 1$ has too many. And since $b^x$ is always positive, $\log_b 0$ and $\log_b(-4)$ do not exist.

The graphs of y = 2^x and y = \log_2 x. Each point of one is a point of the other with its coordinates swapped, so the two curves are mirror images in the dashed line y = x.
The graphs of $y = 2^x$ and $y = \log_2 x$. Each point of one is a point of the other with its coordinates swapped, so the two curves are mirror images in the dashed line $y = x$.
Monocurl source
let fm = Frame(-3, 8.5, -3, 8.5, [-1.55, 0.15, 0], 3.4, 3.4)
let PAIRS = [[0, 1], [1, 2], [2, 4], [3, 8]]
mesh plane = Plane(fm, [-2, 0, 2, 4, 6, 8], [-2, 0, 2, 4, 6, 8])
mesh mirror = Dash(at(fm, -3, -3), at(fm, 8.5, 8.5), SLATE, 2.5)
mesh links = map(PAIRS, |p| Seg(at(fm, p[0], p[1]), at(fm, p[1], p[0]), LEAF, 2))
mesh curves = [
    Curve(fm, |x| 2 ^ x, -3, 3.08, AZURE, 4),
    Curve(fm, |x| log2(x), 0.125, 8.5, EMBER, 4),
    map(PAIRS, |p| Pt(at(fm, p[0], p[1]), AZURE, 0.075)),
    map(PAIRS, |p| Pt(at(fm, p[1], p[0]), EMBER, 0.075))
]
mesh rows = block {
    . center{[1.75, 1.6, 0]} Math("y = 2^x", 0.85, AZURE)
    . center{[3.15, 1.6, 0]} Math("y = \log_2 x", 0.85, EMBER)
    . Seg([1.05, 1.28, 0], [3.9, 1.28, 0], MIST, 2)
    for (i in range(0, 4)) {
        let p = PAIRS[i]
        . center{[1.75, 0.85 - 0.55 * i, 0]} Math(str_join(["(", to_string(p[0]), ",\ ", to_string(p[1]), ")"]), 0.85, AZURE)
        . center{[3.15, 0.85 - 0.55 * i, 0]} Math(str_join(["(", to_string(p[1]), ",\ ", to_string(p[0]), ")"]), 0.85, EMBER)
    }
    . center{[2.45, -1.4, 0]} Note("coordinates swapped", 0.74)
}

Uses the shared definitions for this lesson's figures.

The mirror image carries every feature of the exponential across. The exponential has domain all real numbers and range $y > 0$, so the logarithm has domain $x > 0$ and range all real numbers. The exponential passes through $(0, 1)$ and $(1, b)$, so $\log_b 1 = 0$ and $\log_b b = 1$ for every base. And where $2^x$ doubles with each step of 1 to the right, $\log_2 x$ needs its input doubled to rise by 1, which makes it one of the slowest-growing functions you will meet: $\log_2 x$ does not reach 20 until $x$ passes a million.

The three laws

The table of powers of 2 can now be read as a table of logarithms: the top row is $\log_2$ of the bottom row. Our multiplication of $32 \times 128$ went $\log_2 32 + \log_2 128 = 5 + 7 = 12 = \log_2 4096$.

Pause and try

From the table, compute $\log_2 8 + \log_2 16$ and compare with $\log_2(8 \times 16)$. Then compare $\log_2 4096 - \log_2 64$ with $\log_2(4096 \div 64)$, and $4 \times \log_2 8$ with $\log_2(8^4)$. State the three rules you are seeing.

Show answerHide answer

$3 + 4 = 7$ and $8 \times 16 = 128 = 2^7$. $12 - 6 = 6$ and $4096 \div 64 = 64 = 2^6$. $4 \times 3 = 12$ and $8^4 = 4096 = 2^{12}$. The log of a product is the sum of the logs, the log of a quotient is the difference, and the log of a power is the exponent times the log.

These are the laws of exponents seen from the other side. Recall them for a base $b > 0$ and all real $x$, $y$, $r$: $b^x b^y = b^{x+y}$, $b^x / b^y = b^{x-y}$ and $(b^x)^r = b^{xr}$ (proved for rational exponents in the exponents lesson, and carried to real exponents by the limiting construction mentioned there).

Each line used uniqueness: to show that a number is $\log_b$ of something, it is enough to check that $b$ raised to it gives that something.

Changing the base

A calculator has two logarithm keys: log, which is $\log_{10}$, and ln, which is $\log_e$ for the number $e = 2.71828\ldots$ from the lesson on compound interest. There is no key for $\log_2$. We are stuck on $\log_2 3$ again unless one base can be converted to another.

Law 3 does it. Let $x = \log_2 3$, so $2^x = 3$. Take $\log_{10}$ of both sides: $\log_{10}(2^x) = x \log_{10} 2$, so $x \log_{10} 2 = \log_{10} 3$, and

$$ \log_2 3 = \frac{\log_{10} 3}{\log_{10} 2} \approx \frac{0.47712}{0.30103} \approx 1.58496. $$

The denominator $\log_c b$ does not depend on $u$. So $\log_b u$ is a fixed multiple of $\log_c u$: for example $\log_2 u = 3.3219 \times \log_{10} u$ for every $u > 0$, since $\frac{1}{\log_{10} 2} \approx 3.3219$. In terms of graphs, the logarithm functions with base above 1 are vertical stretches of one another (a base below 1 adds a flip in the $x$ axis, as Problem 5 shows).

The graphs of \log_2 x, \ln x and \log_{10} x. At every x the three heights are in the same proportions, here marked at x = 4 and x = 10: each curve is a vertical stretch of the others.
The graphs of $\log_2 x$, $\ln x$ and $\log_{10} x$. At every $x$ the three heights are in the same proportions, here marked at $x = 4$ and $x = 10$: each curve is a vertical stretch of the others.
Monocurl source
let fc = Frame(0, 10.8, -2, 3.7, [0.1, 0.1, 0], 6.4, 3.3)
let FS = [[|x| log2(x), AZURE], [|x| ln(x), PLUM], [|x| log10(x), EMBER]]
mesh plane = Plane(fc, [1, 2, 3, 4, 5, 6, 7, 8, 9, 10], [-2, -1, 0, 1, 2, 3])
mesh guides = [
    Dash(at(fc, 4, 0), at(fc, 4, 2), LEAF, 2.5),
    Dash(at(fc, 10, 0), at(fc, 10, log2(10)), LEAF, 2.5)
]
mesh curves = [
    Curve(fc, |x| log2(x), 0.25, 10.8, AZURE),
    Curve(fc, |x| ln(x), 0.136, 10.8, PLUM),
    Curve(fc, |x| log10(x), 0.0101, 10.8, EMBER, 4.5, 400),
    Pt(at(fc, 4, 2), AZURE, 0.085), Pt(at(fc, 4, ln(4)), PLUM, 0.085), Pt(at(fc, 4, log10(4)), EMBER, 0.085),
    Pt(at(fc, 10, log2(10)), AZURE, 0.085), Pt(at(fc, 10, ln(10)), PLUM, 0.085), Pt(at(fc, 10, 1), EMBER, 0.085)
]
mesh names = [
    center{at(fc, 7.3, 3.3)} Math("\log_2 x", 0.85, AZURE),
    center{at(fc, 7.3, 1.52)} Math("\ln x", 0.85, PLUM),
    center{at(fc, 7.3, 0.42)} Math("\log_{10} x", 0.85, EMBER)
]

Uses the shared definitions for this lesson's figures.

Since they differ only by a constant factor, which base to use is a matter of convenience. Base 2 suits doublings and computer memory, base $e$ suits calculus, and base 10 suits hand calculation in decimal notation, where it is called the common logarithm. From here on, $\log$ with no base means $\log_{10}$.

Tables and the slide rule

Now the astronomers’ book. It listed $\log u$ for every $u$ from 1 to 10 in small steps. That range is enough, because any positive number is a number between 1 and 10 times a power of 10, and law 1 handles the power of 10: $\log 299{,}792 = \log(2.99792 \times 10^5) = \log 2.99792 + 5$.

John Napier published the first such table in 1614, and Henry Briggs recomputed it in base 10 soon after. Within a decade someone had the idea of doing the addition mechanically, by placing lengths end to end.

  1. The 2 is printed at distance log 2, about 0.301, from the 1, and the 3 at distance log 3, about 0.477.
  2. Slide the top ruler until its 1 is over the 2 below. The two lengths now lie end to end.
  3. The 3 on top is now at distance log 2 + log 3 along the bottom ruler, about 0.778, and log 2 + log 3 = log 6. Under the 3 you read 6.
Why a slide rule multiplies. On each ruler the number $u$ is printed at distance $\log u$ from the 1, taking the length from 1 to 10 as the unit. Placing the length $\log 3$ after the length $\log 2$ reaches the mark at $\log 2 + \log 3 = \log 6$.
Monocurl source
let RY = 0.1
let L2 = DEC * log10(2)
let HI = RY + RH + 0.3
let LO = RY - RH - 0.35
mesh bottom = shift{[0, RY, 0]} Ruler(0)
mesh top = shift{delta: [0, RY, 0]} Ruler(1)
mesh span_b = []
mesh span_t = shift{delta: [0, 0, 0]} []
mesh total = []

slide "The 2 is printed at distance log 2, about 0.301, from the 1, and the 3 at distance log 3, about 0.477."
    span_b = [
        Span(pos(1), pos(2), LO, PLUM),
        center{[pos(2) + 2.8, LO, 0]} Math(str_join(["\log 2 \approx ", to_string(log10(2), 3)]), 0.82, PLUM)
    ]
    span_t = shift{delta: [0, 0, 0]} [
        Span(pos(1), pos(3), HI, EMBER),
        center{[pos(3) + 1.2, HI, 0]} Math(str_join(["\log 3 \approx ", to_string(log10(3), 3)]), 0.82, EMBER)
    ]
    play Fade(0.6)

slide "Slide the top ruler until its 1 is over the 2 below. The two lengths now lie end to end."
    top.delta = [L2, RY, 0]
    span_t.delta = [L2, 0, 0]
    play Lerp(1.8, [&top, &span_t])

slide "The 3 on top is now at distance log 2 + log 3 along the bottom ruler, about 0.778, and log 2 + log 3 = log 6. Under the 3 you read 6."
    total = [
        Seg([pos(6), RY - 0.34, 0], [pos(6), RY + 0.34, 0], LEAF, 4.5),
        Dash([pos(6), LO - 0.45, 0], [pos(6), RY - RH, 0], LEAF, 3),
        Dash([pos(6), RY + RH, 0], [pos(6), HI, 0], LEAF, 3),
        Span(pos(1), pos(6), LO - 0.45, LEAF),
        center{[pos(6) + 1.9, LO - 0.45, 0]} Math("\log 2 + \log 3 = \log 6", 0.82, LEAF)
    ]
    play Fade(0.6, [&total])

Uses the shared definitions for this lesson's figures.

That is the slide rule in the animation at the top of the page. Engineers carried one until electronic calculators replaced it in the 1970s.

Logarithmic scales

Calculators ended the use of logarithms for arithmetic and left their other use untouched. Some quantities range over so many powers of 10 that an ordinary axis cannot show them. The faintest sound you can hear and ordinary speech differ in intensity (power per unit area) by a factor of about a million.

Five sounds placed by intensity, measured in multiples of the faintest audible sound. On a linear axis four of them are crushed against zero. On a logarithmic axis, where each step to the right multiplies the intensity by 10, all five are spread out.
Five sounds placed by intensity, measured in multiples of the faintest audible sound. On a linear axis four of them are crushed against zero. On a logarithmic axis, where each step to the right multiplies the intensity by 10, all five are spread out.
Monocurl source
let TY = 1.0
let BY = -0.85
let X0 = -3.4
let W = 6.4
let SOUNDS = [["leaves", 1], ["whisper", 3], ["library", 4], ["rain", 5], ["speech", 6]]
mesh linear = block {
    . center{[X0 + 1.5, TY + 0.95, 0]} Note("intensity, linear axis", 0.74)
    . Tip([X0, TY, 0], [X0 + W + 0.4, TY, 0], SLATE, 2.5, 0.15)
    for (k in [0, 1, 2, 3, 4]) {
        . Seg([X0 + W * k / 4, TY - 0.09, 0], [X0 + W * k / 4, TY + 0.09, 0], SLATE, 2)
    }
    . center{[X0, TY - 0.36, 0]} Math("0", 0.74, SLATE)
    . center{[X0 + W / 2, TY - 0.36, 0]} Math("500{,}000", 0.74, SLATE)
    . center{[X0 + W - 0.2, TY - 0.36, 0]} Math("1{,}000{,}000", 0.74, SLATE)
    for (s in SOUNDS) {
        . Pt([X0 + W * 10 ^ s[1] / 1000000, TY, 0], EMBER, 0.09)
    }
    . center{[X0 + 0.75, TY + 0.4, 0]} Cap("the other four", 0.72, EMBER)
    . center{[X0 + W - 0.1, TY + 0.4, 0]} Cap("speech", 0.72, EMBER)
}
mesh logarithmic = block {
    . center{[X0 + 1.85, BY + 1.0, 0]} Note("intensity, logarithmic axis", 0.74)
    . Tip([X0, BY, 0], [X0 + W + 0.4, BY, 0], SLATE, 2.5, 0.15)
    for (k in range(0, 7)) {
        . Seg([X0 + W * k / 6, BY - 0.09, 0], [X0 + W * k / 6, BY + 0.09, 0], SLATE, 2)
        . center{[X0 + W * k / 6, BY - 0.38, 0]} Math(str_join(["10^", to_string(k)]), 0.74, SLATE)
        . center{[X0 + W * k / 6, BY - 0.88, 0]} Math(to_string(10 * k), 0.74, AZURE)
    }
    . center{[X0 + W + 0.38, BY - 0.88, 0]} Cap("dB", 0.72, AZURE)
    for (s in SOUNDS) {
        . Pt([X0 + W * s[1] / 6, BY, 0], EMBER, 0.09)
        . center{[X0 + W * s[1] / 6, BY + 0.4, 0]} Cap(s[0], 0.72, EMBER)
    }
}

Uses the shared definitions for this lesson's figures.

Placing a quantity on a logarithmic axis means plotting its logarithm, so equal distances stand for equal ratios. The decibel scale for sound is exactly this: a sound of intensity $I$ has level $10 \log\frac{I}{I_0}$ decibels, where $I_0$ is the faintest audible intensity. Speech, at a million times $I_0$, is $10 \log 10^6 = 60$ dB. Earthquake magnitude works the same way. It is the logarithm of the ground motion recorded by a standard seismograph, so one more unit of magnitude means ten times the shaking, and a magnitude 7 earthquake moves the ground 1000 times as much as a magnitude 4.

Pause and try

One machine produces 80 dB. By law 1, what is the level of two such machines running together? (The intensities add.) Guess before computing: 160 dB, or something else?

Show answerHide answer

Two machines give intensity $2I$, so the level is $10\log\frac{2I}{I_0} = 10\log 2 + 10\log\frac{I}{I_0} \approx 3 + 80 = 83$ dB. Doubling the intensity adds $10 \log 2 \approx 3.01$ dB whatever the starting level. Reaching 160 dB would take $10^8$ machines.

Where the laws stop

The laws convert products, quotients and powers. They say nothing about sums.

The hypotheses $u > 0$, $v > 0$ also matter. The expression $\log(x^2)$ makes sense for $x = -3$, where it equals $\log 9$, but $2 \log x$ does not, since $-3$ has no logarithm. Law 3 applies only where $\log x$ exists; the statement valid for every $x \neq 0$ is $\log(x^2) = 2\log|x|$. In the same way $\log\bigl((-2)(-5)\bigr) = \log 10 = 1$ exists while $\log(-2) + \log(-5)$ does not.

Stepping back: the hard step was the first one, deciding to call “the exponent that gives $y$” a number in its own right and checking that it is one, which needed the exponential to hit every positive value exactly once. After that, every property of logarithms was a property of exponents read in the other direction. Inverting a function and reading its laws backwards is a move you will make again, with square roots, with inverse trigonometric functions, and soon with $e^x$ and $\ln x$ in calculus.

Check yourself

Which of these equals $\log(1000x)$ for every $x > 0$? (Here $\log$ is base 10.)

Problems

Work these on paper before opening the solutions. A calculator is needed only where a decimal answer is asked for. The first three repeat the lesson’s moves, the next three combine them, and the last two go further.

Problem 1

Evaluate without a calculator: (a) $\log_2 64$, (b) $\log_3 \frac19$, (c) $\log_{10} 0.001$, (d) $\log_4 8$, (e) $\log_5 1$.

Show solutionHide solution

In each case find the exponent. (a) $2^6 = 64$, so 6. (b) $3^{-2} = \frac19$, so $-2$. (c) $10^{-3} = 0.001$, so $-3$. (d) We need $4^t = 8$; writing both as powers of 2, $2^{2t} = 2^3$, so $t = \frac32$. Check: $4^{3/2} = (\sqrt4)^3 = 8$. (e) $5^0 = 1$, so 0.

Problem 2

Given only $\log 2 \approx 0.3010$ and $\log 3 \approx 0.4771$ (base 10), find (a) $\log 6$, (b) $\log 5$, (c) $\log 12$, (d) $\log 1.5$, (e) $\log \sqrt{3}$.

Show solutionHide solution

(a) $\log 6 = \log 2 + \log 3 \approx 0.7781$. (b) $5 = \frac{10}{2}$, so $\log 5 = \log 10 - \log 2 = 1 - 0.3010 = 0.6990$. (c) $12 = 2^2 \times 3$, so $\log 12 = 2(0.3010) + 0.4771 = 1.0791$. (d) $\log\frac32 = 0.4771 - 0.3010 = 0.1761$. (e) $\sqrt3 = 3^{1/2}$, so $\log\sqrt3 = \frac12(0.4771) \approx 0.2386$.

Problem 3

Solve $3^x = 20$ to three decimal places, and check your answer.

Show solutionHide solution

Take common logarithms: $x \log 3 = \log 20$, so $x = \frac{\log 20}{\log 3} \approx \frac{1.30103}{0.47712} \approx 2.727$. Check: $3^2 = 9$ and $3^3 = 27$, so the exponent must lie between 2 and 3, nearer 3; and a calculator gives $3^{2.727} \approx 20.00$.

Problem 4

A concert measures 105 dB and a busy street 75 dB. How many times as intense is the sound at the concert? What decibel level is 50 times as intense as the street?

Show solutionHide solution

The levels differ by 30 dB, so $10\log\frac{I_1}{I_0} - 10\log\frac{I_2}{I_0} = 30$. By law 2 the left side is $10\log\frac{I_1}{I_2}$, so $\log\frac{I_1}{I_2} = 3$ and the ratio is $10^3 = 1000$. For the second part, multiplying the intensity by 50 adds $10\log 50 = 10(\log 100 - \log 2) \approx 10(2 - 0.3010) = 16.99$ dB, giving about 92 dB.

Problem 5

Let $b > 0$, $b \neq 1$ and $u > 0$. Prove that (a) $\log_b \frac1u = -\log_b u$, and (b) $\log_{1/b} u = -\log_b u$. What does (b) say about the graphs of $\log_2 x$ and $\log_{1/2} x$?

Show solutionHide solution

(a) By law 2, $\log_b\frac1u = \log_b 1 - \log_b u = 0 - \log_b u$. (b) By change of base with $c = b$, $\log_{1/b} u = \frac{\log_b u}{\log_b (1/b)}$, and $\log_b\frac1b = -\log_b b = -1$ by part (a). So $\log_{1/b} u = -\log_b u$. (The base $\frac1b$ is allowed: it is positive and not 1.) For the graphs: $\log_{1/2} x = -\log_2 x$, so each is the mirror image of the other in the $x$ axis. A logarithm with base less than 1 is a decreasing function.

Problem 6

How many digits does $2^{100}$ have? First explain why a whole number $N \geq 1$ has $\lfloor \log N \rfloor + 1$ digits, where $\lfloor t \rfloor$ means $t$ rounded down to a whole number.

Show solutionHide solution

A whole number with $d$ digits satisfies $10^{d-1} \le N < 10^d$. Because $\log$ is increasing, this is the same as $d - 1 \le \log N < d$, which says $\lfloor\log N\rfloor = d - 1$. So $d = \lfloor\log N\rfloor + 1$. For $N = 2^{100}$, law 3 gives $\log N = 100\log 2 \approx 30.103$, so $N$ has $30 + 1 = 31$ digits. (Indeed $2^{100} = 1{,}267{,}650{,}600{,}228{,}229{,}401{,}496{,}703{,}205{,}376$.)

Problem 7

Find the error in this argument. “We know $\frac14 > \frac18$, that is, $\left(\frac12\right)^2 > \left(\frac12\right)^3$. Take logarithms: $2\log\frac12 > 3\log\frac12$. Divide both sides by $\log\frac12$: $2 > 3$.”

Show solutionHide solution

Every step is correct except the last. Taking logarithms preserves the inequality because $\log$ is increasing, and law 3 is applied correctly. But $\log\frac12 = -\log 2 \approx -0.301$ is negative, and dividing an inequality by a negative number reverses it. Done correctly the last step gives $2 < 3$. As a check, the middle line says $-0.602 > -0.903$, which is true.

Problem 8

Prove that $\log_2 3$ is irrational, that is, not equal to any fraction $\frac{p}{q}$ of whole numbers.

Show solutionHide solution

Suppose $\log_2 3 = \frac{p}{q}$ with $p$ and $q$ whole numbers and $q > 0$. Since $\log_2 3 > \log_2 1 = 0$, also $p > 0$. By definition $2^{p/q} = 3$, and raising both sides to the power $q$ gives $2^p = 3^q$. The left side is even, because $p \ge 1$. The right side is a product of 3s, which is odd. An even number cannot equal an odd one, so no such fraction exists. This is why the halving search for $\log_2 3$ never ended: it was closing in on a number that no fraction reaches.

Shared definitions used by this lesson's figures
# house kit: prepended to every essay figure after the std imports

# palette. AZURE and EMBER are the two actors, LEAF marks an answer, ROSE a problem
let PAPER = [1, 1, 1, 1]
let INK = [0.08, 0.09, 0.11, 1]
let SLATE = [0.40, 0.44, 0.50, 1]
let MIST = [0.85, 0.86, 0.88, 1]
let AZURE = [0.13, 0.42, 0.68, 1]
let EMBER = [0.89, 0.42, 0.12, 1]
let LEAF = [0.13, 0.55, 0.36, 1]
let ROSE = [0.78, 0.22, 0.24, 1]
let PLUM = [0.47, 0.30, 0.66, 1]
let GOLD = [0.85, 0.62, 0.08, 1]

background = PAPER

# an opaque pastel of col; use for fills so overlaps do not darken
let tint = |col, amount = 0.18| [
    1 - (1 - col[0]) * amount,
    1 - (1 - col[1]) * amount,
    1 - (1 - col[2]) * amount,
    1
]

# text: Cap for labels, Note for quiet labels, Math for typeset maths
let Cap = |txt, size = 0.75, col = INK| color{col} Text(txt, size, "Charter")
let Note = |txt, size = 0.65| color{SLATE} Text(txt, size, "Charter")
let Math = |tex, size = 0.9, col = INK| color{col} Tex(tex, size)

# a paper rectangle to sit behind text that crosses lines
let Plate = |pos, size| center{pos} fill{PAPER} stroke{alpha{0} PAPER, 0} Rect(size)

# shapes with fill and stroke both set, so no stray black appears
let Pt = |pos, col = INK, r = 0.075| center{pos} fill{col} stroke{col, 1} Circle(r, 48)
let Ring = |pos, col = INK, r = 0.1, w = 3| center{pos} fill{PAPER} stroke{col, w} Circle(r, 48)
let Seg = |a, b, col = INK, w = 3| stroke{col, w} Line(a, b)
let Path = |pts, col = INK, w = 3| stroke{col, w} Polyline(pts)
let Region = |pts, col| fill{col} stroke{alpha{0} col, 0} Polygon(pts)
let Outline = |pts, col = INK, w = 3| fill{alpha{0} PAPER} stroke{col, w} Polygon(pts)
let Shape = |pts, col, amount = 0.18, w = 3| fill{tint(col, amount)} stroke{col, w} Polygon(pts)
let Disc = |pos, r, col, amount = 0.18, w = 3| center{pos} fill{tint(col, amount)} stroke{col, w} Circle(r, 96)
let Box = |pos, size, col, amount = 0.18, w = 3| center{pos} fill{tint(col, amount)} stroke{col, w} Rect(size)
# a line from a to b ending in a small solid arrowhead
let Tip = |a, b, col = INK, w = 3, head = 0.17| {
    let d = normalize([b[0] - a[0], b[1] - a[1], 0])
    let n = [-d[1], d[0], 0]
    let base = [b[0] - d[0] * head, b[1] - d[1] * head, 0]
    return [
        stroke{col, w} Line(a, base),
        fill{col} stroke{col, 1} Polygon([
            b,
            [base[0] + n[0] * head * 0.42, base[1] + n[1] * head * 0.42, 0],
            [base[0] - n[0] * head * 0.42, base[1] - n[1] * head * 0.42, 0]
        ])
    ]
}

# plots. a frame is [x0, x1, y0, y1, centre, width, height]: a data window and the scene box it fills
let Frame = |x0, x1, y0, y1, c = [0, 0, 0], w = 6.4, h = 3.6| [x0, x1, y0, y1, c, w, h]
let fx = |fr, x| fr[4][0] + (x - (fr[0] + fr[1]) / 2) * fr[5] / (fr[1] - fr[0])
let fy = |fr, y| fr[4][1] + (y - (fr[2] + fr[3]) / 2) * fr[6] / (fr[3] - fr[2])
let at = |fr, x, y| [fx(fr, x), fy(fr, y), 0]

# axes through the data origin (or the nearest edge of the window), with optional names
let Axes = |fr, x_name = "", y_name = "", col = SLATE| {
    let ox = clamp(fr[0], 0, fr[1])
    let oy = clamp(fr[2], 0, fr[3])
    var parts = [
        Tip(at(fr, fr[0], oy), [fx(fr, fr[1]) + 0.25, fy(fr, oy), 0], col, 2.5, 0.15),
        Tip(at(fr, ox, fr[2]), [fx(fr, ox), fy(fr, fr[3]) + 0.25, 0], col, 2.5, 0.15)
    ]
    if (x_name != "") {
        parts .= center{[fx(fr, fr[1]) + 0.5, fy(fr, oy), 0]} Math(x_name, 0.8, col)
    }
    if (y_name != "") {
        parts .= center{[fx(fr, ox), fy(fr, fr[3]) + 0.5, 0]} Math(y_name, 0.8, col)
    }
    return parts
}

# tick marks with numbers at the listed data values
let XTicks = |fr, xs, col = SLATE, places = 0| block {
    let oy = fy(fr, clamp(fr[2], 0, fr[3]))
    for (x in xs) {
        . Seg([fx(fr, x), oy - 0.07, 0], [fx(fr, x), oy + 0.07, 0], col, 2)
        . center{[fx(fr, x), oy - 0.33, 0]} Math(to_string(x, places), 0.72, col)
    }
}
let YTicks = |fr, ys, col = SLATE, places = 0| block {
    let ox = fx(fr, clamp(fr[0], 0, fr[1]))
    for (y in ys) {
        . Seg([ox - 0.07, fy(fr, y), 0], [ox + 0.07, fy(fr, y), 0], col, 2)
        . center{[ox - 0.36, fy(fr, y), 0]} Math(to_string(y, places), 0.72, col)
    }
}

# faint grid lines at the listed data values
let GridLines = |fr, xs, ys, col = MIST| block {
    for (x in xs) {
        . Seg(at(fr, x, fr[2]), at(fr, x, fr[3]), col, 1.5)
    }
    for (y in ys) {
        . Seg(at(fr, fr[0], y), at(fr, fr[1], y), col, 1.5)
    }
}

# the graph of f over [a, b], drawn in the frame. values are clamped to the window
let Graph = |fr, f, a, b, col = AZURE, w = 4, n = 160|
    stroke{col, w} Polyline(map(sample(a, b, n), |x| at(fr, x, clamp(fr[2], f(x), fr[3]))))

# the region between the graph of f and the x axis over [a, b]
let AreaUnder = |fr, f, a, b, col = AZURE, amount = 0.2, n = 80| {
    var pts = [at(fr, a, 0)]
    for (x in sample(a, b, n)) {
        pts .= at(fr, x, clamp(fr[2], f(x), fr[3]))
    }
    pts .= at(fr, b, 0)
    return fill{tint(col, amount)} stroke{alpha{0} col, 0} Polygon(pts)
}

# grid, axes through the origin, tick numbers along the bottom and left edges, axis names by the arrows
let Plane = |fr, xs, ys, x_name = "x", y_name = "y"| {
    let oy = clamp(fr[2], 0, fr[3])
    let ox = clamp(fr[0], 0, fr[1])
    var out = [
        GridLines(fr, xs, ys),
        Tip(at(fr, fr[0], oy), [fx(fr, fr[1]) + 0.25, fy(fr, oy), 0], SLATE, 2.5, 0.15),
        Tip(at(fr, ox, fr[2]), [fx(fr, ox), fy(fr, fr[3]) + 0.25, 0], SLATE, 2.5, 0.15),
        center{[fx(fr, fr[1]) + 0.45, fy(fr, oy), 0]} Math(x_name, 0.8, SLATE),
        center{[fx(fr, ox) + 0.3, fy(fr, fr[3]) + 0.2, 0]} Math(y_name, 0.8, SLATE)
    ]
    for (x in xs) {
        out .= center{[fx(fr, x), fy(fr, fr[2]) - 0.27, 0]} Math(to_string(x), 0.72, SLATE)
    }
    for (y in ys) {
        out .= center{[fx(fr, fr[0]) - 0.3, fy(fr, y), 0]} Math(to_string(y), 0.72, SLATE)
    }
    return out
}
# the graph of f over [a, b], keeping only the part inside the window
let Curve = |fr, f, a, b, col = AZURE, w = 4.5, n = 140|
    stroke{col, w} Polyline(filter(
        map(sample(a, b, n), |x| at(fr, x, f(x))),
        |p| p[1] <= fy(fr, fr[3]) + 0.001 and p[1] >= fy(fr, fr[2]) - 0.001
    ))
let Dash = |a, b, col = SLATE, w = 2.5| stroke{col, w} dashed{[0.1, 0.08]} Line(a, b)

# slide rule: the number u is printed at distance DEC * log10(u) from the 1
let DEC = 3.4
let pos = |u| -3.5 + DEC * log10(u)
# height of a ruler body
let RH = 1.25
# a ruler with its ticks on the line y = 0. top = 1: one decade, body above the line. top = 0: two decades, body below
let Ruler = |top| {
    let dir = 2 * top - 1
    var col = SLATE
    var hi = 100
    var labels = [1, 2, 3, 4, 5, 6, 8, 10, 20, 30, 40, 60, 100]
    var ticks = [1.5, 2.5, 3.5, 4.5, 7, 9, 15, 25, 35, 45, 50, 70, 80, 90]
    if (top > 0.5) {
        col = AZURE
        hi = 10
        labels = [1, 2, 3, 4, 5, 6, 8, 10]
        ticks = [1.5, 2.5, 3.5, 4.5, 7, 9]
    }
    var out = [Shape([[pos(1) - 0.2, 0, 0], [pos(hi) + 0.3, 0, 0], [pos(hi) + 0.3, dir * RH, 0], [pos(1) - 0.2, dir * RH, 0]], col, 0.13, 2.5)]
    for (t in ticks) {
        out .= Seg([pos(t), 0, 0], [pos(t), dir * 0.16, 0], col, 2)
    }
    for (t in labels) {
        out .= Seg([pos(t), 0, 0], [pos(t), dir * 0.3, 0], col, 2.5)
        out .= center{[pos(t), dir * 0.72, 0]} Math(to_string(t), 0.85, INK)
    }
    return out
}
# a measured length from x0 to x1 at height y
let Span = |x0, x1, y, col| [
    Seg([x0, y, 0], [x1, y, 0], col, 4),
    Seg([x0, y - 0.1, 0], [x0, y + 0.1, 0], col, 3),
    Seg([x1, y - 0.1, 0], [x1, y + 0.1, 0], col, 3)
]