M5.5.7 Chapter 7

Differential equations

How do I find a formula when I know only how fast something changes?

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

  • Solve dy/dx = ky by separating the variables
  • Model cooling or growth with a differential equation

A population of bacteria grows faster when there are more of them. A cup of tea cools faster when it is much hotter than the room. In each case we know a rule about the rate of change, not the formula. A rule like this is a differential equation: an equation with a derivative in it. To solve it is to find the formula that obeys the rule.

Take the simplest rule: the rate of change of y is proportional to y. We write dy/dx = ky, where k is a constant. The picture shows what that means. At each point the gradient is k times the height of the curve, so the curve is steep where it is high, and flat where it is low.

A graph with the x axis named time (hours) from 0 to 5 and a y axis from 0 to 2400 named N. A curve named N rises from 200 at time 0, passes through 800 at time 3 and reaches about 2000 at time 5. Two straight pieces touch the curve at times 1 and 4. The piece at time 4 is much steeper than the piece at time 1.01234504008001 2001 6002 0002 400time (hours)N200800N
The two straight pieces touch the curve at times 1 and 4. At time 4 the curve is four times as high as at time 1, and four times as steep.

To solve dy/dx = ky, use separation of variables. Put everything with y on one side, and everything with x on the other. Here that means (1/y) dy = k dx. Then integrate both sides. Each side now has its own variable, so we can integrate with what we know.

A table with the heads y side and x side. The rows read (1/y) dy and k dx, then ∫ (1/y) dy and ∫ k dx, then ln|y| and kx + c.y sidex side(1/y) dyk dx∫ (1/y) dy∫ k dxln|y|kx + c
Separate, then integrate each side. Only one constant is needed, and we put it on the x side.

Now solve for y. We have ln|y| = kx + c. Take e to the power of each side: |y| = e^(kx + c) = e^c × e^(kx). The number e^c is another constant, so we call it A. The solution is y = A e^(kx). The A stands for the value of y at x = 0, because e⁰ = 1.

There is a different curve for each A. A rule on its own gives a family of solutions. To pick one, we need one known pair of values, such as the starting value of y. This is the initial condition. We put it into the solution and find A.

A graph with the x axis named x from −1 to 1 and a y axis from 0 to 9 named y. Three curves of the same shape rise from left to right. They meet the y axis at heights 1, 2 and 3. A dot on the middle curve is named (0, 2). That curve is drawn solid and the other two are dashed.−1010369xy(0, 2)
The curves y = A eˣ all obey dy/dx = y. The curve through (0, A) has the constant A. The starting point (0, 2) picks the curve with A = 2.

Worked example

Solve dy/dx = 3y, given that y = 5 when x = 0. Then find y when x = 1, to 3 significant figures.

  1. Separate the variables: (1/y) dy = 3 dx.
  2. Integrate both sides: ln|y| = 3x + c.
  3. Take e to the power of each side: y = A e³ˣ.
  4. Use the starting value. When x = 0, y = 5. Then 5 = A e⁰ = A, so A = 5.
  5. The solution is y = 5e³ˣ.
  6. When x = 1, y = 5e³. To 3 significant figures this is 100.

Answer: y = 5e³ˣ, and y = 100 when x = 1.

Separation of variables works for any rule that can be split into a y part and an x part. For dy/dx = 2xy, we separate to get (1/y) dy = 2x dx. Integrating gives ln|y| = x² + c, so y = A e^(x²).

Worked example

Solve dy/dx = 2xy, given that y = 1 when x = 0. Find y when x = 2, to 3 significant figures.

  1. Separate: (1/y) dy = 2x dx.
  2. Integrate: ln|y| = x² + c.
  3. So y = A e^(x²).
  4. When x = 0, y = 1. Then 1 = A e⁰ = A, so A = 1.
  5. The solution is y = e^(x²).
  6. When x = 2: y = e⁴ = 54.6, to 3 significant figures.

Answer: 54.6

Now to a model. A population grows in proportion to its size, so dN/dt = kN, and N = N₀ e^(kt), where N₀ is the starting size. The number k is the growth rate. We find k from one more reading.

Worked example

