Home›Courses›Calculus I›§4.2 Logarithmic Functions
Pre-CalculusCalculus ILinear Algebra I
Calculus I  ·  Chapter 4  ·  Section 4.2

Logarithmic Functions

The Inverse of Exponential Growth

Logarithms answer the question exponentials cannot: given the result, what was the exponent? From earthquake magnitudes to investment doubling times — logarithms make the invisible visible.

Why This Section Matters

The Instrument that
Conquered the Universe

The Slide Rule — Computing Before Computers

Before electronic calculators existed, scientists and engineers used a device called a slide rule — two rulers that could be slid against each other to multiply, divide, and compute powers. The slide rule was powered entirely by logarithms. It was used to design the Apollo spacecraft, calculate artillery trajectories in World War II, and build every skyscraper and bridge before 1970.

John Napier invented logarithms in 1614 specifically to reduce multiplication to addition — because $\log(ab) = \log a + \log b$. Astronomers at the time spent years doing multiplications by hand. Napier's logarithms reduced that work to weeks. The astronomer Laplace called logarithms "an admirable artifice which, by reducing to a few days the labour of many months, doubles the life of the astronomer."

The Unfinished Business from §4.1

In §4.1, we computed the doubling time of an investment at 8% continuous compounding:

$$2P = Pe^{0.08T} \Rightarrow 2 = e^{0.08T} \Rightarrow T = \frac{\ln 2}{0.08} \approx 8.66 \text{ years}$$

We used $\ln$ without formally defining it. Now we fix that. Logarithms are the systematic answer to: "What power do I raise the base to, in order to get this number?"

Similarly: if PKR 50,000 grows to PKR 150,000 at 6% continuous compounding, how long does it take? The answer requires logarithms.

Logarithms appear everywhere you need to "undo" exponential growth: investment doubling times, earthquake magnitudes (Richter scale), sound intensity (decibels), pH in chemistry, population growth models, radioactive decay, and the complexity of algorithms in computer science.
§ 1 — Definition

What Is a Logarithm?

The logarithm answers one specific question: what exponent gives me this number?

Definition — Logarithmic Function

For $b > 0$, $b \neq 1$, and $x > 0$:

$$y = \log_b x \quad\Longleftrightarrow\quad b^y = x$$

Read: "y equals log base b of x" means "b raised to y equals x."

The logarithm $\log_b x$ is the exponent to which $b$ must be raised to get $x$. The domain is $(0,\infty)$ and the range is $(-\infty,\infty)$.

The fundamental bridge:
$\log_b x = y$  ⟺  $b^y = x$
These two equations say the exact same thing in two different languages. Every logarithm problem can be rewritten as an exponential and vice versa.
§ 2 — Evaluating Logarithms by Definition

Evaluating Logarithms
Step by Step

Example 1 — Evaluate $\log_2 8$

Ask: "2 raised to what power gives 8?" Let $y = \log_2 8$. Then $2^y = 8 = 2^3$. So $\boxed{y=3}$.

Example 2 — Evaluate $\log_3 \frac{1}{27}$

Let $y=\log_3\frac{1}{27}$. Then $3^y=\frac{1}{27}=3^{-3}$. So $\boxed{y=-3}$.

Example 3 — Evaluate $\log_{25} 5$

Let $y=\log_{25}5$. Then $25^y=5=(25^{1/2})$. So $\boxed{y=\frac{1}{2}}$.

Example 4 — Evaluate $\log_b 1$ for any valid base $b$

Let $y=\log_b 1$. Then $b^y=1=b^0$. So $\boxed{y=0}$ for any $b>0, b\neq 1$. The log of 1 is always 0.

Two special values — memorise these:
$\log_b 1 = 0$   (because $b^0 = 1$)
$\log_b b = 1$   (because $b^1 = b$)
§ 3 — Logarithm Rules

The Laws of Logarithms

