Antiderivatives and Total Cost Analysis