This article is from the Puzzles FAQ, by Chris Cole firstname.lastname@example.org and Matthew Daly email@example.com with numerous contributions by others.
You are just served a hot cup of coffee and want it to be as hot as
possible later. If you like milk in your coffee, should you add it
when you get the cup or just before you drink it?
Normalize your temperature scale so that 0 degrees = room temperature.
Assume that the coffee cools at a rate proportional to the difference
in temperature, and that the amount of milk is sufficiently small that
the constant of proportinality is not changed when you add the milk.
An early calculus homework problem is to compute that the temperature
of the coffee decays exponentially with time,
T(t) = exp(-ct) T0, where T0 = temperature at t=0.
Let l = exp(-ct), where t is the duration of the experiment.
Assume that the difference in specific heats of coffee and milk are
negligible, so that if you add milk at temperature M to coffee at
temperature C, you get a mix of temperature aM+bC, where a and b
are constants between 0 and 1, with a+b=1. (Namely, a = the fraction
of final volume that is milk, and b = fraction that is coffee.)
If we let C denote the original coffee temperature and M the milk
temperature, we see that
Add milk later: aM + blC
Add milk now: l(aM+bC) = laM+blC
The difference is d=(1-l)aM. Since l<1 and a>0, we need to worry about
whether M is positive or not.
M>0: Warm milk. So d>0, and adding milk later is better. M=0: Room temp. So d=0, and it doesn't matter. M<0: Cold milk. So d<0, and adding milk now is better.
r<l: The milk pot is larger than your coffee cup. (E.g, it really is a pot.) r>l: The milk pot is smaller than your coffee cup. (E.g., it's one of those tiny single-serving things.) M>0: The milk is warm. M<0: The milk is cold.