You have identified something real. The honest description of what is happening has three steps, and only the middle one is calculus.
- Somebody chose a continuous extension. The formula for delay or cost was written using operations that happen to make sense for any real number, so it defines a continuous function that agrees with the discrete one at the integers.
- The extension is optimised with ordinary calculus.
- The result is rounded back to an integer.
Step 1 is the part that is never stated and it is where the assumption lives. There is no unique continuous extension of a function on the integers — infinitely many curves pass through the same set of points, and they have their minima in different places. The one being used is whichever one the algebra happened to produce.
So it is not illegitimate, but it is a modelling choice being presented as a derivation.