Logarithms, explained with examples
A logarithm answers the question: what power do I need? Logs undo exponentials, which makes them essential for solving equations, modelling growth and decay, and turning curves into straight lines.
On this page
What a logarithm is
loga b = c means ac = b. In words: the logarithm of b to base a is the power you raise a to in order to get b. So log2 8 = 3 because 2³ = 8, and log10 1000 = 3 because 10³ = 1000.
Some values to know immediately: loga a = 1, loga 1 = 0, and loga (ax) = x. You can only take logs of positive numbers, and the base a must be positive and not equal to 1.
The laws of logarithms
- loga x + loga y = loga(xy)
- loga x − loga y = loga(x/y)
- k loga x = loga(xk)
These come straight from the laws of indices: multiplying powers adds the exponents, so logs of products become sums. Note what the laws do not say: log(x + y) is not log x + log y, and log x / log y is not log(x/y).
Natural logarithms
The natural logarithm, ln x, is the log to base e, where e ≈ 2.718. It is the inverse of ex: ln(ex) = x and eln x = x. The function ex is special because its gradient equals its value, which is why it appears in natural growth and decay and throughout calculus.
Worked examples
Example 1: evaluating
Find log3 81 and log4 2 without a calculator.
- 34 = 81, so log3 81 = 4.
- 41/2 = 2, so log4 2 = 1/2.
Example 2: combining logs
Write 2 log 5 + log 4 − log 2 as a single logarithm.
- 2 log 5 = log 25. Then log 25 + log 4 − log 2 = log(25 × 4 / 2).
- = log 50.
Example 3: an exponential equation
Solve 5x = 40, to 3 significant figures.
- Take logs: x log 5 = log 40, so x = log 40 / log 5.
- x ≈ 2.29.
Example 4: unknowns on both sides
Solve 32x − 1 = 2x + 1.
- Take logs: (2x − 1) ln 3 = (x + 1) ln 2.
- x(2 ln 3 − ln 2) = ln 2 + ln 3, so x = ln 6/ln 4.5.
- x ≈ 1.19.
Example 5: a hidden quadratic
Solve 4x − 6 × 2x + 8 = 0.
- Let u = 2x, so 4x = u²: u² − 6u + 8 = 0, giving u = 2 or 4.
- 2x = 2 gives x = 1; 2x = 4 gives x = 2. x = 1 or x = 2.
Example 6: a log equation
Solve log2(x + 3) + log2(x − 3) = 4.
- Combine: log2(x² − 9) = 4, so x² − 9 = 16 and x = ±5.
- x = −5 makes the logs undefined, so x = 5. Always check solutions in the original equation.
Example 7: natural logs
Solve e2x = 7, and solve ln(3x) = 2.
- 2x = ln 7, so x = ½ ln 7 ≈ 0.973.
- 3x = e², so x = e²/3 ≈ 2.46.
Exponential models
Many real quantities grow or decay by a constant factor over equal time intervals, such as money with compound interest, bacteria in a culture or the temperature difference of a cooling drink. These are modelled by N = N0ekt, with k positive for growth and negative for decay. Logs let you find the time to reach a value: for example, the time for a quantity to double is ln 2/k. Questions often finish by asking you to criticise the model, such as noting that real growth cannot continue for ever.
Graphs of logs and exponentials
y = ex passes through (0, 1), is always positive and has the x-axis as an asymptote. y = ln x is its reflection in the line y = x: it passes through (1, 0), is defined only for x > 0, and has the y-axis as an asymptote. Every log graph y = loga x with a > 1 has the same shape and passes through (1, 0).
Using logs to find straight lines
A favourite A level question gives experimental data and asks you to find a model. Logs turn two kinds of curve into straight lines:
- y = axn: taking logs gives log y = n log x + log a. Plot log y against log x: the gradient is n and the intercept is log a.
- y = kbx: taking logs gives log y = x log b + log k. Plot log y against x: the gradient is log b and the intercept is log k.
Example 8: finding a model
A graph of log10 y against x is a straight line through (0, 0.3) with gradient 0.2. Find the model y = kbx.
- log k = 0.3, so k = 100.3 ≈ 2.00. log b = 0.2, so b = 100.2 ≈ 1.58.
- y ≈ 2.00 × 1.58x.
Common mistakes
- Writing log(x + y) = log x + log y.
- Forgetting that logs of zero or negative numbers are undefined, and keeping invalid solutions.
- Dropping brackets: (2x − 1) ln 3 is not 2x − 1 ln 3.
- Mixing up the two straight-line models and their axes.
Practice questions
Try each one before opening the answer.
Q1. Evaluate log5 125.
Show answer
Q2. Solve 2x = 50 to 3 s.f.
Show answer
Q3. Simplify log 8 + log 5 − log 4.
Show answer
Q4. Solve ln x + ln(x + 1) = ln 6.
Show answer
Q5. Solve ex = 3e−x.
Show answer
Frequently asked questions
Are logarithms in AS or A level Maths?
Logarithms, exponentials and the straight-line models are in the first year of A level Maths for all the main boards.
Are logarithms in AP Calculus?
AP Calculus uses ln x and ex constantly, especially their derivatives and integrals. Precalculus covers the log laws in depth.
Key takeaways
- loga b = c means ac = b.
- Product, quotient and power laws come from the laws of indices.
- ln is the inverse of ex.
- Take logs of both sides to solve for an unknown power.
- Logs turn y = axn and y = kbx into straight lines.