Logarithmic Graphs

The exponential reflected in y = x.

Start from y = 2ˣ

The graph of y = 2ˣ passes through (0, 1), (1, 2), (2, 4) and (3, 8), doubling its height at each step to the right. To the left it halves instead, through (−1, 1/2) and (−2, 1/4), closing in on the x-axis without reaching it. Every power of 2 is positive, so the whole curve lies above the x-axis.

So y = 2ˣ takes any number x as an input, and its outputs are the positive numbers only. The logarithm to base 2 undoes it: log₂ x is the power of 2 that gives x. Its graph is found from the graph of y = 2ˣ in one move.

Swapping x and y is a reflection

A function and its inverse undo each other. If y = 2ˣ sends 2 to 4, then log₂ sends 4 back to 2. So the point (2, 4) on the graph of y = 2ˣ becomes the point (4, 2) on the graph of y = log₂ x. The input and the output change places.

Swapping the coordinates of a point reflects it in the line y = x. Take (2, 4) and (4, 2). The segment joining them has gradient (2 − 4) ÷ (4 − 2) = −1, and the line y = x has gradient 1. The product of the gradients is −1, so the segment crosses y = x at a right angle. Its midpoint is ((2 + 4)/2, (4 + 2)/2) = (3, 3), which lies on y = x. So (4, 2) is the mirror image of (2, 4) in that line, and the same argument works for any point (a, b) and its swap (b, a).

A reflection only looks like one when the two axes have the same scale. On a stretched grid the line y = x is not at 45°, and the two curves stop looking like mirror images.

The graph of y = log₂ x

Reflect every point of y = 2ˣ in y = x. The points (−2, 1/4), (−1, 1/2), (0, 1), (1, 2), (2, 4) and (3, 8) become (1/4, −2), (1/2, −1), (1, 0), (2, 1), (4, 2) and (8, 3). Each one is a logarithm fact: (8, 3) says log₂ 8 = 3, and (1/2, −1) says log₂ (1/2) = −1.

Read along the new curve: each time x doubles, y goes up by exactly 1. From x = 1 to 2 it rises 1, and from x = 4 to 8 it also rises only 1, over a much longer stretch. So the curve climbs more and more slowly.

xy

The gold curve is y = log₂ x, the white curve is y = 2ˣ, and the white straight line is y = x. The pairs (2, 4) and (4, 2), (0, 1) and (1, 0), and (−1, 1/2) and (1/2, −1) are mirror images in y = x.

Every base greater than 1

The same reflection works for any base a greater than 1. Three points on y = logₐ x come straight from the powers of a. Since a⁰ = 1, the curve passes through (1, 0). Since a¹ = a, it passes through (a, 1). Since a⁻¹ = 1/a, it passes through (1/a, −1).

So every logarithm graph crosses the x-axis at x = 1. The base decides how fast it climbs after that: y = log₁₀ x passes through (10, 1) and (0.1, −1), so it needs x = 10 to reach the height that y = log₂ x reaches at x = 2. To the right of x = 1, a bigger base gives a flatter curve: its exponential climbs more steeply, and the reflection of a steeper curve is a flatter one.

The y-axis is an asymptote

No power of 2 is 0, and no power of 2 is negative. So log₂ 0 and log₂ (−1) do not exist, and the graph has no points at all for x ≤ 0. The domain of y = log₂ x is x > 0.

Close to 0 the curve falls steeply. log₂ (1/2) = −1, log₂ (1/1024) = −10, and log₂ of one millionth is about −19.93. Each halving of x takes the curve down by 1 more, and x can be halved forever without reaching 0. So the curve runs down alongside the y-axis without ever touching it: the y-axis is a vertical asymptote.

This is the reflection of a fact about y = 2ˣ. The x-axis is a horizontal asymptote of y = 2ˣ on the left, and reflecting in y = x turns the x-axis into the y-axis.

xy

