Calculus You Forgot (Or Never Learned): Derivatives
By: Al Williams
Tags: Programming, Derivatives, Mathematics, Calculus, Engineering

Calculus You Forgot (Or Never Learned): Derivatives

Intuitive ideas about the derivative

Photo by Andrea Piacquadio from Pexels

If you went to college, it is a fair bet that you took some sort of calculus class. If you went for engineering or science, you probably took a LOT of calculus classes. Unfortunately, a lot of math teachers like to show you how smart they are and they make simple ideas pretty hard to understand. Plus, in school you have a lot of things — both academic and non-academic — competing for your attention. So it isn’t surprising that a lot of people don’t have an intuitive grasp of some calculus ideas. Sometimes, I think some of the professors don’t either and that’s part of the problem. It is one thing to know the notes on each piano key and another thing to be able to play the piano.

What is Calculus?

So what is calculus? Easy answer: it is the mathematics of change. Regular math lets us answer questions like “Which rug is larger?” or “How many eggs do we need every day to feed a certain number of people?” Algebra answers questions like “If we earn 8% interest on a bank account and after a year we have $1122, how much money did we start with?” Geometry and trigonometry answer questions about shapes and angles. Calculus answers questions about change.

Examples of questions you might answer with calculus are: If a pipe develops a 1mm leak that doubles in size every hour, how long does it take to empty a 300-gallon tank? Or, if a hockey stick snaps off the ice according to a math formula, what is the maximum acceleration it will sustain?

If you want to deal with stock or option trades, write amazing real-world computer simulations in 3D, or build skyscrapers, you are probably going to need calculus at some point. Good thing it isn’t as hard as people say.

What is a Derivative?

A derivative is simply the rate of change of something. That’s all it is. A ball standing still or a hose with the water faucet off all have a formula that describes them and the derivative of that formula is zero. Because they are not changing.

Sometimes, we really want to know about the actual rate of change. How fast is a rocket accelerating after its engine is on for 3 seconds? But sometimes we want to know the sign of the rate of change. For example, if we have a formula that approximates the cost of soybeans, we will note that the rate of change is positive when the price is going up, negative when it is going down, and zero at places where it changes from plus to minus or vice versa. Those zero points will be the minimum and maximum price of soybeans, at least according to our model.

So this is a useful math trick. When I was a student, I used to think “How did Newton and Libnietz figure this s*** out from scratch? Crazy!” But now I see that it is actually really simple if you want to ask those kinds of questions that you would work out this kind of math. We are going to work it out, probably like they did.

Start Simple

Let’s say we have a function f(x)=4. That means that any value of x you plug in, the answer is 4. This could be a math model for a ball sitting 4 meters off the ground on the floor of a big building. At time 0, the position is 4 meters. At time 1,000 the position is… 4 meters. It isn’t moving.

What’s the rate of change? Zero. The same goes for f(x)=20. Or f(x)=1000. No change based on x so therefore the rate of change — and, thus, the derivative is zero. Graphically, that looks like this:

f(x)=4 is boring

More Interesting

Look at this graph:

f(x)=4x

This is a bit more interesting. It is a line. You might remember that a line is y=mx+b where m is the slope and b is the y-intercept. In this case, b=0 and you can see that m=4, so the slope is 4. For a line, though, the slope is the rate of change. that is at every point on the line, a change in x of 1 will cause a change in y of 4 in the same direction.

If you didn’t know the formula for this line, you could compute the slope by measuring the rise over the run. What this means is you pick some run — a pair of x values. Find the y values for those two x’s. The difference in x values is the run and the difference in y values is the rise. The rise divided by the run is the slope.

So if we pick x=0 and x=1, we see that f(0)=0 and f(1)=4. So the run is 1–0 or 1. The rise is 4–0 or 4. The rise over the run is 4/1 = 4. Same result. But it doesn’t matter what numbers we pick. Since f(1)=4 and f(11)=44 we can see that for a run of 11–1=10 we have a rise of 44–4=40 and 40/10 is… 4. You can do that with any two numbers you care to name. It also would not matter if we added an offset because that won’t change the slope:

f(x)=4x+3

If you do the same math, the +3 term will cancel out when you subtract and so the slope of this line is still 4.