Rates of change
The question. If you know where your hand is at every moment, how fast is it moving at one particular moment?
A simulator is always converting between where things are and how fast they are changing. Velocity is the rate at which position changes, and acceleration is the rate at which velocity changes. Later, the pull of a stretched tissue turns out to be the rate at which the energy stored in it changes with its length. All of these are the same idea, the rate of change, and this chapter builds it from nothing more than rise over run.
By the end you will be able to find the rate of change of a simple formula, read the slopes of a quantity that depends on several numbers at once, and estimate a rate on a computer, knowing what can go wrong.
Speed over a shorter and shorter time
A hand moves along a straight line, speeding up as it goes. After seconds it has travelled metres. At 1 s it is at 1 m, and at 2 s it is at 4 m.
In that second it covers 3 m, so its average speed is 3 m/s. But it was speeding up throughout, so at the 1 s mark itself it was moving more slowly than that. To get closer to the speed at that moment, measure over a shorter time. Call the length of time the step, . The distance covered during the step is the rise, the step itself is the run, and the estimate is rise over run:
In words: the change in position divided by the time it took. Starting from s:
| Step (s) | Position at (m) | Rise (m) | Rise ÷ step (m/s) |
|---|---|---|---|
| 1 | 4 | 3 | 3 |
| 0.1 | 1.21 | 0.21 | 2.1 |
| 0.01 | 1.0201 | 0.0201 | 2.01 |
| 0.001 | 1.002001 | 0.002001 | 2.001 |
The estimates close in on 2 m/s. Algebra shows why. The rise is , so rise over run is , and as shrinks toward zero only the 2 is left. Starting from any other moment , the rise is , and rise over run is , which closes in on .
The value that rise over run approaches as the step shrinks is the derivative, written
In words: the rate of change of as changes. This definition follows Hartman 2017, section 2.1.
On a graph of position against time, rise over run is the slope of the straight line through two points of the curve. Such a line is a secant. As the step shrinks, the second point slides toward the first and the secant swings toward the line that just touches the curve at one point, the tangent. The derivative is the slope of the tangent.
Velocity and acceleration
Velocity is the rate of change of position, , in metres per second (m/s). For the hand, : 2 m/s at the 1 s mark and 4 m/s a second later.
Acceleration is the rate of change of velocity, , in metres per second per second (m/s²). For the hand, rise over run of is whatever the step, so the acceleration is a steady 2 m/s².
A position in space is a vector, and each of its components has a rate of change of its own. Together those three rates are the velocity vector.
Five rules
Derivatives of formulas are found with a handful of rules instead of a table of shrinking steps. Each has a short reason. In the rules, and stand for quantities that change with , and and for their derivatives. Angles are measured in radians: the angle in radians is the length of the arc it cuts from a circle of radius 1, so a half turn, 180°, is radians.
| Rule | In symbols | Why |
|---|---|---|
| Power | the derivative of is | Multiplied out, is plus terms with or higher powers. Rise over run is plus terms that still contain and vanish as it shrinks. |
| Scale and sum | and | If a quantity is times as big, so is its rise. The rise of a sum is the sum of the rises. A fixed number does not rise at all, so its derivative is 0. |
| Product | Think of and as the sides of a rectangle. When both grow a little, its area grows by two thin strips, one along each side. The small corner where the strips meet vanishes faster than they do. | |
| Chain | if depends on and on , then | Rates multiply. If changes 3 times as fast as , and changes 2 times as fast as , then changes 6 times as fast as . |
| Sine and cosine | the derivative of is ; the derivative of is | A point that goes round a circle of radius 1 at one radian per second is at . It covers one unit of arc each second, at right angles to the arrow from the centre, so its velocity is . |
The power rule is shown here for whole numbers . The rules are stated in Hartman 2017, sections 2.3, 2.4 and 2.5.
The chain rule is at work in every moving joint. The length of a muscle depends on the angle of the elbow, and the angle depends on time, so the speed at which the muscle shortens is its change of length per unit of angle multiplied by the rate at which the elbow turns.
As an example of the rules together, has , which is 1.5 m/s at s.
Estimating a rate on a computer
Where no formula is to hand, a program falls back on rise over run with a small step. Two things then go wrong, at opposite ends.
Too big a step. The secant is not the tangent. For the estimate is , wrong by exactly . For other smooth curves the error also shrinks in proportion to the step (Driscoll and Braun 2022, section 5.5).
Too small a step. A computer stores a number to about 16 digits (Driscoll and Braun 2022, section 1.1). The positions at and at agree in most of those digits, and subtracting one from the other cancels them, leaving only the few digits in which they differ. With s, a millionth of a millionth of a second, the estimate at s comes out as 2.0002, right to only four digits. With s the computer can no longer tell from 1. It measures a rise of zero and reports a speed of zero.
The best step lies between the two. For this estimate it is near , the square root of the at which digits run out, and it gives about eight correct digits (the same section 5.5).
Try it: a shrinking step
The step in this lab is seconds: is a step of 1 s, is 0.01 s, and each increase of by 1 divides the step by ten.
- Check the worked example. With the step is 1 s, the rise 3 m and the estimate 3 m/s, against an exact slope of 2 m/s. Move to 1, 2 and 3: the estimate reads 2.1, 2.01 and 2.001 m/s while the secant swings onto the tangent.
- Predict with the power rule. Choose . Before looking, work out the exact slope at s and at s. They are 1.5 m/s and m/s.
- Predict with the sine rule. Choose . The exact slope at s is m/s, and at it is m/s.
- Let the step shrink. Return to at s with and press Play. In the first plot the estimate settles onto the exact slope and stays there until about , where it starts to wander.
- Find the best step. The second plot shows how far the estimate is from the exact slope, as a power of ten. It falls in a straight line while the step is too big, turns near , and climbs raggedly once digits are being lost.
- Predict the end. What does the estimate read at ? Zero: the rise can no longer be measured.
Slopes on a landscape
Many quantities depend on several numbers at once. The height of the ground depends on where you stand. Take a bowl-shaped valley whose height above its lowest point is
with and the two level directions of the world frame, all in metres.
A partial derivative is the slope met when one of those numbers changes and the others are held fixed. Walking in the direction, does not change, so it is treated as a fixed number when the rules are applied:
In words: the curly marks a slope along one direction only. The gradient is the vector made of the partial derivatives, written .
To see what the gradient means, take a small step across the ground. The climb is the slope along multiplied by the distance moved along , plus the same along :
That is a dot product, and from the vectors chapter it equals the length of the gradient, multiplied by the length of the step, multiplied by the cosine of the angle between them. For a step of fixed length the climb is greatest when the step points along the gradient and most negative when it points the opposite way. It is zero when the step is perpendicular to the gradient: that is a step along a contour, a line of equal height. So the gradient points straight uphill, and its length is the steepness: the height gained for each metre walked in that direction. Partial derivatives and these properties of the gradient are set out in Hartman 2017, sections 12.3 and 12.6 and Long and Keller 2026, sections 11.4 and 11.8.
Worked example. Stand at m, m.
| Quantity | Calculation | Result |
|---|---|---|
| Height | 0.34 m | |
| Slope along | 0.8 | |
| Slope along | 0.6 | |
| Steepness | 1 |
The gradient is . Uphill lies in that direction, where the ground rises 1 m for each metre walked, and downhill is .
The simulator uses this idea with stored energy in the place of height. A stretched rubber band stores energy, and so does stretched tissue in the body; how much depends on the positions of its ends. The pull it exerts is minus the gradient of that energy: it pushes its ends downhill in energy, and harder where the slope is steeper. Energy and work takes this up.
Try it: which way is uphill
- Check the worked example. At the start the height reads 0.34 m, the slopes along and read 0.8 and 0.6, and the steepness reads 1. The arrow points uphill, across the contour rings at right angles.
- Predict, then check. Move the start to , keeping m. The slope along becomes 0 and the gradient points straight along .
- Cross to the other side. Set m. The slope along changes sign to −0.8: uphill is now toward .
- Find level ground. Set both controls to 0. Both slopes are zero and so is the gradient. At the bottom of a valley no direction is uphill.
- Walk downhill. Return to the worked example and press Play. The marker moves against the gradient, a quarter of a metre per second for each unit of steepness. Its path bends, because the bowl is steeper along , and it slows to a stop at the bottom, where the gradient vanishes.
What this model leaves out
- Finding the motion from its rates. Here the position was given and its rate found. A simulator faces the reverse: it knows the rates and must find the positions. That is the subject of the next chapter.
- Curves with corners and jumps. At a sharp corner there is no single tangent, so no single slope. Contact between tissues produces such corners, and the part on solving deals with contact.
Summary
- The derivative is the value that rise over run approaches as the step shrinks. On a graph it is the slope of the tangent.
- Velocity is the derivative of position, and acceleration is the derivative of velocity.
- Five rules give the derivative of a formula: power, scale and sum, product, chain, and sine and cosine.
- For a quantity that depends on several numbers, the partial derivatives form the gradient, which points uphill and whose length is the steepness.
- A computer estimate needs a step that is small but not too small: near for rise over run with 16 digits.
Next: the reverse question, how to recover a total from its rate: adding up small pieces.