y = log₂ x through (1/4, −2), (1/2, −1), (1, 0), (2, 1) and (4, 2). To the left of x = 1 each halving of x lowers the curve by 1, and it runs down alongside the y-axis. Nothing is drawn to the left of the y-axis.

No ceiling

To the right the curve keeps climbing, however slowly. log₂ 1024 = 10 and log₂ 1048576 = 20, so the curve reaches every height: a height h is reached at x = 2ʰ. It never levels off, so it has no horizontal asymptote. The range of y = log₂ x is every real number, which is the domain of y = 2ˣ, just as its domain, x > 0, is the range of y = 2ˣ.

Moving the graph

Transforming Graphs gave the rules: a number added outside the function moves the graph up or down, and a number inside the bracket moves it left or right, the opposite way to its sign. For a logarithm graph, remember to move the asymptote too.

y = log₂ (x − 3) is y = log₂ x moved 3 to the right. The input x − 3 must be positive, so the domain is x > 3, and the asymptote is the line x = 3. The landmarks move 3 right as well: (1, 0) goes to (4, 0), and (2, 1) goes to (5, 1). Check: log₂ (4 − 3) = log₂ 1 = 0.

y = log₂ x + 2 is y = log₂ x moved 2 up. The asymptote is still the y-axis, and the curve crosses the x-axis where log₂ x = −2, at x = 1/4. y = log₂ (x + 1) is y = log₂ x moved 1 to the left, with the asymptote x = −1, and it passes through the origin, since log₂ 1 = 0.

xy

The white curve is y = log₂ x, through (1, 0) and (2, 1). The gold curve is y = log₂ (x − 3), through (4, 0) and (5, 1): every point has moved 3 to the right, and its asymptote is the dashed line x = 3.

A stretch that is also a translation

A logarithm graph has one more property that other graphs do not. By the product law, log₂ (8x) = log₂ 8 + log₂ x = 3 + log₂ x. So squeezing the graph of y = log₂ x horizontally by a factor of 8, which gives y = log₂ (8x), draws exactly the same curve as moving it 3 up. Every horizontal stretch of a logarithm graph is a vertical translation.

The usual mistakes

Drawing y = log₂ x through (0, 1). That point belongs to y = 2ˣ. Swapped, it becomes (1, 0): every logarithm graph crosses the x-axis at x = 1 and never meets the y-axis.

Reading the coordinates the wrong way round. The point (8, 3) on y = log₂ x says log₂ 8 = 3: the number 8 is across, and its logarithm 3 is up. The logarithm is the power, not the number itself.

Letting the curve cross the y-axis. There is no logarithm of 0 or of a negative number, so nothing is drawn for x ≤ 0.

Drawing the curve leveling off to a horizontal line. It climbs slowly, but it reaches every height.

Moving y = log₂ (x − 3) to the left. The input is 3 less than x, so the curve reaches each height 3 later, to the right, and its asymptote moves to x = 3.

Worked example: The Magnitude of an Earthquake from a Seismograph: A Logarithmic Graph, and the Same Graph at a More Distant Station