For $b>0, b\neq 1$ and $M,N>0$:
Product rule
$$\log_b(MN) = \log_b M + \log_b N$$
$\log_2(4\cdot8)=\log_2 4+\log_2 8=2+3=5$
Quotient rule
$$\log_b\!\left(\dfrac{M}{N}\right) = \log_b M - \log_b N$$
$\log_3\frac{81}{9}=\log_3 81-\log_3 9=4-2=2$
Power rule
$$\log_b(M^p) = p\log_b M$$
$\log_2(8^4)=4\log_2 8=4\cdot3=12$
Log of base
$$\log_b b = 1$$
$\log_5 5=1,\;\log_e e=1$
Log of one
$$\log_b 1 = 0$$
$\log_{10}1=0,\;\ln 1=0$
Inverse (I)
$$b^{\log_b x} = x\quad (x>0)$$
$2^{\log_2 7}=7$
Inverse (II)
$$\log_b(b^x)=x$$
$\log_3(3^5)=5$
One-to-one
$$\log_b M=\log_b N\Leftrightarrow M=N$$
$\log_5 x=\log_5 9\Rightarrow x=9$

Exponential vs Logarithmic Rules — Side by Side

Exponential RuleLogarithmic Rule
$b^x\cdot b^y = b^{x+y}$↔ product becomes sum$\log_b(MN)=\log_b M+\log_b N$
$\dfrac{b^x}{b^y}=b^{x-y}$↔ quotient becomes difference$\log_b(M/N)=\log_b M-\log_b N$
$(b^x)^y=b^{xy}$↔ power becomes factor$\log_b(M^p)=p\log_b M$
$b^0=1$↔$\log_b 1=0$
$b^1=b$↔$\log_b b=1$
§ 4 — Expanding and Condensing Logarithms

Rewriting Log Expressions
Using the Rules

Example 5 — Expand $\log_3\!\left(\dfrac{x^2\sqrt{y}}{z^3}\right)$

Apply quotient rule, then product rule, then power rule:

$$= \log_3(x^2\sqrt{y}) - \log_3(z^3) = \log_3 x^2 + \log_3 y^{1/2} - 3\log_3 z$$

$$= \boxed{2\log_3 x + \frac{1}{2}\log_3 y - 3\log_3 z}$$

Example 6 — Condense $3\ln x - \frac{1}{2}\ln y + 2\ln z$ into a single logarithm

Apply power rule first, then product/quotient rules:

$$= \ln x^3 - \ln y^{1/2} + \ln z^2 = \ln\left(\frac{x^3 z^2}{\sqrt{y}}\right)$$

Example 7 — Simplify $\log_4 2 + \log_4 8$

Product rule: $\log_4(2\cdot8)=\log_4 16$. Since $4^2=16$: $\log_4 16 = \boxed{2}$.

Example 8 — Expand $\log\sqrt[3]{\dfrac{a^4}{b^2c}}$

Write $\sqrt[3]{\cdot}$ as $1/3$ power: $\frac{1}{3}\log\frac{a^4}{b^2c}$

$$= \frac{1}{3}(\log a^4-\log b^2-\log c) = \boxed{\frac{4}{3}\log a - \frac{2}{3}\log b - \frac{1}{3}\log c}$$

Example 9 — Solve $\log_2 x + \log_2(x-2) = 3$

Condense left side: $\log_2[x(x-2)] = 3$. Convert: $x(x-2) = 2^3 = 8$.

$$x^2-2x-8=0 \Rightarrow (x-4)(x+2)=0 \Rightarrow x=4 \text{ or } x=-2$$

Check: $x=-2$ gives $\log_2(-2)$ — undefined. So $\boxed{x=4}$.

§ 5 — Graphs of Logarithmic Functions

Graphing Logarithms and
Their Relationship to Exponentials

Since $y=\log_b x$ is the inverse of $y=b^x$, their graphs are reflections of each other across the line $y=x$. Toggle the curves below to see this relationship clearly.

📊 Logarithmic & Exponential Graph Explorer
Base: b = 2
Exponential y = bˣ
Domain: all reals · Range: (0,∞) · y-intercept: (0,1)
Logarithm y = log_b x
Domain: (0,∞) · Range: all reals · x-intercept: (1,0)
💡 The two curves are mirror images across the line y = x — logarithm is the inverse of exponential.

b > 1 — Increasing Log

