M5.2.7 Chapter 7

Straight lines from logs

Data that rise in a curve are hard to read. How can logs turn them into a straight line, and what do the gradient and the intercept tell us?

Your guess

Pick one before you read on. It is fine to be wrong.

Your guess
  • You picked A. Read on. At the end, the chapter comes back to your guess.

  • You picked B. Read on. At the end, the chapter comes back to your guess.

  • You picked C. Read on. At the end, the chapter comes back to your guess.

By the end you can

  • Turn y = axⁿ into a straight line by taking logs
  • Find a and n from a log graph of real data

A straight line is the easiest graph to work with. You can draw it with a ruler, and its gradient and intercept hold the constants of the rule. A curve y = axⁿ or y = A bˣ has two constants, but they are hard to read from a curve. Logs bend the curve into a line. In this chapter lg means log to the base 10, which keeps graph labels short.

Start with y = axⁿ. Take lg of both sides. The product law gives lg y = lg a + lg (xⁿ). The power law gives lg (xⁿ) = n lg x. So lg y = n lg x + lg a. A paper may use ln on both axes instead. Then the gradient is still n and the intercept is ln a. Compare this with Y = mX + c. If Y stands for lg y and X for lg x, then the gradient m is n and the intercept c is lg a. A graph of lg y against lg x is a straight line. It is called a log-log graph.

Worked example

y = 5x³. Show that lg y against lg x is a straight line, and give its gradient and intercept.

  1. Take lg of both sides: lg y = lg (5x³).
  2. The product law splits the right side: lg (5x³) = lg 5 + lg (x³).
  3. The power law brings the 3 down: lg (x³) = 3 lg x.
  4. So lg y = 3 lg x + lg 5. This has the form Y = mX + c, with Y = lg y and X = lg x.
  5. The gradient is m = 3. The intercept is c = lg 5 = 0.699.

Answer: The gradient is 3 and the intercept is 0.699.

See it three ways

With things

The rule y = 3x² gives these pairs. When x = 1, 2, 4 and 8, y = 3, 12, 48 and 192. The points (x, y) climb steeply in a curve.

As a picture

A graph with the x axis lg x and the y axis lg y. Four dots A, B, C and D lie on one straight line that rises to the right. A is (0, 0.477), B is (0.301, 1.079), C is (0.602, 1.681) and D is (0.903, 2.283). The line is named gradient 2.ABCDgradient 20.510.511.522.50lg xlg y

In words

Plot lg y against lg x and the curve straightens. The gradient is 2, the power of x. The line meets the lg y axis at lg 3 = 0.477.

In symbols

lg y = 2 lg x + lg 3. The points are (0, 0.477), (0.301, 1.079), (0.602, 1.681) and (0.903, 2.283).

Now take an exponential, y = A bˣ. Taking logs gives lg y = lg A + x lg b. In the form with e, y = A exp(kx), where exp(kx) means e to the power kx, taking natural logs gives ln y = ln A + kx. Each is a straight line when the log of y is plotted against x itself, and not against the log of x. This is a log-linear graph. The gradient is k (or lg b), and the intercept on the vertical axis is ln A (or lg A).

A table with the heads rule and straight when you plot. Rows: y = axⁿ and lg y against lg x; y = A bˣ and lg y against x.ruleploty = axⁿlg y against lg xy = A bˣlg y against x
Which plot straightens which rule.

How can you tell which rule fits data? Look at the table. If y is multiplied by the same number each time x goes up by the same amount, the rule is exponential. If y is multiplied by the same number each time x is multiplied by the same number, the rule is a power law. Or just try both plots and see which is straight.

Here are real data. The Sun has planets that travel in ellipses. For each planet, d is its mean distance from the Sun, in AU. One AU is the mean distance from the Earth to the Sun. T is the time for one orbit, in years. Does T depend on d by a power law T = a dⁿ?

