Linear Algebra
10.27 min read

Why We Need Derivatives

To minimize ff, we need to know which direction is "downhill" at any point. This is exactly what the derivative tells us: the rate at which ff changes as we perturb the input. Without derivatives, we would need to evaluate ff at every possible input — which is impossible for continuous functions.

For a one-variable function f(x)f(x), the derivative f(x0)f'(x_0) gives the slope of the tangent line at x0x_0. If f(x0)>0f'(x_0) > 0, moving right increases ff; if f(x0)<0f'(x_0) < 0, moving right decreases ff. At a minimum, f(x)=0f'(x^*) = 0 — flat tangent, no immediate improvement from either direction.

In multiple variables, the gradient f(x)\nabla f(\mathbf{x}) generalizes the derivative — it points in the direction of steepest ascent. The negative gradient f-\nabla f points downhill. This is the direction we follow in gradient descent.

Formal View

Remark 10.1 — Why Derivatives Matter for Optimization
At a local minimum xx^* of a differentiable function ff, the derivative must satisfy f(x)=0f'(x^*) = 0 (in 1D) or f(x)=0\nabla f(\mathbf{x}^*) = \mathbf{0} (in multiple dimensions). This necessary condition dramatically restricts where minima can occur.

Interactive Visualization

Interactive Line Explorer

Why This Matters

Derivatives make optimization tractable — they tell you where to step without evaluating ff everywhere.

  • Backpropagation in neural networks: compute derivatives of loss w.r.t. every parameter via the chain rule.
  • Newton's method: use both first and second derivatives to find roots or minima faster than gradient descent.
  • Sensitivity analysis: f(x0)f'(x_0) tells how much the optimum changes if a constraint changes slightly.

Quiz

Question 1

If f(x)=0f'(x^*) = 0, then xx^* must be a minimum.

Question 2

The negative gradient f(x)-\nabla f(\mathbf{x}) points in the direction of:

Common Mistakes

  • Thinking f(x)=0f'(x^*) = 0 is sufficient for a minimum — it is only necessary. Check second-order conditions or function values to confirm.
  • Confusing the derivative (a number, the slope) with the gradient (a vector, pointing uphill).