As $x\to\infty$: $\log_b x\to\infty$ (slowly). As $x\to 0^+$: $\log_b x\to-\infty$. The y-axis is a vertical asymptote.

Examples: $\log_2 x$, $\log_{10} x$, $\ln x$

Key Point — All Share (1, 0)

Every logarithm $\log_b x$ passes through $(1,0)$ because $b^0=1$ for any base. This mirrors how every exponential passes through $(0,1)$.

The x-intercept of the log is at $x=1$, always.

§ 6 — Properties of Logarithmic Functions

Properties of
$f(x) = \log_b x$

PropertyValue / Description
Domain$(0,\infty)$ — logarithm is only defined for positive inputs
Range$(-\infty,\infty)$ — all real numbers
x-intercept$(1,0)$ — because $\log_b 1=0$ for any $b$
y-interceptNone — the y-axis is a vertical asymptote
Vertical asymptote$x=0$ — the function approaches $-\infty$ as $x\to 0^+$
Behaviour (b > 1)Increasing — larger inputs give larger outputs
Behaviour (0 < b < 1)Decreasing
One-to-one?Yes — different inputs give different outputs
Inverse function$f^{-1}(x)=b^x$ (the exponential function)
As $x\to+\infty$$\log_b x\to+\infty$ (slowly for $b>1$)
As $x\to 0^+$$\log_b x\to-\infty$
§ 7 — The Natural Logarithm

$\ln x$ — The Logarithm
Calculus Was Built For

The Natural Logarithm

The natural logarithm is the logarithm with base $e \approx 2.71828$:

$$\ln x = \log_e x \quad\Longleftrightarrow\quad e^y = x$$

$\ln x$ is the natural choice for calculus because $\frac{d}{dx}[\ln x] = \frac{1}{x}$ — the cleanest possible derivative. No other base gives such a clean formula.

Natural Log Rules — Quick Reference
$\ln(MN)=\ln M+\ln N$$\ln(6)=\ln 2+\ln 3$
$\ln(M/N)=\ln M-\ln N$$\ln(5/2)=\ln 5-\ln 2$
$\ln(M^p)=p\ln M$$\ln(x^3)=3\ln x$
$\ln e = 1$$\ln e = 1$ always
$\ln 1 = 0$$\ln 1 = 0$ always
$e^{\ln x}=x$$e^{\ln 5}=5$
$\ln(e^x)=x$$\ln(e^{3})=3$
$\ln x=y\Leftrightarrow e^y=x$$\ln 7=y\Rightarrow e^y=7$

Example 10 — Solve $e^{2x-1}=5$

Take $\ln$ of both sides: $2x-1=\ln 5$.

$$x = \frac{1+\ln 5}{2} \approx \frac{1+1.6094}{2} \approx \boxed{1.305}$$

Example 11 — Solve $3^x = 10$

Take $\ln$ of both sides: $x\ln 3=\ln 10$.

$$x = \frac{\ln 10}{\ln 3} = \frac{2.3026}{1.0986} \approx \boxed{2.096}$$

This also equals $\log_3 10$ — change of base formula (next section).

Example 12 — Solve $2e^{3x}+1=9$

Isolate the exponential: $2e^{3x}=8 \Rightarrow e^{3x}=4$.

$$3x=\ln 4 \Rightarrow x=\frac{\ln 4}{3}\approx \frac{1.3863}{3}\approx\boxed{0.462}$$

§ 8 — Change of Base Formula

Converting Between
Different Bases

Most calculators only have $\log_{10}$ (log) and $\ln$ (natural log) buttons. The change of base formula lets you compute any logarithm using these.

Change of Base Formula

$$\log_b x = \frac{\log_c x}{\log_c b} = \frac{\ln x}{\ln b}$$

where $c$ is any convenient new base (typically 10 or $e$). Top stays on top (the argument $x$), bottom stays on bottom (the original base $b$).

Example 13 — Compute $\log_5 200$ using a calculator

$\log_5 200 = \dfrac{\ln 200}{\ln 5} = \dfrac{5.2983}{1.6094} \approx \boxed{3.292}$

Check: $5^{3.292}\approx 200$ ✓