A table with the heads planet, d (AU) and T (years). Rows: Mercury, 0.387 and 0.241; Venus, 0.723 and 0.615; Earth, 1 and 1; Mars, 1.524 and 1.881; Jupiter, 5.203 and 11.86; Saturn, 9.537 and 29.46.planetd (AU)T (years)Mercury0.3870.241Venus0.7230.615Earth11Mars1.5241.881Jupiter5.20311.86Saturn9.53729.46
Mean distance from the Sun and time of one orbit for six planets.
A table with the heads planet, lg d and lg T. Rows: Mercury, −0.412 and −0.618; Venus, −0.141 and −0.211; Earth, 0.000 and 0.000; Mars, 0.183 and 0.274; Jupiter, 0.716 and 1.074; Saturn, 0.979 and 1.469.planetlg dlg TMercury−0.412−0.618Venus−0.141−0.211Earth0.0000.000Mars0.1830.274Jupiter0.7161.074Saturn0.9791.469
The logs of the same readings, to 3 decimal places.
A graph with the x axis lg d and the y axis lg T. Six dots rise from the lower left to the upper right, all very close to one straight line, the line of best fit. The lowest dot is Mercury and the highest is Saturn.−0.50.51−1−0.50.511.50lg dlg T
lg T against lg d for the six planets in the table, Mercury lowest and Saturn highest. The straight line is the line of best fit. The points lie on it, so T = a dⁿ is a good rule.

Worked example

Use the planet data to find a and n in T = a dⁿ. Give both to 3 significant figures.

  1. If T = a dⁿ, then lg T = n lg d + lg a. So plot lg T against lg d, as in the table and the graph.
  2. The six points lie very close to one straight line. Draw the line of best fit. A line drawn by eye gives a slightly different gradient, for example 1.48 to 1.52. Any value in that range earns the mark.
  3. Take two points far apart on the line: Mercury at (−0.412, −0.618) and Saturn at (0.979, 1.469).
  4. The gradient is (1.469 − (−0.618)) ÷ (0.979 − (−0.412)) = 2.087 ÷ 1.391 = 1.50.
  5. So n = 1.50. The line passes through the origin: Earth has d = 1 and T = 1, and lg 1 = 0.
  6. The intercept is lg a = 0, so a = 1.00.
  7. So T = d to the power 1.5, with T in years and d in AU. Squaring both sides gives T² = d³, which is Kepler’s third law.

Answer: n = 1.50 and a = 1.00.

The same method works for exponentials, with ln y against x. Here are counts from a culture of bacteria. The numbers are chosen for this example. The time t is in hours and N is the number of cells.

A table with the heads t (hours), N and ln N. Rows: 0, 200 and 5.298; 1, 290 and 5.670; 2, 395 and 5.979; 3, 575 and 6.354; 4, 800 and 6.685; 5, 1 160 and 7.056.t (hours)Nln N02005.29812905.67023955.97935756.35448006.68551 1607.056
Counts of a culture, and the natural logs of the counts.

Worked example

The counts in the table follow N = A exp(kt). Use the line of ln N against t to find k and A to 3 significant figures.

  1. Take ln of both sides: ln N = ln A + kt. Plot ln N against t. The gradient will be k.
  2. The points lie close to a straight line. Draw the line of best fit. A line drawn by eye gives a slightly different gradient, for example 0.34 to 0.36. Any value in that range earns the mark.
  3. The line passes through (0, 5.302) and (5, 7.046).
  4. The gradient is k = (7.046 − 5.302) ÷ 5.
  5. So k = 1.744 ÷ 5 = 0.349 per hour.
  6. The intercept is ln A = 5.302. So A = exp(5.302) = 201, to 3 significant figures.

Answer: k = 0.349 per hour and A = 201.

A graph with the x axis t (hours) and the y axis ln N. Six dots rise from left to right, all very close to one straight line, the line of best fit. The line meets the left edge at 5.302.01234555.566.577.5t (hours)ln N
ln N against t for the culture. The dots are the six readings and the straight line is the line of best fit.

You can also find the constants from just two exact points, without a graph. The two readings give two equations in ln a and n. Subtract them to cancel ln a, and you are left with an equation for n.

Worked example

Two variables are related by y = a xⁿ. When x = 2, y = 12. When x = 8, y = 96. Find n and a.

  1. Take ln of both sides: ln y = ln a + n ln x. Use each reading.
  2. From (2, 12): ln 12 = ln a + n ln 2. From (8, 96): ln 96 = ln a + n ln 8.
  3. Subtract the first from the second: ln 96 − ln 12 = n (ln 8 − ln 2).
  4. The quotient law gives ln 8 = n ln 4. Since 8 = 2³ and 4 = 2², this is 3 ln 2 = 2n ln 2. So n = 1.5.
  5. Put n = 1.5 in the first reading: 12 = a × 2 to the power 1.5 = a × 2.828. So a = 12 ÷ 2.828 = 4.24.

