Learn
Lesson · Exponential and Logarithmic Functions · Logarithms

Logarithmic Functions and Their Graphs

g(x) = log_b(x) is the inverse of f(x) = b^x, so its graph is that curve reflected in the line y = x. The domain, the range, the asymptote and the slowness of the climb are all consequences of the reflection rather than separate facts to memorise.

g(x) = log_b(x) is the inverse of f(x) = b^x domain x > 0 range every real number (p, q) on b^x ⟺ (q, p) on log_b(x) asymptote x = 0 always through (1, 0) and (b, 1)
The inverse, and what it inherits

Core ideas

What this lesson establishes

One picture and one table serve both functions. Read the table down for the exponential and across for the logarithm.

1

Reflection in y = x swaps the coordinates

If (p, q) lies on the graph of an invertible function, (q, p) lies on the graph of its inverse. 2³ = 8 puts (3, 8) on y = 2^x and (8, 3) on y = log_2(x). There is one set of pairs here, read in two directions.

2

Domain and range trade places

b^x accepts every real number and returns only positive ones. So log_b(x) accepts only positive numbers and returns every real one. The exclusion of x ≤ 0 is not an extra rule bolted on; it is the range of the exponential seen from the other side.

3

The asymptote turns through a right angle

y = b^x flattens toward the horizontal line y = 0. Reflecting that line in y = x gives the vertical line x = 0, and that is the logarithm's asymptote: the curve plunges without bound as x comes down toward 0 from the right.

The material

The inverse curve

Why the reflection is the whole picture, and what can be read off it before anything is plotted.

Lines, Functions and Graphs defined an inverse function: g undoes f when g(f(x)) = x and f(g(x)) = x, and a function has one only if it is one-to-one. f(x) = b^x is strictly increasing when b > 1 and strictly decreasing when 0 < b < 1, so it never repeats a value and the inverse exists without any restriction of the domain — which is unusual, and is why logarithms are as well-behaved as they are.

Definition · Logarithmic function

For b > 0 with b ≠ 1, the logarithmic function with base b is g(x) = log_b(x), defined for x > 0. It is the inverse of f(x) = b^x: log_b(b^x) = x for every real x, and b^(log_b(x)) = x for every x > 0.

f(x) = 2^x g(x) = log_2(x) x f(x) x g(x) −3 1/8 1/8 −3 −2 1/4 1/4 −2 −1 1/2 1/2 −1 0 1 1 0 1 2 2 1 2 4 4 2 3 8 8 3 the same seven pairs, with the two columns exchanged

What to read off the graph

  • Domain x > 0. There is no curve at all to the left of the vertical axis, and none on it.
  • Range: every real number. The curve has no ceiling and no floor; each height is reached exactly once.
  • Through (1, 0). b^0 = 1 for every allowed base, so log_b(1) = 0. Every logarithmic curve crosses the horizontal axis at 1, whatever the base.
  • Through (b, 1). b^1 = b. This is the point that tells two bases apart on a drawing.
  • No vertical intercept. x = 0 is outside the domain, so the curve never meets the vertical axis.
  • Increasing for b > 1, decreasing for 0 < b < 1. The direction is inherited from the exponential it reflects.

It rises without bound, and it rises slowly

Both halves of that sentence matter. To lift log_10(x) by one you must multiply x by ten, so the output crawls while the input explodes. But there is no height it fails to reach eventually.

x 1 10 100 1000 10⁶ 10¹⁰⁰ log_10(x) 0 1 2 3 6 100 the input is multiplied by 10 to move the output by 1

That last line is the reason decibels, pH and earthquake magnitude are logarithms, which is “Logarithmic Scales”. It is also why a logarithmic curve looks flat on any drawing wide enough to be interesting — flat is not level, and the two are easy to confuse by eye.

Shifting the curve moves the asymptote with it

log_b(x − h) is the same curve moved h to the right, and the asymptote goes with it to x = h. The domain becomes x > h. This is the commonest source of a wrong domain in the whole course, because the shift is invisible unless you look inside the brackets.

Example · y = log_3(x − 5)

The argument must be positive: x − 5 > 0, so the domain is x > 5 and the asymptote is the vertical line x = 5. The curve passes through (6, 0), because x − 5 = 1 there and log_3(1) = 0, and through (8, 1), because x − 5 = 3 and log_3(3) = 1. It is the standard shape, five units to the right.

