CALCULUS / 2. DERIVATIVES — INTUITION
Derivatives — Intuition & Definition
The instantaneous rate of change — slope at a single point
EXPLANATION
The derivative measures how fast a function changes at a specific point. Formal definition (from Sebastian Raschka's appendix): f'(x) = df/dx = lim(Δx→0) [f(x+Δx) - f(x)] / Δx Geometric interpretation: the slope of the tangent line to the curve at point x. Two notations (both mean the same thing): • Lagrange: f'(x) ← prime notation • Leibniz: df/dx ← fraction notation, reads as "d of f with respect to x" Leibniz notation is preferred in ML because it makes the chain rule intuitive: df/dx = (df/dg) · (dg/dx) — the dg terms "cancel" visually. Key derivatives to memorize: • d/dx(xⁿ) = n·xⁿ⁻¹ Power rule • d/dx(eˣ) = eˣ Exponential • d/dx(log x) = 1/x Natural log • d/dx(sin x) = cos x • d/dx(cos x) = -sin x Sign of derivative tells you everything: • f'(x) > 0 → function increasing at x • f'(x) < 0 → function decreasing at x • f'(x) = 0 → critical point (potential min/max)
DIAGRAM
f(x) = x² — computing derivative from definition:
f'(x) = lim(Δx→0) [(x+Δx)² - x²] / Δx
= lim(Δx→0) [x²+2xΔx+(Δx)² - x²] / Δx
= lim(Δx→0) [2xΔx + (Δx)²] / Δx
= lim(Δx→0) [2x + Δx]
= 2x ← derivative is 2x
At x=3: slope = 2(3) = 6 (steep, going up)
At x=0: slope = 0 (flat, minimum)
At x=-2: slope = -4 (going down)
Geometric: tangent line at each point
╱╲
╱ ╲ tangent at x=2 has slope 4
╱ ╲___CODE