GUIDE 03

Logarithms Explained: log, ln, Change of Base and Worked Examples

How to enter log, ln and base-a logs with log(a, x), the change-of-base formula, log rules, and worked pH, decibel, compound interest and half-life examples, plus domain errors.

A logarithm undoes exponentiation. Since 10³ = 1000, log₁₀ 1000 = 3: it answers "how many times must I multiply to reach this number?" Science and engineering use logarithms to compress quantities that span huge ranges, such as hydrogen ion concentration, sound intensity and earthquake energy, into manageable numbers. This guide covers SciKey's log functions, change of base, the log rules and practical examples.

1. Log functions in SciKey

InputMeaningExample
log(x)Common log (base 10)log(1000) = 3
ln(x)Natural log (base e ≈ 2.71828)ln(e^2) = 2
log(a, x)Log of x to base a, logₐxlog(2, 8) = 3
log2(x)Base-2 loglog2(1024) = 10

In log(a, x) the base comes first, the same order Casio calculators use. log(2, 8) is log₂8 = 3, while log(8, 2) is log₈2 = 0.333333333333 (= 1/3). Spreadsheet LOG functions take LOG(number, base), the opposite order, so be careful when copying formulas across.

The inverses are 10^x and e^x (or exp(x)). 10^(log(7)) returns 7.

2. Change of base

Any base can be computed with a single log function:

logₐx = ln x / ln a = log x / log a

Example: log₂1000 = ln(1000)/ln(2) = 9.96578428466, the same as log(2, 1000). It also tells you that 1000 needs 10 bits in binary (2⁹ = 512 < 1000 < 1024 = 2¹⁰).

Keep each log in its own brackets. ln(1000)/ln(2) is fine; log 1000/log 2 has no function brackets and is rejected as invalid input.

3. Log rules

RuleFormulaCheck
Productlog(ab) = log a + log blog(20) = log 2 + log 10 = 1.30103
Quotientlog(a/b) = log a − log blog(0.5) = −0.30103
Powerlog(aⁿ) = n log alog(2¹⁰) = 10 × 0.30103 = 3.0103
Log of 1log 1 = 0Any base
Log of the baselogₐa = 1ln e = 1

Useful values for mental estimates: log 2 ≈ 0.30103, log 3 ≈ 0.47712, ln 2 ≈ 0.693147, ln 10 ≈ 2.302585.

4. Example 1: pH

pH = −log[H⁺], where [H⁺] is the hydrogen ion concentration in mol/L.

  • [H⁺] = 3.2×10⁻⁴ mol/L → -log(3.2E-4) = 3.49485002168
  • Going back, a solution of pH 3.5 has 10^-3.5 = 3.16227766017×10⁻⁴ mol/L

Each unit drop in pH means ten times more hydrogen ions: pH 3 has 100 times more than pH 5.

In -log(...) the minus sign applies to the whole log, because function calls are evaluated before unary signs.

5. Example 2: decibels

  • Power ratio: dB = 10 log(P₂/P₁). A 200× power gain → 10log(200) = 23.0102999566 dB
  • Voltage or sound pressure ratio: dB = 20 log(V₂/V₁). A 5× voltage gain → 20log(5) = 13.9794000867 dB
  • 3 dB is about double the power: 10log(2) = 3.01029995664

The factor of 10 for power versus 20 for amplitude trips many people up. Power is proportional to the square of amplitude, and log(V²) = 2 log V, hence 20.

6. Example 3: doubling time with compound interest

At 5% annual compound interest, the doubling time n solves 1.05ⁿ = 2:

n = ln 2 / ln 1.05 → ln(2)/ln(1.05) = 14.2066990829 years

log(1.05, 2) gives the same result. The familiar rule of 72 (72 ÷ 5 = 14.4 years) is an approximation of this value.

7. Example 4: half-life

Taking the half-life of carbon-14 as about 5,730 years, a sample with 30% of its original carbon-14 remaining is

t = half-life × ln(fraction left) / ln(0.5) → 5730×ln(0.3)/ln(0.5) = 9952.81285457

or roughly 9,950 years old. Both ln(0.3) and ln(0.5) are negative, so the ratio is positive. The same method handles drug clearance and capacitor discharge (e^(−t/RC)).

Capacitor example: in a circuit with RC = 2 s, the time for the voltage to fall to 10% is t = −RC ln(0.1) → -2ln(0.1) = 4.60517018599 s.

8. Example 5: earthquake magnitude and energy

Each step of one in (moment) magnitude releases about 10^1.5, or roughly 32 times, more energy. For a magnitude difference ΔM, the energy ratio is 10^(1.5ΔM).

  • Magnitude 6 vs 5: 10^1.5 → 31.6227766017 times
  • Magnitude 7 vs 5: 10^(1.5×2) → 1000 times

Because the exponent is an expression, it needs brackets: 10^(1.5×2). Typing 10^1.5×2 gives (10^1.5)×2 = 63.2455532034.

9. Example 6: counting digits of a huge number

A positive integer N has floor(log N) + 1 digits. How many digits does 2⁶⁴ have? floor(64log(2))+1 → 20. Indeed 2⁶⁴ = 18,446,744,073,709,551,616 has 20 digits. Logs let you size up numbers that are awkward to compute directly.

10. Domain errors

Real logarithms are defined only for positive numbers.

  • log(0) → math error. As x approaches 0, log x falls without bound (−∞).
  • ln(-5) → math error. The log of a negative number is complex, and SciKey does not support complex numbers.
  • The log of a positive number below 1 is simply negative, not an error: log(0.001) = −3.

If an expression errors out, check whether the value inside a log has become zero or negative, as in ln(1-x) with x = 1.2.

11. Common mistakes

  • Mixing up log and ln. In some fields (pure mathematics, some physics texts) "log" means the natural log. Check which base your source uses.
  • Argument order in log(a, x). In SciKey and on Casio calculators, the base comes first.
  • Splitting log(a+b) into log a + log b. Logs turn products into sums, not sums into anything simpler. The valid rule is log(ab) = log a + log b.
  • Decibel factors. 10 for power, 20 for amplitude.

→ Open the calculator Function Reference

Last updated: 2026-09-24