A vessel holds V litres of pure milk. Each time, x litres are taken out and replaced with x litres of water, so the total volume stays V. After the first operation, the milk is V − x. After that, every draw removes a mixture, so less milk leaves each round.
The fix is to see that every operation keeps the same fraction of the milk: (V − x)/V. Repeating it n times multiplies by that fraction n times. That gives the milk replaced by water repeatedly formula:
Milk left after n operations = V × (1 − x/V)ⁿ Water = V − milk left
It is the same pattern as depreciation: a fixed percentage lost each round. See population growth and depreciation.
Worked example 1: 40 litres, 4 litres three times
Each round keeps 36/40 = 0.9 of the milk. After 3 rounds: 40 × 0.9³ = 40 × 0.729 = 29.16 litres. Subtracting 4 litres three times would wrongly give 28.
Tracing it by hand shows why: after round 1 the can holds 36 L milk and 4 L water. Round 2 removes 4 L of mixture, which is 90% milk, so it takes 3.6 L of milk, leaving 32.4. Round 3 takes 3.24 L, leaving 29.16.