Sub topic 2
Common logarithms, natural logarithms, and the number e
This chapter assumes you can solve linear and quadratic equations, apply integer and rational exponent rules, use function notation including the idea of an inverse function, and evaluate powers and logarithms on a calculator. You should also know from the previous chapter that log_b(x) = y means b^y = x, so exponentials and logarithms undo each other.
By the end you will be able to read log and ln correctly, explain where e comes from, use the inverse identities for base 10 and base e, and avoid the calculator and notation mistakes that cost most points.
Two bases do most of the work
A logarithm can use any positive base other than 1. In practice two bases dominate, because calculators have a key for each and because they appear naturally in science and finance.
| Name | Notation | Base | Meaning of `y = ...` | Typical use |
|---|---|---|---|---|
| Common logarithm | `log(x)` or `log10(x)` | 10 | `10^y = x` | Orders of magnitude, pH, decibels, scientific notation |
| Natural logarithm | `ln(x)` | e ≈ 2.71828 | `e^y = x` | Continuous growth and decay, calculus, most formulas in science |
The notation log(x) with no base written is the common logarithm in most algebra courses and on most calculators. Be careful: many programming languages and some advanced mathematics texts use log to mean the natural logarithm. Python's math.log(x) is natural, and math.log10(x) is common.
import math
print(math.log10(1000)) # 3.0, because 10**3 = 1000
print(math.log(math.e)) # 1.0, because e**1 = e
print(math.log(1000)) # about 6.9078, this is ln(1000), not log(1000)The common logarithm
Because the base is 10, the common logarithm of a power of 10 is simply the exponent.
log(1) = 0, since10^0 = 1.log(10) = 1, since10^1 = 10.log(100) = 2, since10^2 = 100.log(0.001) = -3, since10^(-3) = 0.001.
For numbers that are not exact powers of 10, the answer falls between integers. Since 50 is between 10 and 100, log(50) is between 1 and 2. The calculator gives about 1.699. This kind of estimate is a good habit, because it catches typing errors.
The two inverse identities for base 10 are:
10^(log x) = xfor everyx > 0log(10^x) = xfor every realx
These follow directly from the fact that 10^x and log x are inverse functions. You will use them constantly, because they let you remove a logarithm or an exponential from an equation in one step.
The number e
The number e is an irrational constant, approximately 2.718281828. Like π, its decimal expansion never ends and never repeats, so you should treat e as an exact symbol and round only at the end.
Where e comes from
The usual definition comes from compound interest. Suppose you invest 1 unit at 100% annual interest, compounded n times per year. After one year you have (1 + 1/n)^n. More frequent compounding helps, but with diminishing returns.
for n in (1, 2, 12, 365, 1_000_000):
print(n, (1 + 1 / n) ** n)The output approaches 2.71828 as n grows:
| Compounding periods `n` | Value of `(1 + 1/n)^n` |
|---|---|
| 1 | 2.0 |
| 2 | 2.25 |
| 12 | about 2.613 |
| 365 | about 2.7146 |
| 1,000,000 | about 2.71828 |
The limit of this expression as n grows without bound is e. This is why e appears in the formula for continuous compounding, which you will use in the applications chapter.
Why e is the "natural" base
Calculus gives the deeper reason. The function e^x is its own rate of change: the slope of its graph at any point equals the height of the graph there. No other base has this property, so formulas built on e have no extra constants. For this tutorial you only need to remember that e is a base like any other, with a few convenient features.
The natural logarithm
The natural logarithm ln(x) is the logarithm with base e. By definition:
ln(x) = ymeanse^y = x.
Two identities mirror the base 10 versions:
e^(ln x) = xfor everyx > 0ln(e^x) = xfor every realx
Some values to memorize:
ln(1) = 0, sincee^0 = 1.ln(e) = 1, sincee^1 = e.ln(e^3) = 3.ln(1/e) = -1.
The symbol ln is just a name for log_e. Everything that is true for logarithms of any base, including the product, quotient, and power rules in the next chapter, is true for ln.
Using the identities to solve equations
The practical payoff is that the right logarithm cancels the matching exponential. Choose the base that matches the equation, or use either one when no base is obviously better.
Example 1: a base e equation
Solve e^(2x) = 7.
- Take the natural logarithm of both sides:
ln(e^(2x)) = ln(7). - Apply
ln(e^u) = u:2x = ln(7). - Divide:
x = ln(7)/2.
The exact answer is ln(7)/2. The decimal approximation is about 0.9730.
Example 2: a base 10 equation
Solve 10^(x+1) = 250.
- Take the common logarithm of both sides:
log(10^(x+1)) = log(250). - Apply
log(10^u) = u:x + 1 = log(250). - Subtract 1:
x = log(250) - 1.
The exact answer is log(250) - 1, which is about 1.3979.
Example 3: a logarithmic equation
Solve ln(x) = 2.
Rewrite in exponential form by making both sides exponents of e: e^(ln x) = e^2, so x = e^2. This is about 7.389. Since e^2 is positive, the domain condition x > 0 is satisfied.
You can verify all three results numerically.
import math
# Example 1: e**(2x) = 7
x1 = math.log(7) / 2
print(x1, math.exp(2 * x1)) # about 0.9730, 7.0
# Example 2: 10**(x+1) = 250
x2 = math.log10(250) - 1
print(x2, 10 ** (x2 + 1)) # about 1.3979, 250.0
# Example 3: ln(x) = 2
x3 = math.exp(2)
print(x3, math.log(x3)) # about 7.389, 2.0Which logarithm should you choose?
Any base works for an exponential equation, but the base of the exponential usually points to the best choice.
| Equation shape | Best logarithm | Reason |
|---|---|---|
| `e^(...) = number` | `ln` | `ln(e^u) = u` removes the exponential exactly |
| `10^(...) = number` | `log` | `log(10^u) = u` removes the exponential exactly |
| `b^(...) = number`, other `b` | either `ln` or `log` | The power rule moves the exponent down, and you divide by `ln b` or `log b` |
For the last row, the power rule is covered in the next chapter and used in full later. The key point here is that you can get the same final value from ln and from log, because the ratio of the two logarithms is the same either way.
Common errors
These mistakes appear again and again with log and ln.
- Confusing
logandlnon the calculator. Check the key.ln(100)is about 4.605, butlog(100)is exactly 2. If your answer to a base 10 problem looks strange, you may have pressed the wrong key. - Treating
eas a variable.eis a fixed number. You cannot "solve for e", and you do not combine it withxas if it were an unknown. - Rounding
eearly. Replacingewith 2.72 and then computing2.72^5gives an error of roughly 0.1%, which can fail an answer check. Use the calculator'sekey or keep the exact symbol until the final step. - Writing
lnas a multiplication.ln(x)is a function applied tox. The expressionln xdoes not meanl · n · x, and you cannot dividelnout of both sides ofln(x) = ln(5)to getx = 5by canceling letters. That result is true, but only because of the one-to-one property, which is the subject of a later chapter. - Splitting a logarithm over a sum.
ln(a + b)is notln(a) + ln(b). The sum rule applies only to products:ln(a) + ln(b) = ln(ab). - Taking a logarithm of zero or a negative number.
ln(0)andln(-3)are undefined in the real numbers. A calculator will show an error or a complex value.
import math
try:
math.log(-3)
except ValueError as err:
print("ValueError:", err) # math domain errorHow the pieces fit together
The two inverse relationships drive the method for the whole topic. The diagram below shows how each function undoes the other for base e. The same picture holds for base 10 if you replace e with 10 and ln with log.
Reading the diagram: starting from any real x, applying e^x gives a positive number, and applying ln returns you to x. In the other direction, starting from any positive y, applying ln gives a real number, and applying e^x returns you to y. This is the reason for the domain asymmetry in the callout above.
Summary of what to remember
lognormally means base 10, andlnmeans base e. Check the convention in any programming language you use.eis about 2.71828, an irrational number that arises from continuous compounding.10^(log x) = x,log(10^x) = x,e^(ln x) = x, andln(e^x) = x, with the domain conditions noted above.- Match the logarithm to the base of the exponential when you can, and keep exact forms until the final step.
Exercise
Solve e^(3x - 2) = 15 exactly, then give a decimal approximation to four places. Explain why ln is a better choice here than log.
Show answer
Take ln of both sides: ln(e^(3x - 2)) = ln(15), so 3x - 2 = ln(15). Then 3x = ln(15) + 2 and x = (ln(15) + 2)/3. Since ln(15) is about 2.7081, x is about 4.7081/3 = 1.5694. Using ln is better because the base of the exponential is e, so ln(e^u) = u removes the exponential exactly. With log, you would need the power rule and a division by log(e), which gives the same answer with more steps.
Exercise
A student solves log(x) = 2 and writes x = e^2. Find the mistake and give the correct solution.
Show answer
The student used the base e, but log without a base means base 10 here. Rewrite in exponential form with base 10: x = 10^2 = 100. Check: log(100) = 2, and 100 is positive, so it is in the domain. The value e^2 is about 7.389, and log(7.389) is about 0.869, not 2.
Exercise
Without a calculator, find ln(e^5), log(0.01), and e^(ln 8). State which identity you used for each.
Show answer
ln(e^5) = 5 by ln(e^x) = x. log(0.01) = log(10^(-2)) = -2 by log(10^x) = x. e^(ln 8) = 8 by e^(ln x) = x, which is valid because 8 > 0.