Logarithmic Functions

The logarithm answers the question: to what power must we raise the base to get this number? Because the exponential function y = bx is one-to-one, every positive output corresponds to exactly one input, and that input is the logarithm. Logarithms and exponential functions are inverses of each other, and this single fact explains all of their properties.

Quick Reference

Concept Notation Meaning
Logarithm definition logb y = x bx = y
Equivalence logb y = xbx = y b > 0, b ≠ 1
Domain of logb x (0, ∞) Input must be positive
Range of logb x (−∞, ∞) Output is all reals
Product rule logb(xy) = logb x + logb y Log of a product
Power rule logb xr = r logb x Exponent comes to the front
Quotient rule logb(y/x) = logb y − logb x Log of a quotient
Common logarithm log x Base 10 (base omitted)
Natural logarithm ln x Base e ≈ 2.71828
Change of base logb x = ln x / ln b Convert any base to ln

Definition

We learned that for b > 0, the expression bx is always positive. Except for b = 1, the function y = bx is either strictly increasing or strictly decreasing, and therefore one-to-one. This means that for any given y > 0, there is exactly one value of x satisfying bx = y.

Graphs illustrating the one-to-one property of exponential functions for b  loading= 1 and 0 < b < 1.">
Exponential functions are one-to-one: for a given y > 0, there exists exactly one value of x satisfying bx = y.

This unique value of x is called the logarithm of y to the base b, written logb y. The defining equivalence is:

Definition. For b > 0, b ≠ 1, and y > 0:

$x = \log_b y \iff y = b^x$

In words: logb y is the exponent to which b must be raised to produce y.

For example:

  • log2 16 = 4   because   24 = 16
  • log10 0.001 = −3   because   10−3 = 0.001

The definition above expresses x as a function of y. Swapping the roles of the variables in the usual way (writing the input as x and the output as y), the logarithmic function with base b is:

$y = \log_b x, \qquad x > 0.$

Domain, Range, and the Inverse Relationship

Because logb x and bx are inverse functions, the domain of each is the range of the other:

Let f(x) = logb x and g(x) = bx. Then:

$\operatorname{Dom}(f) = \operatorname{Rng}(g) = (0,\infty)$$\operatorname{Rng}(f) = \operatorname{Dom}(g) = (-\infty,\infty)$

The inverse relationship also yields two cancellation identities that are used constantly:

Cancellation Identities. For b > 0, b ≠ 1:

$\log_b b^x = x \qquad \text{for all } x$$b^{\log_b x} = x \qquad \text{for } x > 0$

These follow directly from the definition: substituting bx for y in logb y = x gives the first identity; substituting logb y for x in y = bx gives the second.

Graphs of Logarithmic Functions

Since y = logb x is the inverse of y = bx, its graph is the reflection of the exponential graph in the line y = x. Key features:

  • The graph passes through (1, 0) because logb 1 = 0 for any base (since b0 = 1).
  • When b > 1, the function is increasing; when 0 < b < 1, it is decreasing.
  • The y-axis (x = 0) is a vertical asymptote.
Graphs showing the logarithmic function y = log_b(x) as the reflection of the exponential function y = bˣ across the line y = x for b  loading= 1.">
(a) b > 1: the graphs of y = bx and y = logb x are reflections in the line y = x. The exponential passes through (0, 1) and the logarithm passes through (1, 0).
Graphs showing the logarithmic function y = log_b(x) as the reflection of the exponential function y = bˣ across the line y = x for 0 < b < 1.
(b) 0 < b < 1: same reflection relationship, but both functions are decreasing.

Algebraic Properties of Logarithms

Theorem (Algebraic Properties of Logarithms). Let b > 0, b ≠ 1, x > 0, y > 0, and let r be any real number. Then:

  1. Product rule: logb(xy) = logb x + logb y
  2. Power rule: logb xr = r logb x
  3. Quotient rule: logb(y/x) = logb y − logb x
In words: (1) the log of a product is the sum of the logs; (2) an exponent inside a log moves to the front as a multiplier; (3) the log of a quotient is the difference of the logs.
Proof of the Algebraic Properties All three properties follow from the corresponding properties of exponential functions. Proof of (1): Product rule.

Let logb x = α and logb y = β, so x = bα and y = bβ. Then: $\begin{aligned} \log_b(xy) &= \log_b\!\left(b^\alpha \cdot b^\beta\right) \\ &= \log_b\!\left(b^{\alpha+\beta}\right) \qquad (b^\alpha \cdot b^\beta = b^{\alpha+\beta}) \\ &= \alpha + \beta \qquad\qquad\quad (\log_b b^u = u) \\ &= \log_b x + \log_b y \end{aligned}$ Proof of (2): Power rule.

Let logb x = α, so x = bα. Then xr = (bα)r = brα, and: $\begin{aligned} \log_b x^r &= \log_b\!\left(b^{r\alpha}\right) \\ &= r\alpha \qquad (\log_b b^u = u) \\ &= r \log_b x \end{aligned}$ Note: when r is a positive integer, this also follows directly from repeated application of the product rule. For example, logb x2 = logb(x · x) = logb x + logb x = 2 logb x. The general proof above covers all real r.