Question At a seismograph station 100 km from an earthquake, the magnitude of the earthquake is M = log10 A, where A micrometers is the greatest swing of the recording needle. (a) An earthquake swings the needle by 5000 micrometers at this station. Find its magnitude, to 1 decimal place. (b) At a station 300 km from an earthquake the waves have spread out further, and the magnitude is M = log10 A + 1. Describe how the graph of this function is obtained from the graph of M = log10 A, and find, to the nearest 10 micrometers, the swing of the needle that the same earthquake makes at the 300 km station.

  1. 1.On the graph of M = log10 A, each tenfold swing adds 1: log10 1000 = 3 and log10 10 000 = 4. A swing of 5000 micrometers lies between these, so its magnitude is between 3 and 4.

    01234501000500010000swing of the needle (micrometers), Amagnitude, M(1000, 3)(10 000, 4)each tenfold swing adds 1 to Mlog 1000 = 3 and log 10 000 = 4
    01234501000500010000swing of the needle (micrometers), Amagnitude, M(1000, 3)(10 000, 4)each tenfold swing adds 1 to Mlog 1000 = 3 and log 10 000 = 4
    The graph of M = log10 A climbs 1 for every tenfold swing: log10 1000 = 3 and log10 10 000 = 4.
  2. 2.(a) log10 5000 = log10 5 + log10 1000 = 0.699 + 3 = 3.699, so the magnitude is 3.7 to 1 decimal place.

    01234501000500010000swing of the needle (micrometers), Amagnitude, M(1000, 3)(10 000, 4)3.7log 5000 = log 5 + log 1000= 0.699 + 3 = 3.699, so M = 3.7
    01234501000500010000swing of the needle (micrometers), Amagnitude, M(1000, 3)(10 000, 4)3.7log 5000 = log 5 + log 1000= 0.699 + 3 = 3.699, so M = 3.7
    (a) log10 5000 = 0.699 + 3 = 3.699, so the magnitude is 3.7.
  3. 3.In M = log10 A + 1 the 1 is added outside the logarithm, to the output. Every point (A, M) of the first graph moves to (A, M + 1): the graph is translated 1 unit up, in the direction of the M-axis.

    01234501000500010000swing of the needle (micrometers), Amagnitude, Mup 13.7M = log A + 1: every point moves up 1a translation of 1 unit up
    01234501000500010000swing of the needle (micrometers), Amagnitude, Mup 13.7M = log A + 1: every point moves up 1a translation of 1 unit up
    Adding 1 outside the logarithm moves every point of the graph 1 unit up: M = log10 A + 1 is a translation of M = log10 A.
  4. 4.The magnitude belongs to the earthquake, not to the station, so it is still 3.699 at 300 km. Solve log10 A + 1 = 3.699: log10 A = 2.699, so A = 102.699 ≈ 500. Exactly: log10 A = log10 5000 − log10 10 = log10 500.

    01234501000500010000swing of the needle (micrometers), Amagnitude, Mup 13.7the same earthquake: log A + 1 = 3.699log A = 2.699, so A = 500
    01234501000500010000swing of the needle (micrometers), Amagnitude, Mup 13.7the same earthquake: log A + 1 = 3.699log A = 2.699, so A = 500
    The earthquake keeps its magnitude, 3.699. On the upper graph that height is reached at log10 A = 2.699, so A = 500.
  5. 5.(b) The new graph is the graph of M = log10 A translated 1 unit up, and the same earthquake swings the needle by 500 micrometers at the 300 km station, a tenth of the swing at 100 km. Check: log10 500 + 1 = 2.699 + 1 = 3.699.

    01234501000500010000swing of the needle (micrometers), Amagnitude, Mup 13.7A = 500the needle swings 500 micrometerscheck: log 500 + 1 = 2.699 + 1 = 3.699
    01234501000500010000swing of the needle (micrometers), Amagnitude, Mup 13.7A = 500the needle swings 500 micrometerscheck: log 500 + 1 = 2.699 + 1 = 3.699
    (b) The graph is translated 1 unit up, and at 300 km the needle swings 500 micrometers, a tenth of the swing at 100 km.

Answer: (a) 3.7; (b) a translation of 1 unit up, in the direction of the M-axis; a swing of 500 micrometers

Common mistakes

  • Moving the graph 1 unit sideways, as if the function were log10(A + 1). The 1 is added after the logarithm is taken, to the output, so the graph moves up. log10(A + 1) would add 1 to the input and move the graph 1 unit to the left.
  • Putting the same swing of 5000 micrometers into the new formula and giving a magnitude of 4.7. One earthquake has one magnitude. The formula for the further station adds 1 to make up for the spreading of the waves, so the swing it records must be smaller: a tenth, 500 micrometers.

More functions problems, worked step by step →

Practice Logarithmic Graphs in the app