One case worth having met early: the domain is decided by the argument being positive, not by x being positive. log_2(x²) is defined for every x ≠ 0, negative values included, because x² is positive there. “The Laws of Logarithms” shows why that makes one of the three laws need a careful statement.

Interactive

The graph, and its reflection

y = b^x and y = log_b(x) across the line y = x

Logarithm
y = b^xy = log_b(x)y = xasymptotes

Method

Sketching y = log_b(x)

Four marks on the page, in this order, and the shape is fixed.

1

Draw the asymptote first, dashed

x = 0, or x = h if the argument is x − h. Putting it down before the curve stops the sketch from wandering into a region where the function does not exist.

2

Plot the two free points

(1, 0) and (b, 1) lie on every logarithmic curve, straight from the definition. For base 3 they are (1, 0) and (3, 1); shift both if the argument is shifted.

3

Add one point on the other side of x = 1

(1/b, −1). Without it the sketch tends to stop at the axis instead of diving, and the diving part is the half that carries the asymptote.

4

Write the domain beside the sketch

x > 0, or whatever makes the argument positive. A logarithmic graph without its domain is the half of the answer that gets marked wrong, and it is the half “Solving Logarithmic Equations” depends on.

Domain, points, direction

Score 0 / 0

Base 2, then the same curve shifted

The first block is one table read twice. The second is what happens to every one of those facts when the argument changes.

y = 2^x y = log_2(x) (−3, 1/8) (1/8, −3) (−1, 1/2) (1/2, −1) ( 0, 1) (1, 0) ( 1, 2) (2, 1) ( 3, 8) (8, 3) domain: all real x domain: x > 0 range: y > 0 range: all real y asymptote y = 0 asymptote x = 0 now y = log_2(x − 5) argument positive x − 5 > 0 ⟹ x > 5 asymptote x = 5 x − 5 = 1 x = 6 y = 0 x − 5 = 2 x = 7 y = 1 x − 5 = 4 x = 9 y = 2 x − 5 = 1/2 x = 11/2 y = −1

The domain x > 5 is not a decoration on the answer. log_2(2 − 5) = log_2(−3) names no real number, so the curve has nothing at all to the left of 5, and a candidate solution of x = 2 to any equation built from this expression is not a solution. “Solving Logarithmic Equations” is built on precisely that check.

Note that the shift moved the two free points too. (1, 0) became (6, 0) and (2, 1) became (7, 1). Nothing about the shape changed; every landmark moved five to the right, the asymptote included.

For a faded sketch, use g(x) = log_4(x + 3). The first line is supplied: x + 3 > 0. Finish the domain, draw the vertical asymptote, move the three anchor inputs 1, 4 and 1/4 through the shift, and state the direction. Check each plotted point by converting it back to an exponential equation.

Common mistakes

1
Giving the domain of log_b(x − 5) as x > 0The rule is that the argument is positive, and the argument here is x − 5. Solve x − 5 > 0. Reading the domain off the bare log_b(x) skips the shift, and the shift is the only thing that changed.
2
Expecting the curve to level offlog_b(x) has no upper bound. It climbs slowly — log_10 needs an input of 10¹⁰⁰ to reach 100 — but every height is reached in the end. Slow is not the same as bounded, and on a drawing they look identical.
3
Reflecting in the wrong lineThe inverse is the reflection in y = x, which exchanges the coordinates. Reflecting in the horizontal axis gives y = −b^x and reflecting in the vertical axis gives y = b^(−x). Neither is a logarithm, and neither has a vertical asymptote.

Check your understanding

✓
Finish when you state domain, asymptote and two points before drawing anything.

Given y = log_5(x + 2) you should say: domain x > −2, asymptote x = −2, through (−1, 0) and (3, 1), increasing. If you need a table of values to get there, the reflection has not landed as a fact you can use.

Note: The lab draws both curves from one base with y = x between them, so the reflection is something you watch rather than something you take on trust. If a sketch of yours disagrees with the picture there, it is worth finding out which landmark you moved — it is almost always the asymptote.

Kept in this browser only, for you. Nothing is sent anywhere and nothing checks it. Carry it to another device.

Feedback and recommendations

Something to change about this lesson? Write it down, tick it off when it is handled, and export the list when you want to act on it. Kept in this browser only: nothing is sent anywhere, and nobody is notified.

No recommendations yet for this lesson.