Example 14 — Compute $\log_3 50$ using $\log_{10}$

$\log_3 50 = \dfrac{\log 50}{\log 3} = \dfrac{1.6990}{0.4771} \approx \boxed{3.561}$

Example 15 — Solve $\log_6 x = 2.5$ for $x$

Convert: $x = 6^{2.5} = 6^2\cdot 6^{0.5} = 36\sqrt{6} \approx 36\times2.449 \approx \boxed{88.18}$

§ 9 — Compounding Applications

Using Logarithms
in Finance

Now that we have logarithms, we can solve compounding problems where the unknown is time — not the balance.

Example 16

Finding the Time to Reach a Target

PKR 80,000 is invested at 7% compounded continuously. How long until it reaches PKR 200,000?

$200{,}000 = 80{,}000\,e^{0.07T}$

$$e^{0.07T} = \frac{200{,}000}{80{,}000} = 2.5 \Rightarrow 0.07T = \ln 2.5 \Rightarrow T=\frac{\ln 2.5}{0.07}\approx\frac{0.9163}{0.07}\approx\boxed{13.1\text{ years}}$$

Example 17

Finding the Required Interest Rate

You want PKR 500,000 to grow to PKR 1,000,000 in 10 years with continuous compounding. What rate is required?

$1{,}000{,}000 = 500{,}000\,e^{10r} \Rightarrow 2=e^{10r} \Rightarrow 10r=\ln 2$

$$r=\frac{\ln 2}{10}\approx\frac{0.6931}{10}\approx\boxed{6.93\%}$$

Example 18

Tripling Time

At 5% continuous compounding, how long does it take for an investment to triple?

$3P=Pe^{0.05T} \Rightarrow 3=e^{0.05T} \Rightarrow T=\dfrac{\ln 3}{0.05}\approx\dfrac{1.0986}{0.05}\approx\boxed{21.97\text{ years}}$

Example 19

Comparing Compounding Frequencies — Solving for Time

At 8% compounded monthly, how long for PKR 100,000 to become PKR 250,000?

$250{,}000 = 100{,}000\left(1+\frac{0.08}{12}\right)^{12T}$

$$2.5=(1.00\overline{6})^{12T} \Rightarrow \ln 2.5=12T\ln(1.00\overline{6}) \Rightarrow T=\frac{\ln 2.5}{12\ln(1.00667)}\approx\frac{0.9163}{0.0799}\approx\boxed{11.47\text{ years}}$$

§ 10 — Doubling Time

How Fast Does
a Quantity Double?

Doubling Time Formula

For a quantity growing continuously as $Q(t) = Q_0 e^{kt}$ (with $k>0$):

$$T_{\text{double}} = \frac{\ln 2}{k}$$

Derivation: Set $Q(T)=2Q_0$:

$$2Q_0 = Q_0 e^{kT} \Rightarrow 2=e^{kT} \Rightarrow kT=\ln 2 \Rightarrow T=\frac{\ln 2}{k}$$

Similarly: tripling time $= \dfrac{\ln 3}{k}$, halving time (decay) $= \dfrac{\ln 2}{k}$ with $k<0$.

Rule of 70: For continuous growth at rate $r$ (as a percentage), the doubling time is approximately $70/r$ years. This is because $\ln 2 \approx 0.693 \approx 0.70$. At 7%: doubling time $\approx 70/7 = 10$ years. At 5%: $\approx 14$ years. A quick mental estimate.

Example 20 — A bacterial population grows at rate $k=0.4$ per hour. Find the doubling time.

$T=\dfrac{\ln 2}{0.4}=\dfrac{0.6931}{0.4}\approx\boxed{1.73\text{ hours}}$. So the population doubles every 1.73 hours.

Example 21 — Pakistan's GDP grows at 4.5% per year continuously. When will it double?

$k=0.045$. $T=\dfrac{\ln 2}{0.045}\approx\dfrac{0.6931}{0.045}\approx\boxed{15.4\text{ years}}$.

Example 22 — A population grows from 5,000 to 8,000 in 6 years. Find $k$ and the doubling time.

