A simple RC circuit will integrate or differentiate waveforms:

(Of course, the derivative and integral of a sine wave is the leading and lagging cosine wave; these are just the normal 90° phase shifts.) The circuit below integrates.

The resistance R is made large and the capacitative reactance Xc is made small by using a large C and/or a large W. Then the current into the circuit is set by R and proportional to Vin. The capacitor stores and integrates the charge.

To __differentiate__ the circuit is wired as below:

We arrange for nearly all the input voltage to drop across the capacitor (Vc >> Vout ) by making R small and Xc large using a small C and/or w Thus the voltage drop across R measures i without disturbing Vc.

The circuit looks essentially like a capacitor to the input. The current is set by C and the small R is placed in series to sense it. RL circuits will perform the same operations.