Marginal and average costs in engineering functional analysis