$8000=5000e^{6k} \Rightarrow e^{6k}=1.6 \Rightarrow 6k=\ln 1.6 \Rightarrow k=\dfrac{\ln 1.6}{6}\approx\dfrac{0.4700}{6}\approx 0.0784$

$T=\dfrac{\ln 2}{0.0784}\approx\boxed{8.84\text{ years}}$.

§ 11 — Radioactive Decay & Carbon Dating

Reading the Clock
Buried in Every Living Thing

The Discovery that Changed History

In 1949, American chemist Willard Libby developed radiocarbon dating — a technique that uses the known decay rate of $^{14}\text{C}$ (carbon-14) to determine the age of organic materials up to about 50,000 years old. Libby won the Nobel Prize in Chemistry in 1960.

Every living organism absorbs carbon from the atmosphere, including a small fixed ratio of radioactive $^{14}\text{C}$ alongside stable $^{12}\text{C}$. When the organism dies, it stops absorbing carbon. The $^{14}\text{C}$ already present begins decaying at a known, constant rate.

By measuring how much $^{14}\text{C}$ remains in a sample, we can compute how long ago the organism died. This has been used to date the Dead Sea Scrolls, Egyptian mummies, the Shroud of Turin, and the remains of ancient civilisations across the world.

Radioactive Decay Model

The amount $Q(t)$ of a radioactive substance remaining at time $t$ satisfies:

$$Q(t) = Q_0 e^{-kt} \quad (k > 0)$$

where $Q_0$ is the initial amount and $k>0$ is the decay constant.

The half-life $T_{1/2}$ satisfies $Q(T_{1/2}) = Q_0/2$:

$$T_{1/2} = \frac{\ln 2}{k}$$

Carbon-14 has a half-life of approximately 5,730 years. So $k = \ln 2 / 5730 \approx 0.0001209$ per year.

Example 23

Age of an Archaeological Sample

A piece of charcoal from an ancient fire site contains 72% of the $^{14}$C expected in living wood. How old is it? (Half-life of $^{14}$C $\approx 5{,}730$ years)

Find k: $k=\dfrac{\ln 2}{5730}\approx 0.0001209$ per year.

Set up: $0.72Q_0 = Q_0 e^{-0.0001209\,t} \Rightarrow e^{-0.0001209t}=0.72$

$$-0.0001209\,t=\ln(0.72)\approx -0.3285 \Rightarrow t\approx\frac{0.3285}{0.0001209}\approx\boxed{2{,}717\text{ years old}}$$

Example 24

Remaining Activity

Polonium-210 has a half-life of 138 days. A sample initially has 50 mg. How much remains after 200 days?

Find k: $k=\dfrac{\ln 2}{138}\approx 0.005022$ per day.

$$Q(200)=50e^{-0.005022\times200}=50e^{-1.0044}\approx50\times0.3663\approx\boxed{18.3\text{ mg}}$$

Example 25

Finding the Half-Life

A radioactive isotope decays from 80 g to 52 g in 40 years. Find the half-life.

Find k: $52=80e^{-40k} \Rightarrow e^{-40k}=0.65 \Rightarrow -40k=\ln(0.65) \Rightarrow k\approx\dfrac{0.4308}{40}\approx 0.01077$

$$T_{1/2}=\frac{\ln 2}{k}\approx\frac{0.6931}{0.01077}\approx\boxed{64.4\text{ years}}$$

Example 26

Carbon Dating — The Dead Sea Scrolls

The Dead Sea Scrolls were tested and found to contain about 78% of the expected $^{14}$C. Estimate their age.

$0.78 = e^{-0.0001209\,t}$

$$t=\frac{-\ln(0.78)}{0.0001209}=\frac{0.2485}{0.0001209}\approx\boxed{2{,}055\text{ years old}}$$

Historical records date them to roughly 100 BC–70 AD (2,000–2,100 years ago) ✓ — a remarkable confirmation of the method.

Coming up next — §4.3 Differentiation of Exponential and Logarithmic Functions — we derive $\frac{d}{dx}[e^x]=e^x$ and $\frac{d}{dx}[\ln x]=\frac{1}{x}$, and learn the chain rule versions for general bases.