01 / 21

Logarithmic Functions
Context & Data Modeling

Learn how logarithmic functions model real-world phenomena: from earthquake magnitudes to sound intensity, and master the art of fitting log models to data.

AP Precalculus

What Is a Logarithm?

A logarithm answers the question: to what power must we raise a base to get a given number? If \( b^c = x \), then \( \log_b(x) = c \).

\( \log_{10}(1000) \)
\( = 3 \) because \( 10^3 = 1000 \)
\( \ln(e^5) \)
\( = 5 \) because \( e^5 = e^5 \)

The Shape of \( y = \log_b(x) \)

x y x = 0 1 2 3 4 2 0 -2 (1, 0)
\( \log_2(x) \)
\( \ln(x) \)

Why Logs Model Real Data

Many real-world phenomena exhibit rapid initial growth that tapers off: the louder a sound gets, the less additional loudness we perceive. Logarithmic models capture this diminishing-returns pattern perfectly.

Richter Scale
Earthquake magnitude: each +1 unit = 10x more wave amplitude. Uses \( \log_{10} \).
Decibels
Sound intensity: \( \text{dB} = 10\log_{10}(I/I_0) \). Compresses a huge range.
pH Scale
Acidity: \( \text{pH} = -\log_{10}[\text{H}^+] \). Each unit = 10x concentration change.

The General Logarithmic Model

If \( b > 0 \)
Function is increasing: models growth that slows over time.
If \( b < 0 \)
Function is decreasing: models decay or diminishing quantities.

Transformations of \( \log \) Functions

x y 1 2 3 4 5 1 0 -1 2 3
\( \ln(x) \)
\( 2\ln(x) \)
\( \ln(x-1)+1 \)

Exponential vs Logarithmic

Exponential \( b^x \) Logarithmic \( \log_b(x) \)
Domain \( (-\infty, \infty) \) \( (0, \infty) \)
Range \( (0, \infty) \) \( (-\infty, \infty) \)
Asymptote Horizontal: \( y = 0 \) Vertical: \( x = 0 \)
Key Point \( (0, 1) \) \( (1, 0) \)
Growth Rate Accelerates without bound Slows as \( x \to \infty \)
Relationship Inverse functions: reflect across \( y = x \)

Is Your Data Logarithmic?

1
Plot the data. Look for rapid initial increase that levels off: steep rise on the left, flattening on the right.
2
Check the domain. All input values must be positive (\( x > 0 \)). If \( x \leq 0 \) appears, a log model does not apply.
3
Linearize the data. Replace each \( x \) with \( \ln(x) \). If the resulting scatter plot of \( (\ln x, y) \) is approximately linear, a log model fits.
4
Fit the model. Perform linear regression on \( (\ln x, y) \) to find \( a \) and \( b \) in \( y = a + b\ln(x) \).

Fitting a Log Model to Data

1
Compute \( \ln(x_i) \) for each data point \( (x_i, y_i) \).
2
Create a new table of \( (t_i, y_i) \) where \( t_i = \ln(x_i) \).
3
Run linear regression on \( (t, y) \) to find slope \( b \) and intercept \( a \): \( y = a + bt \).
4
Substitute back: replace \( t \) with \( \ln(x) \) to get \( y = a + b\ln(x) \).
5
Interpret: \( a \) is the predicted output when \( x = 1 \); \( b \) is the change in \( y \) per unit change in \( \ln(x) \).

Example 1: Sound Intensity

A researcher measures perceived loudness \( L \) (in sones) at various sound intensities \( I \) (in watts/m²):

\( I \) (W/m²) 0.001 0.01 0.1 1 10
\( L \) (sones) 2.1 5.8 9.4 13.1 16.7

Example 1: Visualizing the Fit

I L 0.001 0.01 0.1 1 10 0 5 10 15 20 Data Model

Example 2: Population & Species Count

An ecologist records the number of distinct bird species \( S \) observed in forest patches of area \( A \) (in km²):

\( A \) (km²) 1 5 20 100 500
\( S \) 12 22 31 42 51

Example 3: Predicting with a Log Model

Using the species-area model \( S = 12.0 + 6.3\ln(A) \), predict how many species will be found in a 50 km² patch and a 1000 km² patch.

\( A = 50 \)
\( S = 12.0 + 6.3\ln(50) \)
\( \approx 12.0 + 6.3(3.912) \)
\( \approx 12.0 + 24.65 \)
\( \approx \) 37 species
\( A = 1000 \)
\( S = 12.0 + 6.3\ln(1000) \)
\( \approx 12.0 + 6.3(6.908) \)
\( \approx 12.0 + 43.52 \)
\( \approx \) 56 species

Checking Model Fit with Residuals

A residual is the difference between an observed value and the model's prediction: \( e_i = y_i - \hat{y}_i \). A good fit produces residuals that are small and randomly scattered around zero.

1
Compute residuals for each data point using the fitted model.
2
Plot residuals vs \( x \) (or \( \ln x \)). Look for random scatter: no curves, no fan shapes.
3
If a pattern appears, the model may not be the best fit: consider a different function family (power, polynomial).

Common Mistakes to Avoid

✕ Using log on negative inputs
The domain of \( \log_b(x) \) is \( x > 0 \). Plugging in \( x \leq 0 \) is undefined: always check the domain.
✕ Confusing \( \ln \) and \( \log \)
On AP exams, \( \log \) often means \( \log_{10} \) and \( \ln \) means \( \log_e \). Mixing them up changes your coefficients.
✕ Extrapolating too far
Log models grow without bound as \( x \to \infty \), but real-world quantities often have caps. Only predict within or near the data range.

Summary: Log Models at a Glance

Property Details
General Form \( f(x) = a + b\ln(x) \)
Domain \( x > 0 \) (or \( x > h \) if shifted)
Asymptote Vertical at \( x = 0 \) (or \( x = h \))
Key Point \( (1, a) \) since \( \ln(1) = 0 \)
Linearization Replace \( x \) with \( \ln(x) \), then do linear regression
When to Use Rapid initial growth that slows: diminishing returns
Check Fit Residuals should be small and randomly scattered

Question 1 of 5

A data set has all positive \( x \)-values. When you plot \( (\ln x, y) \), the points form an approximately linear pattern. Which model best fits the original data?

Question 2 of 5

Given the model \( f(x) = 5 + 3\ln(x) \), what is the value of \( f(e^2) \)?

Question 3 of 5

The function \( g(x) = 20 - 4\ln(x) \) models a quantity over time. As \( x \to \infty \), what happens to \( g(x) \)?

Question 4 of 5

A researcher fits \( y = 8.2 + 4.5\ln(x) \) to her data. The residual plot of \( (\ln x, e_i) \) shows a clear U-shaped curve. What should she conclude?

Question 5 of 5

The Richter scale defines earthquake magnitude as \( M = \log_{10}\!\left(\frac{I}{I_0}\right) \). An earthquake of magnitude 6 has intensity \( I_6 \). What is the intensity of a magnitude 8 earthquake relative to \( I_6 \)?