Proof of (3): Quotient rule.

Write y/x = y · x−1 and apply the product and power rules: $\begin{aligned} \log_b\!\left(\frac{y}{x}\right) &= \log_b\!\left(y \cdot x^{-1}\right) \\ &= \log_b y + \log_b x^{-1} \qquad \text{(Product rule)} \\ &= \log_b y - \log_b x \qquad\quad \text{(Power rule, } r = -1\text{)} \end{aligned}$

Example 1. Use the properties of logarithms to expand or simplify each expression.

  1. log2(8x3)
  2. log5(√x / 25)
  3. 3 ln x + ln(x + 1) − 2 ln y
Solution (a) log2(8x3) = log2 8 + log2 x3 = 3 + 3 log2 x

We used: log2 8 = 3 (since 23 = 8), the product rule, and the power rule.

(b) Writing √x = x1/2: $\log_5\!\left(\frac{\sqrt{x}}{25}\right) = \log_5 x^{1/2} - \log_5 25 = \frac{1}{2}\log_5 x - 2$ We used: log5 25 = 2 (since 52 = 25), the quotient rule, and the power rule.

(c) Combining into a single logarithm: $3\ln x + \ln(x+1) - 2\ln y = \ln x^3 + \ln(x+1) - \ln y^2 = \ln\!\left(\frac{x^3(x+1)}{y^2}\right)$ We used the power rule to move coefficients into exponents, then the product and quotient rules to consolidate.

Common and Natural Logarithms

Theoretically any positive number except 1 may serve as the base of a logarithm. In practice, two bases dominate.

The common logarithm uses base 10 and appears frequently in algebra, trigonometry, and scientific notation. The natural logarithm uses base e ≈ 2.71828 and is essential in calculus. Both have standard abbreviated notations:

  • log10 x is written log x (base omitted)
  • loge x is written ln x
Close-up photo of a scientific calculator showing the LOG and LN keys.
The LOG (base 10) and LN (base e) keys on a typical scientific calculator.

Warning. In computing environments such as Python, MATLAB, Mathematica, C++, and Fortran, log means the natural logarithm. In standard mathematics and calculus courses, log means the base-10 logarithm. Always check the convention of the context you are working in.

Since computer science deals with binary numbers, base-2 logarithms are also widely used in that field.

Change-of-Base Formula

Most calculators provide only LOG and LN keys. To evaluate a logarithm with any other base, use the following result:

Theorem (Change-of-Base Formula). For any base b > 0, b ≠ 1:

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

The same formula works with log in place of ln: logb x = log x / log b.

Derivation Let logb x = α, so x = bα. Taking the natural logarithm of both sides: $\ln x = \ln b^\alpha = \alpha \ln b$ Solving for α: $\alpha = \frac{\ln x}{\ln b}$

Example 2. Evaluate log7 373.

Solution Using the change-of-base formula with natural logarithms: $\log_7 373 = \frac{\ln 373}{\ln 7} = \frac{5.921578}{1.945910} \approx 3.043089$ Verification: 73.043089 ≈ 373. ✓

Frequently Asked Questions

What does a logarithm actually mean? logb y is the answer to: "to what power must b be raised to get y?" For example, log2 8 = 3 because 23 = 8. The logarithm is always an exponent.

Why is the domain of a logarithmic function restricted to positive numbers? Because bx is always positive for any real x, the equation bx = y has no solution when y ≤ 0. Consequently logb y is only defined for y > 0. Attempting to take the log of zero or a negative number is undefined in the real numbers.

What is the difference between log and ln? Both are logarithms; they differ only in base. log (common logarithm) uses base 10: log x = log10 x. ln (natural logarithm) uses base e ≈ 2.71828: ln x = loge x. The natural logarithm is preferred in calculus because the derivative of ln x is simply 1/x, with no extra constant factor.

What are the most common mistakes when applying the log properties?
  • log(x + y) ≠ log x + log y. The product rule applies to a product inside the log, not a sum.
  • log(xy) ≠ (log x)(log y). The product rule gives a sum, not a product.
  • log(xr) = r log x, not (log x)r. The exponent moves in front as a multiplier.
  • Forgetting the domain restriction: logb x requires x > 0.

How do I convert between different logarithm bases? Use the change-of-base formula: logb x = ln x / ln b. This lets you evaluate any logarithm using the LN or LOG key on a calculator. For example, log3 20 = ln 20 / ln 3 ≈ 2.996 / 1.099 ≈ 2.727.

What is the relationship between the graphs of y = bx and y = logb x? They are reflections of each other across the line y = x, because they are inverse functions. Every point (a, c) on the exponential graph corresponds to a point (c, a) on the logarithmic graph. The exponential passes through (0, 1) and the logarithm passes through (1, 0).