Answer: n = 1.5 and a = 4.24.

Worked example

A graph of lg y against x is a straight line through the points (1, 0.9) and (4, 1.8). The rule is y = A bˣ. Find A and b to 3 significant figures.

  1. Take lg of both sides: lg y = lg A + x lg b. So the gradient is lg b and the intercept on the vertical axis is lg A.
  2. The gradient is (1.8 − 0.9) ÷ (4 − 1) = 0.3. So lg b = 0.3.
  3. Undo the lg: b = 10 to the power 0.3 = 2.00 to 3 significant figures.
  4. The line is given by two points that are not on the vertical axis, so find its height at x = 0. Going back 1 step from x = 1 lowers lg y by 0.3. So lg A = 0.9 − 0.3 = 0.6.
  5. Undo the lg. To 3 significant figures, A = 10 to the power 0.6 = 3.98.

Answer: A = 3.98 and b = 2.00.

Worked example

A graph of ln y against x is a straight line with gradient 0.5 that passes through (0, 1.2). Write y in the form A exp(kx), and find A and k to 3 significant figures.

  1. The line is ln y = 0.5x + 1.2, with gradient 0.5 and intercept 1.2.
  2. Compare with ln y = ln A + kx. So k = 0.5 and ln A = 1.2.
  3. Undo the ln: A = exp(1.2) = 3.32.
  4. So y = 3.32 exp(0.5x).

Answer: A = 3.32 and k = 0.5.

Try it

Straighten a curve yourself

You need: a scientific calculator, paper and a pencil.

  1. The rule is y = 2x². Work out y for x = 1, 2, 3 and 4.
  2. Work out lg x and lg y for each pair. Write them to 3 decimal places.
  3. Find the gradient from the first pair to the last pair: the change in lg y divided by the change in lg x.

What you will see: The gradient is 2, the power of x. The line starts at lg 2 = 0.301 when lg x = 0. The numbers in lg y rise by equal amounts for equal steps in lg x, which makes the straight line.

If you cannot try it, this is what happens.
A table with the heads x, y, lg x and lg y. Rows: 1, 2, 0.000 and 0.301; 2, 8, 0.301 and 0.903; 3, 18, 0.477 and 1.255; 4, 32, 0.602 and 1.505.xylg xlg y120.0000.301280.3010.9033180.4771.2554320.6021.505

A wrong idea many people have

On the graph of lg y against lg x, the intercept is a.

Why it feels right: In y = mx + c the intercept is a constant you can read off. In y = axⁿ the constant is a, so it looks like the intercept.

The test that breaks it: For y = 5x³ the line is lg y = 3 lg x + lg 5. The intercept is lg 5 = 0.699, not 5. At the point lg x = 0, the height is 0.699, and 10 to the power 0.699 is 5.

What is true: The intercept is lg a, so a = 10 to the power (intercept). For the natural log version, a = exp(intercept). Catch the slip by asking: is the intercept a log, or the number itself?

A wrong idea many people have

To find n in y = axⁿ, plot lg y against x and take the gradient.

Why it feels right: The exponential rule gives a straight line when you plot lg y against x, and the plot is simpler.

The test that breaks it: For y = 3x², plot lg y against x: the points (1, 0.477), (2, 1.079), (4, 1.681), (8, 2.283) are not a line. The gradient from the first pair is 0.60, and from the last pair 0.15.

What is true: A power law needs both axes in logs. An exponential needs only y in logs. If a plot is not straight, you have the wrong plot for the rule. Try the other one.

A wrong idea many people have

You can take lg of y and ln of x on the same graph.

Why it feels right: Both are logarithms, and a log is a log.

The test that breaks it: For y = x², lg y = 2 lg x. Plot lg y against ln x. Since ln x = 2.3026 lg x, the gradient is 2 ÷ 2.3026 = 0.8686, not 2.

What is true: Use the same base on both axes of a log-log graph. Then the gradient is n. With different bases, the gradient is n times a conversion factor. Choose one base and keep it.

A wrong idea many people have