A culture of bacteria has 200 cells at time 0, and 800 cells after 3 hours. Assume the growth rate is proportional to the number of cells. Find the number of cells after 5 hours, to 3 significant figures.

  1. The model is dN/dt = kN, so N = 200e^(kt).
  2. At t = 3, N = 800. So 800 = 200e^(3k), and e^(3k) = 4.
  3. Take natural logarithms: 3k = ln 4, so k = ln 4 ÷ 3 = 0.4621 per hour.
  4. At t = 5: N = 200e^(5k) = 200 × e^(2.3105) = 2015.9.
  5. After 5 hours there are about 2020 cells, to 3 significant figures.

Answer: 2020

Now cooling. A hot cup loses heat to the room. Newton found that the rate of cooling is about proportional to how much hotter the cup is than the room. The model is dT/dt = −k(T − R), where T is the temperature of the cup, R is the temperature of the room, and k is a positive constant. The minus sign makes T fall when T is above R.

The model assumes the room stays at one temperature and that the cup loses heat in proportion to the difference. It is good for ordinary cups, and not for boiling water in a very cold room. Put θ = T − R, the excess over the room. Then dθ/dt = −kθ, which is the equation we have solved, with k replaced by −k. So θ = θ₀ e^(−kt), and T = R + θ₀ e^(−kt).

Worked example

A cup of tea starts at 90 °C in a room at 20 °C. After 10 minutes it is 60 °C. Find its temperature after 25 minutes, to 3 significant figures.

  1. Let θ = T − 20 be the excess over the room. At the start, θ = 90 − 20 = 70. So θ = 70e^(−kt).
  2. After 10 minutes, θ = 60 − 20 = 40. So 40 = 70e^(−10k), and e^(−10k) = 4/7.
  3. Take natural logarithms: −10k = ln(4/7), so k = ln(7/4) ÷ 10 = 0.056 per minute.
  4. After 25 minutes, θ = 70e^(−25k) = 17.28.
  5. The temperature is T = 20 + 17.28 = 37.28 °C, which is 37.3 °C to 3 significant figures.

Answer: 37.3 °C

A graph with the x axis named time (min) from 0 to 40 and a y axis from 0 to 100 named T (°C). A dashed level line named room stands at 20. A curve named tea starts at 90, passes through 60 at time 10 and levels out towards the line at 20. Two dots mark the points (0, 90) and (10, 60).010203040020406080100time (min)T (°C)9060roomtea
The tea cools quickly at first. The curve flattens as it nears the room temperature of 20 °C, which it never goes below.

See it three ways

With things

A cup of hot water, a clock and a thermometer show it: the temperature falls fast in the first minutes and slowly later. The gap to room temperature shrinks by the same fraction every few minutes.

As a picture

A table with the heads y side and x side. The rows read (1/y) dy and k dx, then ∫ (1/y) dy and ∫ k dx, then ln|y| and kx + c.y sidex side(1/y) dyk dx∫ (1/y) dy∫ k dxln|y|kx + c

In words

A rate proportional to the amount means exponential growth or decay. Separate, integrate, then use a known value to find the constant.

In symbols

dy/dx = ky gives y = A e^(kx).

Try it

Watch the gap to room temperature shrink

You need: a cup of hot tap water, a thermometer, a clock.

Be safe: Use hot tap water, not boiling water, and keep the cup where it cannot be knocked over.

  1. Pour hot tap water into a cup. Do not use boiling water. Note the room temperature.
  2. Read the temperature of the water every 5 minutes for 20 minutes, and write the readings in a table.
  3. For each reading, subtract the room temperature to get the gap, which is T − 20 when the room is at 20 °C.
  4. Divide each gap by the one before it.

What you will see: The ratios are nearly the same each time. The table shows model readings for water at 55 °C in a room at 20 °C, with gaps 35, 26.5, 20, 15.1, 11.4 °C. Each gap is 0.756 times the one before. A constant ratio is the sign of exponential decay.

If you cannot try it, this is what happens.
A table with the heads t (min), T (°C) and gap (°C). The rows read 0 and 55 and 35, 5 and 46.5 and 26.5, 10 and 40 and 20, 15 and 35.1 and 15.1, 20 and 31.4 and 11.4.t (min)T (°C)gap (°C)05535546.526.51040201535.115.12031.411.4

A wrong idea many people have

To solve dy/dx = ky, integrate both sides with respect to x. That gives y = kxy.

Why it feels right: Integrating both sides is the usual way to undo a derivative.

The test that breaks it: Differentiate y = kxy with respect to x. The product rule gives y + x(dy/dx) multiplied by k, which is not ky. The right side has y in it, and we cannot treat y as a constant.

What is true: First separate the variables, so that y and dy are on one side, and x and dx are on the other. Then integrate each side with its own variable.

A wrong idea many people have

After integrating, y = e^(kx) + c.

Why it feels right: Integrating always adds a + c, so it seems natural to put it at the end.

The test that breaks it: Take ln|y| = kx + c and raise e to both sides. The result is y = e^(kx + c) = e^c × e^(kx). The c is in the power, so it becomes a multiplier.

What is true: The constant becomes a factor: y = A e^(kx). A is the starting value, and we find it from the initial condition.

Key words

differential equation
an equation with a derivative in it. It describes a rate of change.
separation of variables
putting all the y terms on one side and all the x terms on the other, so each side can be integrated.
initial condition
a known value of y at a known x, used to find the constant in the solution.

Back to your guess

The answer is B: If the rate of growth is 3 times the size, the size follows e³ˣ, a curve that grows faster and faster.

When the growth rate is proportional to the size, bigger means faster, and faster growth makes it bigger still. The size is an exponential, such as A e³ˣ. A straight line, like 3x, has a constant rate. Growth by the same amount each hour is also a constant rate, not growth in proportion to the size.

