In this chapter, I introduce you to two of the most important concepts from calculus: the derivative and the integral. Both of these are operations that work with functions. The derivative takes a function and gives you another function measuring its rate of change. The integral does the opposite; it takes a function representing a rate of change and gives you back a function measuring the original, cumulative value.
I focus on a simple example from my own work in data analysis for oil production. The set up we’ll picture is a pump lifting crude oil out of a well, which then flows through a pipe into a tank. The pipe is equipped with a meter that continuously measures the rate of fluid flow, and the tank is equipped with a sensor that detects the height of fluid in the tank and reports the volume of oil stored within (figure 8.1).