Logarithmic Functions
Textbook Reference
| Primary source | OpenStax Calculus Volume 1, Section 1.2: “Basic Classes of Functions” |
| Direct link | https://openstax.org/books/calculus-volume-1/pages/1-2-basic-classes-of-functions |
| Supplementary | OpenStax Precalculus 2e, Section 6.3: “Logarithmic Functions” |
| Supplementary link | https://openstax.org/books/precalculus-2e/pages/6-3-logarithmic-functions |
Both sources are free and openly licensed.
Try This First
A sound’s intensity level in decibels is defined using logarithms. Before reading the formal definition, work through this simpler question:
Find the value of $x$ in each equation:
(a) $2^x = 8$ (b) $2^x = 1$ (c) $2^x = \dfrac{1}{4}$ (d) $10^x = 1000$ (e) $10^x = 0.001$
Write your answers. For each one, explain what question you were really answering: given the base and the output, what was the exponent?
That is exactly what a logarithm does.
Key idea
The logarithm $\log_b x$ answers the question: “What power must $b$ be raised to in order to produce $x$?” It is the inverse of the exponential function. Every identity and property of logarithms follows directly from this definition and from the corresponding property of exponentials.
The natural logarithm $\ln x = \log_e x$ is the most important case in calculus because $e^x$ is the most important exponential function. The derivative of $\ln x$ is $1/x$ -- one of the cleanest results in all of calculus -- and this single fact drives an enormous amount of integration and differentiation.
Prerequisite Check
Before this lesson, make sure you can do all of the following:
If any of these is uncertain, review Exponential Functions before continuing.
Quick Reference
Definition. For $b > 0$, $b \neq 1$, and $x > 0$: $$ y = \log_b x \iff b^y = x. $$ Read: “$y$ equals log base $b$ of $x$” means “$b$ to the power $y$ equals $x$”.
Special cases.
| Notation | Base | Read as |
|---|---|---|
| $\log_{10} x$ | $10$ | “common logarithm of $x$” (often written $\log x$) |
| $\ln x$ | $e \approx 2.718$ | “natural logarithm of $x$” |
Key identities. For $b > 0$, $b \neq 1$, and $x, y > 0$:
| Identity | Formula |
|---|---|
| Product rule | $\log_b(xy) = \log_b x + \log_b y$ |
| Quotient rule | $\log_b(x/y) = \log_b x - \log_b y$ |
| Power rule | $\log_b(x^r) = r \log_b x$ |
| Change of base | $\log_b x = \dfrac{\ln x}{\ln b} = \dfrac{\log x}{\log b}$ |
| Inverse cancellation | $b^{\log_b x} = x$ and $\log_b(b^x) = x$ |
Graph features of $y = \log_b x$ (for $b > 1$):
| Feature | Value |
|---|---|
| Domain | $(0, +\infty)$ |
| Range | $(-\infty, +\infty)$ |
| $x$-intercept | $(1, 0)$, since $\log_b 1 = 0$ |
| Vertical asymptote | $x = 0$ |
| Behavior as $x \to 0^+$ | $\log_b x \to -\infty$ |
| Behavior as $x \to +\infty$ | $\log_b x \to +\infty$ (slowly) |
Key Concepts
1. The Logarithm as the Inverse of the Exponential
Because $f(x) = b^x$ is one-to-one (strictly monotone), it has an inverse function. The inverse of $f(x) = b^x$ is $f^{-1}(x) = \log_b x$.
What this means in practice:
- To “undo” an exponential, apply the logarithm.
- To “undo” a logarithm, apply the exponential.
The two cancellation identities express this: $$ b^{\log_b x} = x \qquad \text{for all } x > 0 $$ $$ \log_b(b^x) = x \qquad \text{for all real } x $$
Two representations, one idea.
Algebraic: $\log_2 8 = 3$ because $2^3 = 8$. The logarithm is the exponent.
Graphical: The graph of $y = \log_2 x$ is the reflection of the graph of $y = 2^x$ across the line $y = x$. The domain and range switch: $y = 2^x$ has domain $\mathbb{R}$ and range $(0, \infty)$; $y = \log_2 x$ has domain $(0, \infty)$ and range $\mathbb{R}$.
Translation prompt: Draw the graph of $y = 2^x$ and its reflection across $y = x$. The reflected graph is $y = \log_2 x$. Identify the vertical asymptote of $y = \log_2 x$ and explain where it comes from by connecting it to the horizontal asymptote of $y = 2^x$.
Predict-then-check. Predict: what is $\log_3 27$?
Prediction: $\log_3 27$ asks what power of 3 equals 27. Since $3^3 = 27$, predict $\log_3 27 = 3$.
Check: $3^3 = 27$. Confirmed.
2. Domain and Range
The domain of $\log_b x$ is $(0, +\infty)$: the logarithm is only defined for positive inputs.
Why: the equation $b^y = x$ can only be solved for real $y$ when $x > 0$, because $b^y > 0$ for all real $y$. There is no real power of a positive base $b$ that gives a non-positive output.
The range is all real numbers: $\log_b x$ takes every real value as $x$ ranges over $(0, +\infty)$.
Vertical asymptote at $x = 0$. As $x \to 0^+$, $\log_b x \to -\infty$ (for $b > 1$). The output becomes more and more negative, without bound, as the input approaches zero from the right.
Numerical illustration:
| $x$ | $0.001$ | $0.01$ | $0.1$ | $1$ | $10$ | $100$ | $1000$ |
|---|---|---|---|---|---|---|---|
| $\log_{10} x$ | $-3$ | $-2$ | $-1$ | $0$ | $1$ | $2$ | $3$ |
Ask why: The input must be positive. Why is the input, not the output, required to be positive? Because the input to $\log_b$ is the output of $b^y$, and $b^y > 0$ always. The logarithm’s input being the exponential’s output means the domain restriction on $\log_b x$ (positive inputs) corresponds to the range restriction of $b^x$ (positive outputs).
3. Logarithm Identities from Exponent Laws
Every logarithm identity is a restatement of an exponent law. Knowing this means you never need to memorize the log identities separately.
Product rule: $\log_b(xy) = \log_b x + \log_b y$.
Where it comes from: Let $u = \log_b x$ and $v = \log_b y$. Then $x = b^u$ and $y = b^v$. So: $$ xy = b^u \cdot b^v = b^{u+v} $$ Therefore $\log_b(xy) = u + v = \log_b x + \log_b y$.
The product rule says: the logarithm of a product is the sum of the logarithms. This converts multiplication into addition -- which is why logarithms were historically used to simplify computations.
Quotient rule: $\log_b(x/y) = \log_b x - \log_b y$.
Same derivation, using $b^u/b^v = b^{u-v}$.
Power rule: $\log_b(x^r) = r \log_b x$.
Let $u = \log_b x$, so $x = b^u$. Then $x^r = (b^u)^r = b^{ur}$. Therefore $\log_b(x^r) = ur = r \log_b x$.
Ask why: Why does converting multiplication to addition make computation easier? Before electronic calculators, computing $897 \times 523$ directly required long multiplication. But $\log(897 \times 523) = \log(897) + \log(523)$, and looking up two logarithms and adding them was much faster. Slide rules and log tables were built on this principle. Logarithms made astronomy, navigation, and science feasible centuries before computing machines existed.
4. The Natural Logarithm $\ln x$
The natural logarithm $\ln x = \log_e x$ is the inverse of $e^x$. It is the most important logarithm in calculus.
Key cancellation identities: $$ e^{\ln x} = x \quad \text{for } x > 0 \qquad \text{and} \qquad \ln(e^x) = x \quad \text{for all real } x. $$
Examples.
$\ln(e^3) = 3$ (the exponent).
$\ln(1) = 0$ because $e^0 = 1$.
$\ln(e) = 1$ because $e^1 = e$.
$e^{\ln 5} = 5$ (cancellation).
Predict-then-check. Predict: is $\ln(e^{-2})$ positive or negative?
Prediction: $\ln(e^{-2}) = -2$ (cancellation identity). Negative.
Check: $e^{-2} = 1/e^2 \approx 0.135 < 1$. The logarithm of a number less than 1 is negative (since $\ln(1) = 0$ and $\ln$ is increasing). $\ln(0.135) \approx -2$. Consistent.
5. Change of Base Formula
The change of base formula allows computing $\log_b x$ using any other base (typically base $e$ or base $10$): $$ \log_b x = \frac{\ln x}{\ln b} = \frac{\log x}{\log b}. $$
Practical use: Most calculators have buttons for $\ln$ and $\log_{10}$ but not for $\log_2$ or $\log_3$. The change of base formula allows computing these.
Example. Compute $\log_2 10$ to four decimal places.
$$\log_2 10 = \frac{\ln 10}{\ln 2} \approx \frac{2.3026}{0.6931} \approx 3.3219.$$
Check: $2^{3.3219} \approx 10$. (Since $2^3 = 8$ and $2^4 = 16$, a value around $3.3$ is plausible.)
Two representations, one idea.
Algebraic: The change of base formula is $\log_b x = \dfrac{\ln x}{\ln b}$.
Numerical: A table of $\log_2 x$ values can be computed by dividing a table of $\ln x$ values by $\ln 2 \approx 0.693$.
Translation prompt: Use the change of base formula to explain why $\log_b x = \log_c x / \log_c b$ for any valid base $c$. Write each step, identifying which exponent law or cancellation identity justifies it. (The derivation below in the extension problem fills in the details.)
6. Solving Equations Involving Logarithms and Exponentials
Logarithms and exponentials are inverses. To solve an equation:
- If the variable is in an exponent, apply the logarithm.
- If the variable is inside a logarithm, apply the exponential.
Example 1. Solve $2^x = 17$.
Apply $\ln$ to both sides: $\ln(2^x) = \ln 17$. Power rule: $x \ln 2 = \ln 17$.
$$x = \frac{\ln 17}{\ln 2} = \log_2 17 \approx 4.087.$$
Check: $2^{4.087} \approx 2^4 \cdot 2^{0.087} = 16 \cdot 1.063 \approx 17$. Consistent.
Example 2. Solve $\ln(x + 3) = 2$.
Apply $e$ to both sides: $e^{\ln(x+3)} = e^2$. Cancellation: $x + 3 = e^2$.
$$x = e^2 - 3 \approx 7.389 - 3 = 4.389.$$
Check: $\ln(4.389 + 3) = \ln(7.389) = \ln(e^2) = 2$. Confirmed.
Named Misconception
Misconception ID: multiplicative-not-additive
A persistent error is writing $\log(x + y) = \log x + \log y$. This is false. The correct product rule states $\log(x \cdot y) = \log x + \log y$ (product becomes sum). The sum $x + y$ does not factor as a product in any useful way, so there is no general simplification for $\log(x + y)$.
Why this breaks. Test at $x = y = 10$: $\log(10 + 10) = \log(20) \approx 1.301$, but $\log(10) + \log(10) = 1 + 1 = 2$. These are not equal.
Where the confusion comes from. Students who have learned that “logarithms convert multiplication to addition” sometimes over-generalize, applying the conversion to addition as well. The identity that converts multiplication to addition is the product rule. There is no corresponding rule for sums.
Correct statement. The three legitimate logarithm rules involve products ($\log(xy)$), quotients ($\log(x/y)$), and powers ($\log(x^r)$). Logarithms have no general rule for sums or differences of arguments.
Small test. Evaluate $\log_{10}(100 \cdot 1000) = \log_{10}(100) + \log_{10}(1000) = 2 + 3 = 5$. Check: $100 \cdot 1000 = 10^5$, so $\log_{10}(10^5) = 5$. Correct. Now try $\log_{10}(100 + 1000) = \log_{10}(1100) \approx 3.041$, which is not $2 + 3 = 5$.
Worked Example
Problem. A radioactive substance has a half-life of 10 years. Starting with 200 grams, how long will it take for only 25 grams to remain?
Step 1: Write the model. After $t$ years, the amount remaining is $$ A(t) = 200 \cdot \left(\frac{1}{2}\right)^{t/10}. $$
The factor $(1/2)^{t/10}$ halves the amount every 10 years.
Step 2: Set up the equation. $$ 200 \cdot \left(\frac{1}{2}\right)^{t/10} = 25. $$
Divide both sides by 200: $$ \left(\frac{1}{2}\right)^{t/10} = \frac{25}{200} = \frac{1}{8}. $$
Step 3: Apply the logarithm. Take $\ln$ of both sides: $$ \frac{t}{10} \ln\left(\frac{1}{2}\right) = \ln\left(\frac{1}{8}\right). $$
Simplify: $\ln(1/2) = -\ln 2$ and $\ln(1/8) = \ln(2^{-3}) = -3\ln 2$.
$$ \frac{t}{10} \cdot (-\ln 2) = -3\ln 2. $$
Divide both sides by $-\ln 2$ (positive, so the inequality direction is preserved): $$ \frac{t}{10} = 3 \implies t = 30 \text{ years.} $$
Step 4: Check. After 30 years, there have been $30/10 = 3$ half-life periods. Start: 200 g. After 10 years: 100 g. After 20 years: 50 g. After 30 years: 25 g. Confirmed.
Step 5: Connect to prediction. The answer 30 years = $3 \times 10$ years makes intuitive sense: we need the amount to drop by a factor of $1/8 = (1/2)^3$, which requires exactly 3 half-lives.
Common Errors
| Error | Example | Correction |
|---|---|---|
| $\log(x + y) = \log x + \log y$ | $\log(10 + 10) = 2$ | $\log(10 + 10) = \log 20 \approx 1.301$; the sum rule does not exist |
| $\log(xy) = \log x \cdot \log y$ | Multiplying logs instead of adding | $\log(xy) = \log x + \log y$ (product becomes sum) |
| Taking the log of the denominator rather than dividing logs | “$\log_2 10 = \log(2/10)$” | $\log_2 10 = \ln 10 / \ln 2$; divide the logs, not the arguments |
| Forgetting the domain restriction | “Solve $\ln(x-5) = 2$, get $x = e^2 + 5$, done” | Must verify $x - 5 > 0$: $e^2 + 5 - 5 = e^2 > 0$. OK here, but always check |
| Writing $\ln(e^x) = e^x$ | Confusing the cancellation with evaluation | $\ln(e^x) = x$; the logarithm and exponential cancel, leaving just the exponent |
Common Misconceptions
logarithm rules work like the rules they resemble for ordinary numbers -- in particular, $\log(a + b) = \log a + \log b$.
This is the multiplicative-not-additive error applied to logarithms. The product rule says $\log(ab) = \log a + \log b$: a product inside becomes a sum outside. There is no corresponding rule for a sum inside. $\log(10 + 10) = \log 20 \approx 1.301$, not $\log 10 + \log 10 = 2$. The confusion arises because addition and multiplication look superficially related; logarithms convert multiplication to addition, but they do nothing helpful to a sum inside.
Leveled Practice
Level 1 -- Direct Application
Problem 1. Evaluate each without a calculator.
(a) $\log_2 32$ (b) $\log_3 \dfrac{1}{9}$ (c) $\ln(e^5)$ (d) $\log_{10} 0.01$
Show answer
(a) $\log_2 32 = 5$ because $2^5 = 32$.
(b) $\log_3(1/9) = -2$ because $3^{-2} = 1/9$.
(c) $\ln(e^5) = 5$ (cancellation identity).
(d) $\log_{10}(0.01) = \log_{10}(10^{-2}) = -2$.
Problem 2. Expand using logarithm identities.
(a) $\ln\left(\dfrac{x^3 y}{z^2}\right)$
(b) $\log_2\left(\sqrt{x(x+1)}\right)$
Show answer
(a) $$\ln\left(\frac{x^3 y}{z^2}\right) = \ln(x^3) + \ln(y) - \ln(z^2) = 3\ln x + \ln y - 2\ln z.$$
(b) $$\log_2\left(\sqrt{x(x+1)}\right) = \log_2\left(x(x+1)\right)^{1/2} = \frac{1}{2}\log_2(x(x+1)) = \frac{1}{2}\left(\log_2 x + \log_2(x+1)\right).$$
Domain requires $x > 0$ and $x + 1 > 0$, so $x > 0$.
Problem 3. Solve each equation exactly.
(a) $3^x = 50$ (b) $\ln(2x - 1) = 4$
Show answer
(a) $3^x = 50$. Apply $\ln$: $x \ln 3 = \ln 50$. So $x = \dfrac{\ln 50}{\ln 3} = \log_3 50 \approx 3.561$.
(b) $\ln(2x - 1) = 4$. Apply $e^{\,\cdot\,}$: $2x - 1 = e^4$. So $x = \dfrac{e^4 + 1}{2} \approx \dfrac{54.60 + 1}{2} \approx 27.80$.
Check domain: $2(27.80) - 1 = 54.60 > 0$. Valid.
Level 2 -- Multiple Representations
Problem 4. Condense into a single logarithm: $$3\log x - \frac{1}{2}\log(x+1) + \log 5.$$
Show answer
Apply power rule to each term: $$\log(x^3) - \log\left((x+1)^{1/2}\right) + \log 5.$$
Combine using product and quotient rules: $$\log\left(\frac{5x^3}{\sqrt{x+1}}\right).$$
Domain: $x > 0$ (from $\log x$) and $x + 1 > 0$ (already satisfied for $x > 0$).
Problem 5. A population model gives $P(t) = 500 e^{0.04t}$, where $t$ is in years and $P$ is the population.
(a) What is the initial population? (b) Find $t$ when the population reaches 2000. (c) What is the doubling time (the time for the population to double from any starting value)?
Show answer
(a) $P(0) = 500 e^0 = 500$.
(b) $500 e^{0.04t} = 2000 \implies e^{0.04t} = 4 \implies 0.04t = \ln 4 \implies t = \dfrac{\ln 4}{0.04} = \dfrac{2\ln 2}{0.04} \approx \dfrac{1.386}{0.04} \approx 34.66$ years.
(c) Doubling: $e^{0.04t} = 2 \implies t = \dfrac{\ln 2}{0.04} \approx \dfrac{0.693}{0.04} \approx 17.33$ years. The doubling time is the same regardless of the starting value (it depends only on the growth rate $k = 0.04$, not on the initial amount $500$).
Level 3 -- Derivation and Extension
Problem 6 (Low Floor, High Ceiling). Derive the change of base formula $\log_b x = \dfrac{\ln x}{\ln b}$ from the definition of logarithm and the cancellation identities.
Show answer
Goal: Show that $\log_b x = \dfrac{\ln x}{\ln b}$.
Step 1. Let $y = \log_b x$. By definition, $b^y = x$.
Step 2. Apply $\ln$ to both sides of $b^y = x$: $$\ln(b^y) = \ln x.$$
Step 3. Apply the power rule for logarithms: $$y \ln b = \ln x.$$
Step 4. Divide both sides by $\ln b$ (valid because $b \neq 1$ means $\ln b \neq 0$): $$y = \frac{\ln x}{\ln b}.$$
Step 5. Substitute $y = \log_b x$: $$\log_b x = \frac{\ln x}{\ln b}.$$
The formula follows from the power rule and the definition of logarithm. No additional assumptions are needed. The same derivation works with any base $c$ in place of $e$: $$\log_b x = \frac{\log_c x}{\log_c b}.$$
The natural log is conventionally used because it simplifies calculus (the derivative of $\ln x$ is $1/x$).
Mastery Checklist
You have mastered this skill when you can do all of the following without referring to notes:
Mental Model
A logarithm answers the question: “What exponent was used?” If you know the base and the output, the logarithm tells you the input that the exponential used. This is the inverse relationship.
Because $b^x$ grows (or decays) very rapidly, its inverse $\log_b x$ grows very slowly. A number must be made enormously larger before its logarithm increases by 1. This is why logarithms are used to measure phenomena that span enormous ranges: earthquake intensities (Richter scale), sound loudness (decibels), and acidity (pH). Logarithms compress a vast range of values into a manageable scale.
The identities -- product to sum, quotient to difference, power to product -- all say the same thing: the logarithm converts the multiplicative world of exponentiation into the additive world of arithmetic. This is not a coincidence; it is exactly the content of the exponent laws, restated in logarithmic notation.
Connections
Within Chapter 1
- Exponential functions: The logarithm is the inverse of the exponential. Every property of logarithms is a reflection of a property of exponentials. The two functions are studied together precisely because they undo each other.
- Domain restrictions (algebraic functions): The logarithm introduces another type of domain restriction: the argument must be positive. This is the same spirit as the restriction on even roots, but the reason is different (no real power of a positive base gives a non-positive output).
Toward Later Calculus
- Derivative of $\ln x$ (Chapter 3): The result $\dfrac{d}{dx} \ln x = \dfrac{1}{x}$ is one of the most useful derivatives in calculus. Combined with the chain rule, it gives the derivative of $\ln(f(x))$ and forms the basis of logarithmic differentiation.
- Logarithmic differentiation (Chapter 3): For functions like $f(x) = x^x$ or products of many factors, taking the logarithm before differentiating converts a complicated product into a manageable sum. This technique depends directly on the product and power rules for logarithms.
- Integration of $1/x$ (Chapter 5): $\int \dfrac{1}{x}\,dx = \ln|x| + C$. The logarithm appears as the antiderivative of the simplest rational function not covered by the power rule. This is a foundational integral used throughout the course.
- Exponential growth and decay (Chapter 4, beyond): The equation $A(t) = A_0 e^{kt}$ models continuous growth or decay. Solving for $t$ always requires taking the natural logarithm: $t = \dfrac{1}{k}\ln(A/A_0)$.
Audience Notes
For students who find the identities hard to keep straight: Ground each identity in a numerical example. For the product rule: $\log(100 \cdot 1000) = \log(100) + \log(1000) = 2 + 3 = 5 = \log(100000)$. Verify. Once the numerical check is habitual, the general rule becomes a pattern recognized from examples, not a memorized formula.
For students who want to go further: The logarithm $\ln x$ has a geometric interpretation as an area: $\ln x = \int_1^x \dfrac{1}{t}\,dt$. This integral definition extends the domain of the logarithm to complex numbers (with a careful treatment of multiple values). The complex logarithm is central to complex analysis and appears in physics and engineering in the analysis of waves and resonance.