Introductory lesson on derivatives explaining rate of change, tangents, instantaneous speed, practical applications in self driving and machine learning, and an introduction to the power rule.
Welcome — I’m Alan Chapman from KodeKloud.In this lesson we introduce derivatives: the mathematical tool that measures change. You’ll learn an intuitive, visual interpretation of derivatives using distance–time graphs, see how derivatives quantify instantaneous rates (like speed), and discover how these ideas apply to real-world systems such as self-driving cars and image-recognition models. We also preview the power rule so you can compute derivatives algebraically.
Why focus on derivatives? Because analyzing how things change lets models make better decisions — from avoiding collisions in autonomous vehicles to improving image recognition. Derivatives provide the quantitative measure of that change.
Derivatives measure rate of change. In physics, speed is the rate of change of distance with respect to time. In machine learning, derivatives (and gradients) measure how model outputs change with respect to parameters — information that optimization algorithms use to improve performance.
Self-driving cars give a concrete example. They rely on sensors and math (no instincts). To travel safely they must monitor distances, adjust speed smoothly, and stop or change lanes when necessary. Those decisions all depend on knowing how speed or distance are changing over time — exactly what derivatives tell us.Consider this roadworks scenario: cones, a narrow lane, and a car approaching at speed. The vehicle must evaluate whether to brake, hold speed, or change lanes. To choose correctly it needs the rate at which its speed or distance to obstacles is changing — this is derivative information.
A simple, concrete example helps build intuition. Meet Julia.
She travels toward the library and hits traffic.
For the first period she moves steadily: 30 metres every 15 seconds.
After 45 seconds she has covered 90 metres — that’s 2 metres per second.
On a distance–time graph, steady motion shows up as a straight line. The slope of that line (rise over run) equals her speed; in this case the slope is 2 m/s.After 45 seconds Julia stops for 15 seconds, then turns back home. The distance–time graph therefore has three phases: rising (moving away), flat (stopped), and falling (returning). Each phase corresponds to a different derivative value:
Rising straight line → positive slope → moving away.
Horizontal line → zero slope → stopped.
Falling line → negative slope → getting closer (negative rate).
Key intuition at a glance:
Slope (tangent)
Meaning
Steep upward
Large positive rate — fast increase (high speed)
Gentle upward
Small positive rate — slow increase
Horizontal
Zero rate — no change (stopped)
Downward
Negative rate — decrease (moving toward start)
In the real world, motion is usually smooth rather than piecewise-linear. Julia doesn’t stop or start instantly — she accelerates and decelerates smoothly, producing a curved distance–time plot. To find her instantaneous speed at any moment on that smooth curve, we draw a tangent at the point and compute its slope. That slope is the derivative at that instant.A tangent line gives local, instantaneous information:
A steep tangent → high instantaneous speed.
A flatter tangent → slower instantaneous speed.
A horizontal tangent → zero instantaneous speed.
A negative tangent → distance decreasing (moving back).
Self-driving systems use the same concept to estimate instantaneous velocities and make split-second decisions: should the car brake now, or is it safe to change lanes?To understand passing an obstacle: imagine the car approaching a roadworks site. If the distance from the car to the works is plotted versus time, the graph will dip as the car approaches (negative slope) and then rise after passing (positive slope). The moment when the driver (or autopilot) begins braking is a point on that curve — the instantaneous speed there equals the tangent slope.
Computers don’t literally draw geometric tangents each time. Instead they use algebraic formulas from calculus (and numerical methods) to compute derivatives quickly. These computations let systems evaluate rates of change in real time for control and optimization tasks.
Next step: basic algebraic differentiation. The power rule is the simplest and most commonly used formula for derivatives. It states:
If f(x) = x^n, then f'(x) = n * x^(n-1)
Example:
f(x) = x^3f'(x) = 3x^2
Using formulas like the power rule, a program can compute instantaneous rates without geometric construction. Those computed derivatives are the building blocks for gradients, which guide optimization algorithms in machine learning.Further reading and references: