Instant PDF download, name-and-email checkout. Complete bundle: every Economics, Statistics and Mathematics book
Mathematics

Separable Differential Equations: Newton’s Law of Cooling Step by Step

How long does a takeaway coffee stay hot? Learn to solve separable differential equations through Newton's law of cooling, with worked exam examples.

In 30 seconds
  • A differential equation is separable when it can be written as \( \dfrac{dy}{dx} = f(x)\,g(y) \): a function of \( x \) times a function of \( y \).
  • To solve it, put every \( y \) on one side and every \( x \) on the other, integrate both sides, and add one constant \( C \).
  • An initial condition, such as the temperature at \( t = 0 \), fixes \( C \) and turns the general solution into a particular one.
  • Newton’s law of cooling, \( \dfrac{dT}{dt} = -k(T-T_s) \), is separable. Its solution \( T = T_s + (T_0-T_s)e^{-kt} \) answers questions about coffee, cooking and even time of death.
  • Exam point: write the constant as soon as you integrate, before you exponentiate, or the method mark goes.

The case: how long does a takeaway coffee stay hot?

A café wants to print a line on its cups: “Best enjoyed within ___ minutes.” The barista measures one coffee (the numbers here are illustrative). It leaves the machine at 90 °C into a room at 20 °C. Five minutes later, in an open cup, it reads 75 °C. The café decides a drink below 60 °C no longer counts as hot.

The question: how many minutes after pouring does the coffee drop to 60 °C? A straight-line guess says it lost 15 °C in 5 minutes, so it should lose another 15 °C in the next 5 and hit 60 °C at 10 minutes. But a hot drink does not cool at a steady rate. It cools quickly at first and then more slowly, so we need a model that captures how the rate depends on the temperature itself.

The concept: when the rate depends on the amount

Isaac Newton suggested a simple rule for cooling: an object loses heat at a rate proportional to how much hotter it is than its surroundings. A 90 °C coffee in a 20 °C room is 70 degrees above the room, so it cools fast. At 30 °C it is only 10 degrees above, so it cools slowly. As it approaches room temperature the cooling almost stops.

A rule like that is a differential equation: an equation for a rate of change, \( \dfrac{dT}{dt} \), written in terms of the quantity \( T \) itself. Solving it means finding the function \( T(t) \) whose rate of change obeys the rule at every moment.

Many useful differential equations have a special structure. The right-hand side splits into a part that depends only on \( x \) (or \( t \)) and a part that depends only on \( y \) (or \( T \)). Then we can pull the two variables apart, one to each side, and integrate each side separately[1].

Key termSeparable differential equation: a first-order differential equation that can be written as \( \dfrac{dy}{dx} = f(x)\,g(y) \), so the variables can be separated as \( \dfrac{1}{g(y)}\,dy = f(x)\,dx \) and each side integrated.

The formula

For any separable equation \( \dfrac{dy}{dx} = f(x)\,g(y) \) with \( g(y) \ne 0 \), the solution satisfies

\[ \int \frac{1}{g(y)}\,dy = \int f(x)\,dx + C \]

Here \( f(x) \) is the part that depends only on \( x \), \( g(y) \) is the part that depends only on \( y \), and \( C \) is the single constant of integration. For cooling, the equation and its solution are

\[ \frac{dT}{dt} = -k\,(T-T_s) \]
\[ T = T_s + (T_0-T_s)\,e^{-kt} \]

where \( T \) is the drink’s temperature (°C) at time \( t \) (minutes), \( T_s \) is the surrounding temperature, \( T_0 \) is the starting temperature and \( k > 0 \) is the cooling constant (per minute). The minus sign makes \( T \) fall whenever \( T > T_s \)[2].

Mathematics Made Simple textbook coverChapter 16 of Mathematics Made Simple takes you from separating variables to growth, decay and cooling models.Get the textbook · $12

Why this formula fits the case

The barista’s data show the coffee losing heat faster when it is hotter, which is exactly what \( \dfrac{dT}{dt} = -k(T-T_s) \) says. The right-hand side is \( (-k) \times (T-T_s) \): a constant (a trivial function of \( t \)) times a function of \( T \). So it is separable, and we can solve it with two simple integrals.

It is not the right tool when the variables cannot be pulled apart. An equation like \( \dfrac{dy}{dx} = x + y \) is not separable, because \( x + y \) is a sum, not a product; it needs a different method, such as an integrating factor or a numerical approach. Newton’s law itself is also only a model: it works well for a drink in still air at a steady room temperature, less well if the room temperature changes or the cup is stirred, insulated or reheated.

Setting it up

  • Variables: \( t \) in minutes after pouring, \( T \) in °C.
  • Surroundings: \( T_s = 20 \). Initial condition: \( T(0) = 90 \), so \( T_0-T_s = 70 \).
  • Extra data: \( T(5) = 75 \). This is what pins down the unknown \( k \).
  • Target: the time \( t \) at which \( T = 60 \).
  • Domain: \( t \ge 0 \), and \( T > 20 \) throughout, so \( T-20 > 0 \) and we can drop the modulus signs after integrating.

Solving it

Worked example

Solve \( \dfrac{dT}{dt} = -k(T-20) \) with \( T(0) = 90 \) and \( T(5) = 75 \), and find when the coffee reaches 60 °C.

Step 1Separate: \( \dfrac{1}{T-20}\,dT = -k\,dt \).
Step 2Integrate both sides: \( \ln(T-20) = -kt + C \). (No modulus needed, since \( T > 20 \).)
Step 3Exponentiate: \( T-20 = e^{C}e^{-kt} = Ae^{-kt} \), where \( A = e^{C} \).
Step 4Use \( T(0) = 90 \): \( 70 = Ae^{0} \), so \( A = 70 \) and \( T = 20 + 70e^{-kt} \).
Step 5Use \( T(5) = 75 \): \( 55 = 70e^{-5k} \), so \( e^{-5k} = \tfrac{11}{14} \) and \( k = \tfrac{1}{5}\ln\tfrac{14}{11} \approx 0.0482 \) per minute.
Step 6Set \( T = 60 \): \( 40 = 70e^{-kt} \), so \( e^{-kt} = \tfrac{4}{7} \) and \( t = \dfrac{\ln(7/4)}{k} \).
Step 7\( t = \dfrac{0.5596}{0.04823} \approx 11.6 \) minutes.

The coffee stays above 60 °C for about 11.6 minutes, so the cup could honestly say “best enjoyed within 10 minutes”. Keep \( k \) unrounded in your calculator until the last step.

The same model is used, with care, in forensic science. This version is a classic exam question.

Worked example

A body is found at 23:00 in a room kept at 18 °C. Its temperature is 30 °C. One hour later it is 28 °C. Assuming Newton’s law of cooling and a normal living temperature of 37 °C, estimate the time of death.

Step 1Measure \( t \) in hours from 23:00. From Worked example 1, \( T = 18 + Ae^{-kt} \).
Step 2\( T(0) = 30 \): \( A = 30-18 = 12 \), so \( T = 18 + 12e^{-kt} \).
Step 3\( T(1) = 28 \): \( 10 = 12e^{-k} \), so \( e^{-k} = \tfrac{5}{6} \) and \( k = \ln\tfrac{6}{5} \approx 0.1823 \) per hour.
Step 4Death is when \( T = 37 \): \( 19 = 12e^{-kt} \), so \( e^{-kt} = \tfrac{19}{12} \).
Step 5\( t = -\dfrac{\ln(19/12)}{k} \), which is \( -\dfrac{0.4595}{0.1823} \approx -2.52 \) hours.
Step 6\( 2.52 \) hours is about 2 hours 31 minutes, and 23:00 minus 2 h 31 min is 20:29.

The model puts the time of death at about 20:30. The answer is negative because death happened before our clock started, which is a good sign the set-up is right. This is a textbook model; real forensic work uses more refined cooling curves, so treat the result as an estimate.

Mathematics Made Simple Practice Questions coverSolve separable equations until they are automatic with 1,565 practice questions, all with full working.Get 1,565 questions · $9

What the answer tells us

The straight-line guess said 10 minutes; the model says 11.6. The difference comes from the shape of the curve. The coffee’s initial cooling rate is \( k \times 70 \approx 3.4 \) °C per minute, but by the time it reaches 60 °C the gap to the room has shrunk to 40 degrees and the rate is down to about 1.9 °C per minute. Twenty minutes after pouring, the model gives \( 20 + 70\left(\tfrac{11}{14}\right)^4 \approx 46.7 \) °C: still warm, but well past hot.

