Math for ML - Intermediate - 12 min

Learn Derivatives & Slope

A free visual AI and machine learning lesson with an interactive 3D visualization, plain-English theory, and quiz.

Last updated: 2026-05-13.

A derivative answers the most useful question in mathematics: 'At this exact point, how fast is this changing?' It's the slope of the curve at a single point — the steepness of the hill right under your feet. Without derivatives, gradient descent doesn't exist. Without gradient descent, deep learning doesn't exist.

What the sign of the derivative tells you

Positive derivative → function is rising. Negative derivative → function is falling. Zero derivative → you're at a local minimum or maximum. In ML, we hunt for the zero — that's where the loss is lowest.

Common derivatives to know

Power rule:    d/dx (xⁿ)   = n·xⁿ⁻¹
Constant:      d/dx (c)    = 0
Exponential:   d/dx (eˣ)   = eˣ
Log:           d/dx (ln x) = 1/x
Sine:          d/dx (sin x) = cos x
Cosine:        d/dx (cos x) = −sin x

Memorise the power rule and exponential — they appear in every ML derivation

Practice questions

  1. What does a derivative of zero at a point mean?
  2. The loss function is currently decreasing as we increase a weight. What is the sign of its derivative?
  3. What rule do you use to differentiate a function nested inside another function, like f(g(x))?
  4. Using the power rule, what is the derivative of x⁴?

Related AI learning resources

Premium lesson notes and simulations | AI project templates | More Math for ML lessons