We've been talking about the white-box approach in which every first-order element (mass, spring, ...) is explicitly modeled by a first-order finite-difference scheme. This is especially needed for elements that are time varying or pushed into nonlinear regimes of operation.
When a system is linear and time-invariant (LTI), there is no need for such fine-grained modeling, and we can take a a black-box approach, in which we need only model the frequency response from the input(s) to output(s) of the system using a digital filter.
Filter Design Approach to Ideal Integrators and Differentiators
Consider the following simple cases:
The digital filter design formulation typically minimizes frequency-response error with respect to the filter coefficients
Ideal Frequency Responses