Check yourself

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

  1. Which equation says that the rate of growth of a population N is proportional to N?

    Tap your answer.
    1. Not this one. This says the growth rate is a constant. It does not depend on N, so the growth is the same amount in each hour. Read this page again. Try another.

    2. Not this one. This says the rate depends on time, not on the size of the population. Read this page again. Try another.

    3. Yes, that is right. Proportional to N means the rate equals a constant times N. That is dN/dt = kN.

    4. Not this one. This adds N to a constant. Proportional means the rate is a multiple of N: k times N. Read this page again. Try another.

    See the answer

    dN/dt = kN

    Proportional to N means the rate equals a constant times N. That is dN/dt = kN.

    • If you chose A: This says the growth rate is a constant. It does not depend on N, so the growth is the same amount in each hour. Read this page again.
    • If you chose B: This says the rate depends on time, not on the size of the population. Read this page again.
    • If you chose D: This adds N to a constant. Proportional means the rate is a multiple of N: k times N. Read this page again.
  2. What is the first step in solving dy/dx = ky by separating the variables?

    Tap your answer.
    1. Not this one. The right side still has y in it, so the integral on the right is not yet something we can do. Read this page again. Try another.

    2. Yes, that is right. Separating gives (1/y) dy = k dx. Each side then has one variable, and each can be integrated.

    3. Not this one. We are trying to find y from its derivative, so we integrate and do not differentiate. Read this page again. Try another.

    See the answer

    Put the y terms with dy on one side and the x terms with dx on the other.

    Separating gives (1/y) dy = k dx. Each side then has one variable, and each can be integrated.

    • If you chose A: The right side still has y in it, so the integral on the right is not yet something we can do. Read this page again.
    • If you chose C: We are trying to find y from its derivative, so we integrate and do not differentiate. Read this page again.
  3. dy/dx = 2y and y = 2 when x = 0. Find y when x = 1, to 3 significant figures.

    See the answer

    14.8

    The solution is y = A e^(2x). Since y = 2 when x = 0, A = 2. So y = 2e^(2x), and at x = 1 it is 2e² = 14.8.

  4. A culture has 500 cells at time 0 and 1500 cells after 4 hours, and N = 500e^(kt). Find k to 3 significant figures, in per hour.

    See the answer

    0.275

    1500 = 500e^(4k), so e^(4k) = 3, and 4k = ln 3 = 1.099. Then k = 1.099 ÷ 4 = 0.275 per hour.

  5. In the cooling model dT/dt = −k(T − 20), why is the rate proportional to T − 20 and not to T?

    Tap your answer.
    1. Yes, that is right. Heat flows because of a difference in temperature. When the tea reaches 20 °C the difference is 0, and the cooling stops.

    2. Not this one. The tea cannot go below the room temperature, so it levels off near 20 °C, not 0 °C. Read this page again. Try another.

    3. Not this one. The number k is the cooling constant. The 20 is the room temperature. Read this page again. Try another.

    See the answer

    The rate of cooling depends on how much hotter the tea is than the room, 20 °C.

    Heat flows because of a difference in temperature. When the tea reaches 20 °C the difference is 0, and the cooling stops.

    • If you chose B: The tea cannot go below the room temperature, so it levels off near 20 °C, not 0 °C. Read this page again.
    • If you chose C: The number k is the cooling constant. The 20 is the room temperature. Read this page again.
  6. A cup of tea starts at 80 °C in a room at 18 °C, and is 50 °C after 8 minutes. What is its temperature after 20 minutes, to 3 significant figures?

    See the answer

    29.9

    θ = 62e^(−kt), and 32 = 62e^(−8k) gives k = ln(62/32) ÷ 8 = 0.08267. At 20 minutes, θ = 62e^(−1.653) = 11.87. So T = 18 + 11.87 = 29.9 °C.

  7. A solution of a differential equation has a constant A. How do we find its value?

    Tap your answer.
    1. Yes, that is right. The equation gives a family of curves. One known point picks the curve out by fixing A.

    2. Not this one. A second integral would add another constant, and not remove this one. Read this page again. Try another.

    3. Not this one. The constant depends on the starting value. For y = 5 at x = 0, A is 5. Read this page again. Try another.

    See the answer

    Use a known value of y at a known x, called an initial condition.

    The equation gives a family of curves. One known point picks the curve out by fixing A.

    • If you chose B: A second integral would add another constant, and not remove this one. Read this page again.
    • If you chose C: The constant depends on the starting value. For y = 5 at x = 0, A is 5. Read this page again.
  8. From an earlier chapter

    What is ∫ 1/y dy? This is from chapter 4.

    Tap your answer.
    1. Not this one. That is the derivative of 1/y. We are going the other way. Go to M5.5.4. Try another.

    2. Yes, that is right. The gradient of ln y is 1/y, so the integral of 1/y is ln|y| + c.

    3. Not this one. The power rule would divide by 0, so it does not work for 1/y. Go to M5.5.4. Try another.

    See the answer

    ln|y| + c

    The gradient of ln y is 1/y, so the integral of 1/y is ln|y| + c.

    • If you chose A: That is the derivative of 1/y. We are going the other way. Go to M5.5.4.
    • If you chose C: The power rule would divide by 0, so it does not work for 1/y. Go to M5.5.4.
  9. Solve dy/dx = 2xy with y = 1 when x = 0. Find y when x = 1, to 3 significant figures.

    See the answer

    2.72

    Separate: (1/y) dy = 2x dx. Then ln|y| = x² + c, so y = A e^(x²). With y = 1 at x = 0, A = 1. At x = 1, y = e¹ = 2.72.

  10. A quantity obeys dy/dx = −2y, and starts at a positive value. What happens as x gets large?

    Tap your answer.
    1. Yes, that is right. The solution is y = A e^(−2x) with A above 0. As x grows, e^(−2x) shrinks towards 0 but is never 0 or negative. At x = 3 it is e^(−6) = 0.0025, which is under 1% of A.

    2. Not this one. The solution is y = A e^(−2x), and an exponential with a positive A is always positive. Read this page again. Try another.

    3. Not this one. The rate is negative when y is positive, so y falls, and does not grow. Read this page again. Try another.

    See the answer

    y falls towards 0 and stays positive.

    The solution is y = A e^(−2x) with A above 0. As x grows, e^(−2x) shrinks towards 0 but is never 0 or negative. At x = 3 it is e^(−6) = 0.0025, which is under 1% of A.

    • If you chose B: The solution is y = A e^(−2x), and an exponential with a positive A is always positive. Read this page again.
    • If you chose C: The rate is negative when y is positive, so y falls, and does not grow. Read this page again.

Keep it

Copy this into your exercise book.

dy/dx = ky. Separate: (1/y) dy = k dx. Integrate: ln|y| = kx + c. So y = A e^(kx), and a starting value gives A. Cooling: T = R + (T₀ − R)e^(−kt).

Draw: A curve falling from the starting temperature towards a dashed level line for the room temperature.

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 (910 KB). It opens on any phone.