Logarithmic Functions

The exponential function y = 2ˣ turns the number 3 into the number 8. What if we want to go the other way, from 8 back to 3? We need a function that answers "what power do you have to raise 2 to in order to get 8". That is the logarithm: log₂ 8 = 3.

The function y = logₐ x is called a logarithmic function. It is the inverse function of the exponential function y = aˣ: it does exactly the opposite job.


Contents


The graph as a mirror image

An inverse function swaps the input and the output. The point (3, 8) lies on the graph of y = 2ˣ, so the point (8, 3) lies on the graph of y = log₂ x. In the same way (0, 1) ↔ (1, 0) and (1, 2) ↔ (2, 1).

Swapping the coordinates is a reflection in the line y = x.

The orange graph of y = 2ˣ and the dashed graph of y = log₂ x are symmetric about the dashed line y = x; the points (0, 1) and (1, 2) on the exponential and (1, 0) and (2, 1) on the logarithm

The graphs of y = aˣ and y = logₐ x are symmetric about the line y = x.

More about inverse functions in the article One-to-One and Inverse Functions.


Properties of the logarithmic function

When x and y swap, the domain and the range swap too:

Propertyy = aˣy = logₐ x
Domainℝ(0, ∞), positive x only
Range(0, ∞)ℝ
Key point(0, 1)(1, 0)
Asymptotethe x-axis (y = 0)the y-axis (x = 0)
Behaviour for a > 1increasingincreasing
  • The domain is the positive numbers only: neither log₂ 0 nor log₂ (−4) exists.
  • The range is all real numbers. A logarithm can be negative too: log₂ ½ = −1.
  • The graph always passes through the point (1, 0), because logₐ 1 = 0, and through the point (a, 1), because logₐ a = 1.
  • The asymptote is the y-axis: as x gets closer to zero, the logarithm decreases (or increases) without limit.

Base greater than 1 and less than 1

The orange graph of y = log₂ x is increasing, the dashed graph of y = log base ½ of x is decreasing; both pass through the point (1, 0)
  • For a > 1 the logarithmic function is increasing (for example log₂ x: 1 → 0, 2 → 1, 4 → 2, 8 → 3). It grows very slowly, though.
  • For 0 < a < 1 it is decreasing (for example log base ½: 2 → −1, 4 → −2).

The graphs of log₂ x and log base ½ of x are symmetric about the x-axis.


Shifted graphs

Just as with other functions:

  • y = logₐ (x − m) is the graph shifted m to the right, and the vertical asymptote is x = m,
  • y = logₐ x + n is the graph shifted n up.

Worked example 1

y = log₂ (x − 1) + 2

  1. Asymptote: x = 1. Domain: x > 1.
  2. The point (1, 0) moves to (2, 2), where the argument is x − 1 = 1.
  3. The base is 2 > 1, so the function is increasing.

The inverse of a shifted exponential

The method is the same as for any inverse function: swap x and y, then make y the subject.

Worked example 2

Find the inverse function of f(x) = 2ˣ + 1.

  1. y = 2ˣ + 1.
  2. Swap: x = 2ʸ + 1.
  3. 2ʸ = x − 1, so y = log₂ (x − 1).

Result: f⁻¹(x) = log₂ (x − 1).

Check the domain and range: f takes values greater than 1, so the domain of f⁻¹ is x > 1. That fits, because the logarithm of x − 1 needs x > 1.

💡 In general: the inverse of y = a^(x − m) + n is y = logₐ (x − n) + m. The shifts swap, just like the coordinates.


Common mistakes

  • "log₂ x is defined for all x." No, only for x > 0.
  • Mixing up the asymptotes. The exponential has a horizontal asymptote (the x-axis), the logarithm a vertical one (the y-axis).
  • The wrong shift in the inverse function. The inverse of y = 2ˣ + 1 is not y = log₂ x − 1 but y = log₂ (x − 1).
  • Reflecting in an axis. The graphs of aˣ and logₐ x are symmetric about the line y = x, not about the y-axis.

Summary

  • y = logₐ x is the inverse function of y = aˣ.
  • Domain (0, ∞), range ℝ, the point (1, 0), the asymptote x = 0.
  • For a > 1 it is increasing, for 0 < a < 1 it is decreasing.
  • The graph is the mirror image of the graph of aˣ in the line y = x.
  • The inverse of y = a^(x − m) + n is y = logₐ (x − n) + m.

Try it yourself

  1. What is the domain of y = log₃ (x + 2)?
  2. Which point does the graph of y = log₅ x pass through where y = 1?
  3. The point (2, 9) lies on the graph of y = 3ˣ. Which point lies on the graph of y = log₃ x?
  4. Find the inverse function of f(x) = 3^(x − 2).
Answers:
  1. x + 2 > 0, so x > −2.
  2. (5, 1).
  3. (9, 2).
  4. x = 3^(y − 2), y − 2 = log₃ x, f⁻¹(x) = log₃ x + 2.

Practice

👉 Back to the start: Exponential Functions