y = 3x² + 4 gives a straight line when you plot lg y against lg x.

Why it feels right: Taking lg of both sides and using the product law seems to split the sum into lg (3x²) + lg 4.

The test that breaks it: The product law splits a product, not a sum. For x = 1 and x = 2, y = 7 and 16, with lg y = 0.845 and 1.204 and lg x = 0 and 0.301. The gradient is 1.19. For x = 4 and 8, y = 52 and 196. The gradient there is 1.91. The gradient changes, so it is not a line.

What is true: A constant added to axⁿ ruins the log trick, because lg (a + b) is not lg a + lg b. Take the constant away first: plot lg (y − 4) against lg x to get a line with gradient 2.

Key words

log-log graph
a graph of the log of y against the log of x. A power law y = axⁿ gives a straight line.
log-linear graph
a graph of the log of y against x. An exponential law gives a straight line.
line of best fit
a straight line drawn through the middle of a set of points, with about as many points on each side.

Back to your guess

The answer is A: A straight line with gradient 2.

If y = 3x², then lg y = lg 3 + 2 lg x. This is a straight line when lg y is plotted against lg x. Its gradient is the power 2, and its intercept is lg 3. The 3 is not the gradient. It hides in the intercept, as lg 3.

Check yourself

Try each one before you look. A wrong answer tells you where to go next.

  1. y = 4x³. A graph of lg y against lg x is drawn. Which is its gradient and its intercept?

    Tap your answer.
    1. Not this one. You swapped the numbers. The power 3 is the gradient and the multiplier 4 gives the intercept lg 4. Go to M5.2.7. Try another.

    2. Not this one. The gradient is right, but the intercept is the log of 4, lg 4 = 0.602, and not 4 itself. Go to M5.2.7. Try another.

    3. Yes, that is right. Take lg of both sides: lg y = lg 4 + 3 lg x. In Y = mX + c the gradient m is 3 and the intercept c is lg 4.

    4. Not this one. You swapped them. The gradient is the number n, and the intercept is lg a. Go to M5.2.7. Try another.

    See the answer

    gradient 3, intercept lg 4

    Take lg of both sides: lg y = lg 4 + 3 lg x. In Y = mX + c the gradient m is 3 and the intercept c is lg 4.

    • If you chose A: You swapped the numbers. The power 3 is the gradient and the multiplier 4 gives the intercept lg 4. Go to M5.2.7.
    • If you chose B: The gradient is right, but the intercept is the log of 4, lg 4 = 0.602, and not 4 itself. Go to M5.2.7.
    • If you chose D: You swapped them. The gradient is the number n, and the intercept is lg a. Go to M5.2.7.
  2. Which graph gives a straight line for y = 6 × 2ˣ?

    Tap your answer.
    1. Not this one. That is the graph of the curve itself, which bends upwards. Go to M5.2.7. Try another.

    2. Yes, that is right. Taking lg of y = 6 × 2ˣ gives lg y = lg 6 + x lg 2. This is a straight line in lg y and x, with gradient lg 2 and intercept lg 6.

    3. Not this one. That straightens a power law. For an exponential, x is in the power, so only y needs a log. Go to M5.2.7. Try another.

    4. Not this one. Taking the log of x alone does not straighten an exponential. The log must be applied to y. Go to M5.2.7. Try another.

    See the answer

    lg y against x

    Taking lg of y = 6 × 2ˣ gives lg y = lg 6 + x lg 2. This is a straight line in lg y and x, with gradient lg 2 and intercept lg 6.

    • If you chose A: That is the graph of the curve itself, which bends upwards. Go to M5.2.7.
    • If you chose C: That straightens a power law. For an exponential, x is in the power, so only y needs a log. Go to M5.2.7.
    • If you chose D: Taking the log of x alone does not straighten an exponential. The log must be applied to y. Go to M5.2.7.
  3. A graph of lg y against lg x is a straight line with gradient 1.5 that meets the vertical axis at 0.602. The rule is y = a xⁿ. Which values of a and n fit?

    Tap your answer.
    1. Not this one. The intercept 0.602 is lg a, not a. Undo the log: a = 10 to the power 0.602 = 4. Go to M5.2.7. Try another.

    2. Not this one. You swapped them. The gradient is the power n, and the intercept holds a. Go to M5.2.7. Try another.

    3. Not this one. The gradient 1.5 is the power n. The intercept holds a. Go to M5.2.7. Try another.

    4. Yes, that is right. The gradient is n = 1.5. The intercept is lg a = 0.602, so a = 10 to the power 0.602 = 4.00 to 3 significant figures.

    See the answer

    a = 4, n = 1.5

    The gradient is n = 1.5. The intercept is lg a = 0.602, so a = 10 to the power 0.602 = 4.00 to 3 significant figures.

    • If you chose A: The intercept 0.602 is lg a, not a. Undo the log: a = 10 to the power 0.602 = 4. Go to M5.2.7.
    • If you chose B: You swapped them. The gradient is the power n, and the intercept holds a. Go to M5.2.7.
    • If you chose C: The gradient 1.5 is the power n. The intercept holds a. Go to M5.2.7.
  4. A scientist records pairs of values and sees that y is multiplied by the same number each time x goes up by the same amount. What does this suggest?

    Tap your answer.
    1. Yes, that is right. A steady multiplier for equal steps in x is the mark of an exponential, y = A bˣ. Taking lg gives lg y = lg A + x lg b, a straight line against x.

    2. Not this one. On a straight line y goes up by the same amount each time. Here y is multiplied, so the changes get bigger. Go to M5.2.7. Try another.

    3. Not this one. A power law has y multiplied by a fixed number when x is multiplied by a fixed number, not when x goes up by a fixed amount. Go to M5.2.7. Try another.

    4. Not this one. There is a clear pattern here, a steady multiplier, and a clear rule. Go to M5.2.7. Try another.

    See the answer

    An exponential, where lg y against x is straight.

    A steady multiplier for equal steps in x is the mark of an exponential, y = A bˣ. Taking lg gives lg y = lg A + x lg b, a straight line against x.

    • If you chose B: On a straight line y goes up by the same amount each time. Here y is multiplied, so the changes get bigger. Go to M5.2.7.
    • If you chose C: A power law has y multiplied by a fixed number when x is multiplied by a fixed number, not when x goes up by a fixed amount. Go to M5.2.7.
    • If you chose D: There is a clear pattern here, a steady multiplier, and a clear rule. Go to M5.2.7.
  5. A graph of ln y against x is a straight line with gradient 0.4 that meets the vertical axis at 2. In the form y = A exp(kx), which are A and k?

    Tap your answer.
    1. Not this one. The intercept 2 is ln A, not A. Undo the ln: A = e² = 7.39. Go to M5.2.7. Try another.

    2. Not this one. You swapped them. The gradient 0.4 is k, and the intercept 2 is ln A. Go to M5.2.7. Try another.

    3. Yes, that is right. The line is ln y = 0.4x + 2, so k = 0.4 and ln A = 2. Undo the ln: A = e² = 7.39 to 3 significant figures.

    4. Not this one. The gradient is k and the intercept holds A, not the other way round. Go to M5.2.7. Try another.

    See the answer

    A = 7.39, k = 0.4

    The line is ln y = 0.4x + 2, so k = 0.4 and ln A = 2. Undo the ln: A = e² = 7.39 to 3 significant figures.

    • If you chose A: The intercept 2 is ln A, not A. Undo the ln: A = e² = 7.39. Go to M5.2.7.
    • If you chose B: You swapped them. The gradient 0.4 is k, and the intercept 2 is ln A. Go to M5.2.7.
    • If you chose D: The gradient is k and the intercept holds A, not the other way round. Go to M5.2.7.
  6. Which of these rules cannot be turned into a straight line by plotting lg y against lg x?

    Tap your answer.
    1. Not this one. This is a pure power law, and lg y = lg 3 + 2 lg x is a straight line. Go to M5.2.7. Try another.

    2. Not this one. This is a pure power law, and lg y = lg 4 + 2 lg x is a straight line. Go to M5.2.7. Try another.

    3. Not this one. This is a power law with power −1, and lg y = lg 4 − lg x is a straight line with gradient −1. Go to M5.2.7. Try another.

    4. Yes, that is right. The log of a sum, lg (3x² + 4), does not split, so no line appears. The other rules are single terms of the form axⁿ.

    See the answer

    y = 3x² + 4

    The log of a sum, lg (3x² + 4), does not split, so no line appears. The other rules are single terms of the form axⁿ.

    • If you chose A: This is a pure power law, and lg y = lg 3 + 2 lg x is a straight line. Go to M5.2.7.
    • If you chose B: This is a pure power law, and lg y = lg 4 + 2 lg x is a straight line. Go to M5.2.7.
    • If you chose C: This is a power law with power −1, and lg y = lg 4 − lg x is a straight line with gradient −1. Go to M5.2.7.
  7. From an earlier chapter

    A sample has a half-life of 12 days. What fraction of it is left after 36 days?

    Tap your answer.
    1. Not this one. You worked out 1 ÷ (2 × 3). Each half-life halves what is left. Three half-lives halve three times. Go to M5.2.6. Try another.

    2. Yes, that is right. The time of 36 days is 36 ÷ 12 = 3 half-lives. Each halves what is left, so the fraction is 1/2 × 1/2 × 1/2 = 1/8.

    3. Not this one. That is the fraction after two half-lives, 24 days. After 36 days it has halved a third time. Go to M5.2.6. Try another.

    4. Not this one. You divided by the number of half-lives, 3. But each one halves again, and the halving multiplies. Go to M5.2.6. Try another.

    See the answer

    1/8

    The time of 36 days is 36 ÷ 12 = 3 half-lives. Each halves what is left, so the fraction is 1/2 × 1/2 × 1/2 = 1/8.

    • If you chose A: You worked out 1 ÷ (2 × 3). Each half-life halves what is left. Three half-lives halve three times. Go to M5.2.6.
    • If you chose C: That is the fraction after two half-lives, 24 days. After 36 days it has halved a third time. Go to M5.2.6.
    • If you chose D: You divided by the number of half-lives, 3. But each one halves again, and the halving multiplies. Go to M5.2.6.
  8. y = 7x². On a graph of lg y against lg x, give the gradient and then the intercept, the intercept to 3 decimal places. Separate them with a comma.

    See the answer

    2, 0.845

    Take lg of both sides: lg y = lg 7 + 2 lg x. The gradient is 2. The intercept is lg 7 = 0.845.

  9. Two variables are related by y = a xⁿ. When x = 2, y = 20. When x = 4, y = 160. Find n and a.

    See the answer

    n = 3 and a = 2.5

    Divide the readings: 160 ÷ 20 = 8 = (4 ÷ 2)ⁿ = 2ⁿ, so n = 3. Then 20 = a × 2³ = 8a, so a = 2.5. Check with the other reading: 2.5 × 4³ = 160.

  10. A graph of ln y against t is a straight line through (0, 3) and (4, 5). Write y = A exp(kt) and find A to 3 significant figures and k.

    See the answer

    A = 20.1 and k = 0.5

    The intercept is ln A = 3, so A = e³ = 20.1. The gradient is k = (5 − 3) ÷ (4 − 0) = 0.5.

  11. For the planets, T = d to the power 1.5, with T in years and d in AU. A small body is 19.2 AU from the Sun. Predict the time of one orbit, to 3 significant figures.

    See the answer

    84.1

    Put d = 19.2: T = 19.2 to the power 1.5 = 19.2 × √19.2 = 19.2 × 4.382 = 84.1 years. This reaches far beyond the data, which stop at 9.5 AU, but it holds because the rule comes from gravity, not just from the data.

  12. A graph of ln y against x is a straight line through (1, 2.5) and (4, 4.3). The rule is y = A exp(kx). Find k, then A to 3 significant figures. Type k, then A.

    See the answer

    0.6, 6.69

    The gradient is k = (4.3 − 2.5) ÷ (4 − 1) = 0.6. Going back 1 step from x = 1 lowers ln y by 0.6, so ln A = 2.5 − 0.6 = 1.9. Then A = exp(1.9) = 6.69 to 3 significant figures.

Keep it

Copy this into your exercise book.

For y = axⁿ, plot lg y against lg x. The gradient is n and the intercept is lg a. For y = A exp(kx), plot ln y against x. The gradient is k. Use one log base.

Draw: A straight line on log axes with its gradient triangle and its intercept marked.

Reading with a child? A short page for the adult: what this chapter teaches and three questions to ask.

No internet tomorrow? Save the whole book as one file (909 KB). It opens on any phone.