Code › codeit-ai-sprint
From Average Rate of Change to Derivatives
A Codeit AI Engineer Sprint note on reviewing functions, rates of change, and the basic idea behind derivatives
Today the course moved past linear algebra and into average rate of change, instantaneous rate of change, and derivatives.
The first thing I revisited was the meaning of a function. A function describes a relationship where an input determines an output. If we have , then is determined by , so we can write it as .
The input does not have to be a single value. A function like takes multiple inputs, and the same basic idea still holds. Inputs go in, and an output is determined.
Slope is a rate of change. In the line , a slope of 2 means that when increases by 1, increases by 2. If I choose two points, the slope can be calculated as the change in divided by the change in .
One small question I had was about order. Do we have to put in the denominator? The answer is no, as long as the direction is consistent. If the denominator is , the numerator should also be .
The important part is consistency. If only one side changes direction, the sign changes. If both sides use the same direction, the slope stays the same.
A straight line has the same slope everywhere, but a curve does not. For a curve like , the steepness changes depending on where I look. So instead of one slope for the whole curve, I need the slope at a specific point, which is the slope of the tangent line.
The problem is that slope usually requires two points. To get the slope at one point, we first take two points on the curve, calculate the average rate of change, and then move the two points closer together.
This looked more complicated at first, but it is the same idea as . Since is written as , replaces , and replaces .
The course then rewrote as .
That substitution exists so the distance between the two points can be handled directly. If represents the horizontal distance between the points, bringing the two points together becomes the same as making approach zero. As gets closer to zero, the average rate of change gets closer to the instantaneous rate of change at that point.
That is the basic idea behind differentiation. The slope at one point is not pulled out of nowhere. It is approached by shrinking the distance between two points until the average rate of change becomes the rate of change at a single point.
For , calculating the instantaneous rate of change at eventually gives a slope of 2. If I keep as a variable instead of plugging in one value, the result is . That is the derivative function, a function derived from the original function.
Once the derivative exists, I do not need to repeat the limit calculation every time. If I want the slope at , I plug 2 into . If I want the slope at , I plug in 5. The original function tells me values by position, and the derivative tells me rates of change by position.
The notation also became clearer. At first, or looked like a symbol that appeared out of nowhere, but it is connected to the rate-of-change notation from earlier. and describe finite changes between two separated points. When the distance between those points keeps shrinking toward zero, the notation changes from to , so represents an extremely small change in compared with an extremely small change in .
So is not just an ordinary fraction. It is notation for asking how much changes when changes by a tiny amount. follows the same idea. If the value of is treated as , then differentiating with respect to means looking at the tiny change in over the tiny change in .
The shortcut rule was familiar: bring the power down and reduce the power by one.
The constant term disappears because its rate of change is zero. The formula explains it through , but the intuition is simpler. Differentiation measures change, and a constant does not change.
It was more interesting than I expected to slow down and clean up something I had passed over vaguely before.