Mathwords logoMathwords

Logarithmic Function — Definition, Formula & Examples

A logarithmic function is the inverse of an exponential function — it answers the question "what exponent do I need?" For example, log2(8)=3\log_2(8) = 3 because 23=82^3 = 8.

The logarithmic function with base bb (where b>0b > 0 and b1b \neq 1) is defined as f(x)=logb(x)f(x) = \log_b(x), where logb(x)=y\log_b(x) = y if and only if by=xb^y = x. Its domain is (0,)(0, \infty) and its range is (,)(-\infty, \infty).

Key Formula

y=logb(x)by=xy = \log_b(x) \quad \Longleftrightarrow \quad b^{\,y} = x
Where:
  • bb = Base of the logarithm (b > 0, b ≠ 1)
  • xx = Argument (input); must be positive
  • yy = Output — the exponent that b must be raised to in order to equal x

How It Works

To evaluate logb(x)\log_b(x), ask yourself: "bb raised to what power gives xx?" The graph of y=logb(x)y = \log_b(x) passes through (1,0)(1, 0) for every base, because b0=1b^0 = 1. When b>1b > 1, the function increases slowly and has a vertical asymptote at x=0x = 0. When 0<b<10 < b < 1, the function is decreasing instead. You can convert between logarithmic and exponential form freely: logb(x)=y\log_b(x) = y is the same statement as by=xb^y = x.

Worked Example

Problem: Evaluate log5(125)\log_5(125).
Rewrite as an exponential question: Ask: 5 raised to what power equals 125?
5y=1255^{\,y} = 125
Find the exponent: Since 53=1255^3 = 125, the exponent is 3.
53=1255^3 = 125
State the result: Therefore the logarithm equals 3.
log5(125)=3\log_5(125) = 3
Answer: log5(125)=3\log_5(125) = 3

Why It Matters

Logarithmic functions appear whenever you solve exponential equations — for instance, finding how long an investment takes to double or how many half-lives a radioactive sample has undergone. They also form the basis of the Richter scale, the decibel scale, and the pH scale in chemistry.

Common Mistakes

Mistake: Trying to take the logarithm of zero or a negative number.
Correction: The domain of logb(x)\log_b(x) is x>0x > 0 only. Expressions like log2(4)\log_2(-4) or log3(0)\log_3(0) are undefined in the real numbers.