A power answers “what is 2 to the power 3?”. The logarithm asks the question the other way round: “2 to what power gives 8?”. The answer, 3, is the logarithm of 8 in base 2. A logarithm is an exponent, and every rule follows from that. The base b is a positive number other than 1, and only positive numbers have a logarithm (the Special cases section explains why).
The logarithm question
The powers of the base
Logarithmic scale
On a logarithmic scale, each step of the same size multiplies instead of adding. That is how things that vary by orders of magnitude are measured, such as earthquake magnitude on the Richter scale and acidity on the pH scale, and it is the scale of many data charts, such as GDP, prices or cases in an epidemic.
Rules
Since a logarithm is an exponent, each rule is a rule of exponents read backwards: the product becomes a sum, the quotient becomes a difference, the power becomes a multiplication. The controls below (base b, numbers x and y, exponent k) apply to every card.
For the rules to hold: the bases are positive and other than 1, and the numbers whose logarithm is taken (x and y) are positive. The exponent k can be any real number, negative included. The controls only offer values that meet these conditions.
Logarithm of a product
holds
This is the idea behind the invention of logarithms. John Napier published them in 1614, in the book Mirifici logarithmorum canonis descriptio, to spare people who did long calculations: with a table of logarithms, a hard multiplication turns into a sum. In 1620, Edmund Gunter marked a logarithmic scale on a ruler, and in 1630 William Oughtred created a circular slide rule, one of the first: sliding logarithmic scales adds the logarithms and therefore multiplies the numbers.
Logarithm of a quotient
holds
Logarithm of a power
holds
Change of base
holds
It works with any other base in place of e or 10, as long as it is positive and other than 1: . The denominator is never zero, because b ≠ 1.
Logarithm and power undo each other
holds
Traps: what does not hold
The logarithm turns a product into a sum, but there is no rule for a sum, and dividing logarithms is not the same as dividing the numbers. Drag the values and try to make both sides equal: with the whole numbers of the controls, the sum only matches at x = y = 2 (because 2 + 2 = 2 · 2), and the division in two isolated cases.
Logarithm of a sum
does not hold
Dividing logarithms
does not hold
Special cases and notation
Because b⁰ = 1 in every base.
Because b¹ = b.
They do not exist in the real numbers: no power of a positive base gives zero or a negative number. The domain of the logarithm is the positive numbers.
On calculators and in high-school books, log without a base is base 10, the common logarithm. For a positive whole number, the whole part of log₁₀ is the number of digits minus one: log 500 ≈ 2.699, and 500 has 3 digits. Careful: in Julia, R and Python, log(x) is the natural logarithm (ln), and base 10 is log10(x).
The natural logarithm, in base e ≈ 2.718 (in Portuguese). It is the standard in calculus and statistics.
In computing, base 2 is the most common. log₂ 8 = 3: 8 can be halved 3 times before reaching 1, and 3 bits number 8 possibilities. For 1,000 possibilities, log₂ 1000 ≈ 9.97, and 10 bits are needed (round up).
What about the base? It must be positive and other than 1. Other than 1 because 1 to any power is 1, so log₁ 5 would have no answer. Positive because, with a negative base, many powers do not even exist in the reals: (−2)1/2 would be √−2.
How long until it doubles?
When the unknown is in the exponent (“in how many years does the investment double?”, “when does the population reach a million?”), only the logarithm can bring it down.
Examples:
Step by step
Logarithms in statistics
Skewed data. Income, prices and times often have a long right tail: many small values and a few huge ones. Taking the logarithm pulls the tail in, and the data often become more symmetric, sometimes close to the normal that many methods assume. It is not guaranteed: when the logarithm of the data follows the normal, the data follow the log-normal distribution.
Products become sums. The probability of several independent observations is the product of the probabilities of each one, and the product of many small numbers soon gets so small that the computer rounds it to zero. The logarithm turns the product into a sum of reasonably sized numbers. This is the log-likelihood, used to estimate parameters by maximum likelihood.
Relative changes. On a log-scale chart, growing 10% is always the same distance, whether the quantity is 100 or 1 million. That is why a series that grows at a constant percentage rate becomes a straight line.
Worked example
The numbers in this example are made up to keep the arithmetic simple. A town has 50,000 inhabitants, and the population grows 2% a year. If that pace holds, in how many years will it reach 80,000 inhabitants?
Data (from the problem): initial population P₀ = 50,000 inhabitants; growth rate r = 2% a year = 0.02; target population P = 80,000 inhabitants.
Formula. Growing 2% a year means multiplying by 1 + 0.02 = 1.02 every year. After t years, the population is
where P₀ is the initial population, r the yearly rate (as a decimal) and t the number of years.
Substitution.
Calculation. Divide both sides by 50,000:
The t is in the exponent. Take the natural logarithm of both sides and use the power rule, which brings the exponent down:
Divide both sides by ln 1.02 and read both logarithms on a calculator (ln key):
Check with the neighbouring whole years: 50,000 · 1.02²³ ≈ 78,845 and 50,000 · 1.02²⁴ ≈ 80,422. The 80,000 falls between them.
Result:t ≈ 23.73 years (rounded to two decimal places). Counting whole years, the population passes 80,000 during the 24th year.
Interpretation. At 2% a year, the town takes almost 24 years to grow 60%: the population is multiplied by 1.6, and the logarithm counts how many multiplications by 1.02 that takes. The answer only holds while the model holds: the calculation assumes the same rate every year, and a real population changes pace (migration, birth rate). Notice also that adding 2% of 50,000 (1,000 people) each year would take 30 years; the difference comes from the 2% applying to an ever larger population.
Test yourself
1. Find log₂ 32 and log₃ 81.
Show answer
2⁵ = 32, so log₂ 32 = 5. 3⁴ = 81, so log₃ 81 = 4.
2. What is log₁₀ 0.001?
Show answer
0.001 = 1/1000 = 10⁻³, so the logarithm is −3. A negative logarithm means a number between 0 and 1.
3. Without a calculator: log 2 + log 5.
Show answer
By the product rule, log 2 + log 5 = log (2 · 5) = log 10 = 1.
4. Solve 2ˣ = 50.
Show answer
Taking the logarithm of both sides: x · log 2 = log 50, so x = log 50 / log 2 ≈ 1.699 / 0.301 ≈ 5.64 (with all decimal places, 5.6439). Check: 50 lies between 2⁵ = 32 and 2⁶ = 64.
5. An investment earns 6% a year. In how many years does it double?
Show answer
With interest compounded once a year, 1.06t = 2, and t = ln 2 / ln 1.06 ≈ 0.6931 / 0.0583 ≈ 11.9 years. Since the interest is added at the end of each year, the value doubles at the end of the 12th year. The rule of 72 gives 72 ÷ 6 = 12.
6. How many digits does 2¹⁰⁰ have?
Show answer
log 2¹⁰⁰ = 100 · log 2 ≈ 100 × 0.30103 = 30.103. A number whose log lies between 30 and 31 is between 10³⁰ and 10³¹, so it has 31 digits.
References
Abramson, J. (2021). College Algebra 2e. OpenStax. Sections 6.3, “Logarithmic Functions” (definition with b > 0, b ≠ 1 and x > 0; common and natural logarithm; the Richter scale), 6.5, “Logarithmic Properties” (product, quotient and power rules, change of base; pH) and 6.6, “Exponential and Logarithmic Equations” (solving equations by taking the logarithm of both sides). openstax.org
O’Connor, J. J. and Robertson, E. F. John Napier. MacTutor History of Mathematics Archive, University of St Andrews (last updated April 1998): the publication of logarithms in 1614 and the aim of replacing multiplication and division with addition and subtraction. mathshistory.st-andrews.ac.uk
O’Connor, J. J. and Robertson, E. F. William Oughtred. MacTutor History of Mathematics Archive, University of St Andrews (last updated February 2017): Gunter’s logarithmic scale on a ruler (1620) and Oughtred’s circular slide rule (1630). mathshistory.st-andrews.ac.uk
The rules on this page, with the same hypotheses as the text, the traps and the answers to the exercises are proved in the Lean proof assistant (provas/Provas/Logaritmos.lean, in the site’s repository). The cards were checked by computer against high-precision arithmetic, for every combination of the controls.