Assume (1) the coffee cools at a rate proportional to the difference in temperature, and (2) the amount of milk is sufficiently small that the constant of proportionality is not changed when you add the milk, and (3) room temperature is zero degrees in some scale.

The temperature of the coffee decays exponentially with time, so

T(t) = exp(-ct) T0, where T0 = temperature at time t=0.

Let K = 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 + KbC Add milk now: K(aM+bC)

The difference is (1-K)aM. Since K<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.

Of course, if you wanted to be intuitive, the answer is obvious if you assume the coffee is already at room temperature and the milk is either scalding hot or subfreezing cold.

Moral of the story: Always think of extreme cases when doing these puzzles. They are usually the key.

[Postscript: if we are allowed to let the milk stand at room temperature, then let r = the corresponding exponential decay constant for your milk container.

Add acclimated milk later: arM + KbC

We now have lots of cases, depending on whether

r<K: The milk pot is larger than your coffee cup.

(E.g, it really is a pot.)

r>K: 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.

Leaving out the analysis, you should...

Add warm milk in large pots LATER. Add warm milk in small pots NOW. Add cold milk in large pots NOW. Add cold milk in small pots LATER.

Of course, observe that the above summary holds for the case where the milk pot is allowed to acclimate; just treat the pot as of infinite size.]