Lines, Functions and Graphs defined an inverse function: g undoes f when g(f(x)) = x and f(g(x)) = x, and a function has one only if it is one-to-one. f(x) = b^x is strictly increasing when b > 1 and strictly decreasing when 0 < b < 1, so it never repeats a value and the inverse exists without any restriction of the domain — which is unusual, and is why logarithms are as well-behaved as they are.
Definition · Logarithmic functionFor b > 0 with b ≠ 1, the logarithmic function with base b is g(x) = log_b(x), defined for x > 0. It is the inverse of f(x) = b^x: log_b(b^x) = x for every real x, and b^(log_b(x)) = x for every x > 0.
f(x) = 2^x g(x) = log_2(x)
x f(x) x g(x)
−3 1/8 1/8 −3
−2 1/4 1/4 −2
−1 1/2 1/2 −1
0 1 1 0
1 2 2 1
2 4 4 2
3 8 8 3
the same seven pairs, with the two columns exchanged
What to read off the graph
- Domain x > 0. There is no curve at all to the left of the vertical axis, and none on it.
- Range: every real number. The curve has no ceiling and no floor; each height is reached exactly once.
- Through (1, 0). b^0 = 1 for every allowed base, so log_b(1) = 0. Every logarithmic curve crosses the horizontal axis at 1, whatever the base.
- Through (b, 1). b^1 = b. This is the point that tells two bases apart on a drawing.
- No vertical intercept. x = 0 is outside the domain, so the curve never meets the vertical axis.
- Increasing for b > 1, decreasing for 0 < b < 1. The direction is inherited from the exponential it reflects.
It rises without bound, and it rises slowly
Both halves of that sentence matter. To lift log_10(x) by one you must multiply x by ten, so the output crawls while the input explodes. But there is no height it fails to reach eventually.
x 1 10 100 1000 10⁶ 10¹⁰⁰
log_10(x) 0 1 2 3 6 100
the input is multiplied by 10 to move the output by 1
That last line is the reason decibels, pH and earthquake magnitude are logarithms, which is “Logarithmic Scales”. It is also why a logarithmic curve looks flat on any drawing wide enough to be interesting — flat is not level, and the two are easy to confuse by eye.
Shifting the curve moves the asymptote with it
log_b(x − h) is the same curve moved h to the right, and the asymptote goes with it to x = h. The domain becomes x > h. This is the commonest source of a wrong domain in the whole course, because the shift is invisible unless you look inside the brackets.
Example · y = log_3(x − 5)The argument must be positive: x − 5 > 0, so the domain is x > 5 and the asymptote is the vertical line x = 5. The curve passes through (6, 0), because x − 5 = 1 there and log_3(1) = 0, and through (8, 1), because x − 5 = 3 and log_3(3) = 1. It is the standard shape, five units to the right.
One case worth having met early: the domain is decided by the argument being positive, not by x being positive. log_2(x²) is defined for every x ≠ 0, negative values included, because x² is positive there. “The Laws of Logarithms” shows why that makes one of the three laws need a careful statement.