Skip to content
AI-grafen
DAI developerMathematics· about 40 min· fundamentals that rarely change· verified 2026-09-20· EN

Derivatives and optimisation

Be able to interpret the derivative as a slope, differentiate simple functions (polynomials), find a minimum by setting the derivative to zero, and understand the chain rule as "slope times slope".

Practise in Mattegrafen ↗ · Matematik 3cPractise in Mattegrafen ↗ · Deriveringsregler — potens, exponential

Prerequisites

Intuition

The derivative f'(x) is the slope of the curve at the point x. A positive derivative: the curve goes up. Negative: down. Zero: flat — a peak, a valley or a plateau.

If you are standing on a curve in fog and want to get down into the valley: feel the slope under your feet and walk in the direction that goes down. The derivative is that feeling. The whole of machine learning is built on walking down an error curve that way.

Formal

The rules you need:

  • (xⁿ)' = n·xⁿ⁻¹, constants disappear, sums are differentiated term by term
  • (c·f)' = c·f'
  • The chain rule: if y = f(g(x)) then y' = f'(g(x)) · g'(x) — "outer slope times inner slope"

The minimum of f(x) = x² − 6x + 10: f'(x) = 2x − 6 = 0 ⇒ x = 3, f(3) = 1.

The chain rule on (3x + 1)²: the outer is u², the inner is 3x + 1. The derivative: 2(3x + 1) · 3 = 6(3x + 1).

The chain rule is all of backpropagation: a network is a long chain of functions, and the slope for a weight far back is the product of all the slopes along the way.

Mastery means

  • Differentiates a polynomial and solves f'(x) = 0
  • Applies the chain rule to a composite function

Sign in to do the exercises and build your mastery up.

Sources

All the sources and licences