Reasonableness checks. At \( t = 0 \) the formula gives 90 °C and at \( t = 5 \) it gives 75 °C, matching the data. As \( t \to \infty \), \( e^{-kt} \to 0 \) and \( T \to 20 \): the coffee approaches room temperature but, in the model, never goes below it. The units work too: \( k \) is per minute, so \( kt \) has no units, as an exponent must.

Sensitivity. Everything depends on \( k \). A lid that halves \( k \) doubles every time, because \( t = \ln(7/4)/k \): the coffee then stays above 60 °C for about 23.2 minutes. In the forensic example, if the person’s normal temperature was 36.5 °C instead of 37 °C, the estimate moves to about 2.37 hours before discovery, or around 20:38. A half-degree assumption shifts the answer by nine minutes.

Takeaway coffee cooling in a 20 °C room
open cup: T = 20 + 70e^(−0.0482t)with a lid (k halved)
510152025303540451020304050607080901000t (minutes)T (°C)(5, 75)11.6 min23.2 minroom temperature 20 °C60 °C: no longer ‘hot’
Figure 1. The temperature falls fastest at first, when the gap to the room is largest, and levels off towards 20 °C. Halving k doubles every time, so the lidded cup stays above 60 °C for about 23 minutes. Illustrative café data.
Common mistakeAdding the constant in the wrong place. After integrating you have \( \ln(T-20) = -kt + C \). Exponentiating gives \( T-20 = e^{-kt + C} = Ae^{-kt} \), a constant multiplying the exponential. Writing \( T-20 = e^{-kt} + C \) is wrong, and so is forgetting \( C \) and adding it at the end.
Common mistakeDividing by zero without noticing. Separating \( \dfrac{dT}{dt} = -k(T-20) \) divides by \( T-20 \), which fails when \( T = 20 \). The constant function \( T = 20 \) is also a solution: a drink that starts at room temperature stays there. If a question asks for all solutions, mention it.
Exam tipIn AP Calculus this is topic 7.6 (general solutions by separation of variables), 7.7 (particular solutions from an initial condition) and 7.8 (exponential models)[3]. Cambridge 9709 Paper 3 section 3.8 asks you to form the equation from words and then solve it[4], and IB Mathematics: analysis and approaches covers it in HL topic 5.18[5]. Released AP free-response scoring guidelines typically award separate points for separating the variables and for the constant of integration with the initial condition, and an answer with no constant usually loses most of the marks that follow.

For the full story, from slope fields to logistic growth and economic models such as constant-elasticity demand, see the Mathematics Made Simple textbook.

Mathematics Made Simple bundle coverGet the textbook and practice book together for $16: differential equations explained, then drilled.Both books · $16

Practice questions

Separate, integrate, add \( C \), then use the condition. When you want more, the Mathematics Made Simple practice book has 1,565 questions with fully worked answers.

EasyQ1. Solve \( \dfrac{dy}{dx} = 6x^2y \), given that \( y = 5 \) when \( x = 0 \). Show worked answer
Separate: \( \dfrac{1}{y}\,dy = 6x^2\,dx \).
Integrate: \( \ln|y| = 2x^3 + C \).
So \( y = Ae^{2x^3} \). With \( y(0) = 5 \): \( A = 5 \).
\( y = 5e^{2x^3} \).
EasyQ2. A pie at 200 °C is taken out of the oven into a 25 °C kitchen and cools according to \( \dfrac{dT}{dt} = -0.1(T-25) \), with \( t \) in minutes. Find its temperature after 10 minutes. Show worked answer
The solution is \( T = 25 + (200-25)e^{-0.1t} = 25 + 175e^{-0.1t} \).
At \( t = 10 \): \( T = 25 + 175e^{-1} \approx 25 + 64.38 = 89.4 \) °C.
MediumQ3. Solve \( \dfrac{dy}{dx} = xy^2 \), given \( y(0) = \tfrac{1}{2} \). Give \( y \) explicitly and state where the solution is valid. Show worked answer
Separate: \( y^{-2}\,dy = x\,dx \).
Integrate: \( -\dfrac{1}{y} = \dfrac{x^2}{2} + C \).
At \( x = 0 \), \( y = \tfrac{1}{2} \): \( -2 = C \).
So \( \dfrac{1}{y} = 2-\dfrac{x^2}{2} = \dfrac{4-x^2}{2} \), giving \( y = \dfrac{2}{4-x^2} \).
The solution through \( (0, \tfrac{1}{2}) \) is valid for \( -2 < x < 2 \), where the denominator is not zero.
MediumQ4. A can of drink is taken from a fridge at 4 °C into a 30 °C room. After 10 minutes it is at 10 °C. Assuming Newton’s law, when does it reach 15 °C? Show worked answer
Here the drink warms, but the same law applies: \( T = 30 + (4-30)e^{-kt} = 30-26e^{-kt} \).
\( T(10) = 10 \): \( 26e^{-10k} = 20 \), so \( e^{-10k} = \tfrac{10}{13} \) and \( k = \tfrac{1}{10}\ln 1.3 \approx 0.02624 \).
\( T = 15 \): \( 26e^{-kt} = 15 \), so \( t = \dfrac{\ln(26/15)}{k} \approx \dfrac{0.5500}{0.02624} \approx 21.0 \) minutes.
ExamQ5. Water drains from a tank so that the depth \( h \) cm satisfies \( \dfrac{dh}{dt} = -0.5\sqrt{h} \), with \( t \) in minutes. Initially \( h = 100 \). (a) Solve the equation to show that \( h = (10-0.25t)^2 \). [4] (b) Find the time taken for the depth to fall to 50 cm. [2] (c) Find when the tank is empty, and explain why the formula is not valid after that. [2] Show worked answer
(a) Separate: \( h^{-1/2}\,dh = -0.5\,dt \) [1]. Integrate: \( 2\sqrt{h} = -0.5t + C \) [1]. At \( t = 0 \): \( 2 \times 10 = C \), so \( C = 20 \) [1]. Then \( \sqrt{h} = 10-0.25t \) and \( h = (10-0.25t)^2 \) [1].
(b) \( \sqrt{50} = 10-0.25t \) [1], so \( t = \dfrac{10-\sqrt{50}}{0.25} \approx \dfrac{10-7.071}{0.25} \approx 11.7 \) minutes [1].
(c) \( h = 0 \) when \( 10-0.25t = 0 \), at \( t = 40 \) minutes [1]. For \( t > 40 \) the formula would give a rising depth, but an empty tank stays empty; the step \( \sqrt{h} = 10-0.25t \) needs \( 10-0.25t \ge 0 \) [1].

Frequently asked questions

How do I know if a differential equation is separable?

Try to write the right-hand side as (something in \( x \) only) times (something in \( y \) only). \( x^2y \), \( e^{x-y} = e^x e^{-y} \) and \( -k(T-20) \) all split this way. \( x + y \) and \( \sin(xy) \) do not.

Why is there only one constant of integration?

Integrating both sides does produce two constants, but they can be combined into one: \( C_2-C_1 \) is just another constant. Write a single \( C \) on the \( x \) side.

What does \( k \) mean in Newton’s law of cooling?

It measures how quickly the object exchanges heat with its surroundings, in units of “per unit time”. A larger \( k \) means faster cooling: a thin cup, a draught, a small volume. Its value is not given by theory; you find it from a measurement, as in Step 5 of the coffee example.

Can Newton’s law of cooling be used for warming?

Yes. If the object starts colder than its surroundings, \( T-T_s \) is negative, so \( \dfrac{dT}{dt} \) is positive and the temperature rises towards \( T_s \). Practice question 4 is an example.

References

  1. Strang, G. and Herman, E. (2016) Calculus Volume 2, Section 4.3 Separable Equations. Houston: OpenStax. https://openstax.org/details/books/calculus-volume-2
  2. Stewart, J., Clegg, D. and Watson, S. (2021) Calculus: Early Transcendentals, 9th edn, Chapter 9 Differential Equations. Boston: Cengage Learning.
  3. College Board. AP Calculus AB and AP Calculus BC Course and Exam Description. apcentral.collegeboard.org
  4. Cambridge International. Cambridge International AS & A Level Mathematics 9709: Syllabus for 2026 and 2027. cambridgeinternational.org
  5. International Baccalaureate Organization. Mathematics: analysis and approaches guide (first assessment 2021). ibo.org
Mathematics Made Simple complete bundle cover
This topic has a full chapter in Mathematics Made Simple, with 1,565 fully worked practice questions in the bundle.Mathematics Made Simple Complete Bundle — Textbook + 1,565 Practice Questions
Get it for $16
E

The EconTutorials team writes clear, exam-focused lessons in economics and statistics for A-Level, IB, AP and university students, with more than 13 years of classroom teaching behind every guide and book in the Made Simple series.