This SL mini-lesson introduces calculus for AI: differentiation (gradient functions, tangents, increasing/decreasing, optimisation), kinematics (displacement–velocity–acceleration), integration as the reverse of differentiation and as area, and the trapezoidal rule for estimating area under a curve.
AI flavour: calculus is applied to rates of change and areas — often estimated numerically with the trapezoidal rule.
Work through each screen, answer the questions as you go (some are wordy, some are calculations) and collect ⭐ stars. Every number on the calculation screens has been re-derived and checked. Press Start when you are ready.
Differentiation
The derivative & the power rule
The derivative f′(x) gives the gradient of the curve at each point.
if f(x) = a xn then f′(x) = a n xn−1differentiate term by term; constants differentiate to 0
Worked example
f(x) = 3x² − 4x + 1.
f′(x) = 6x − 4.
Gradient at x = 2: f′(2) = 6×2 − 4 = 8
Calculate
Your turn — evaluate a derivative
1For f(x) = 3x² − 4x + 1, find f′(2).
Hint: f′(x) = 6x − 4, then substitute x = 2.
Using derivatives
Tangents, increasing/decreasing & optimisation
Increasing where f′(x) > 0; decreasing where f′(x) < 0.
Stationary points where f′(x) = 0 (maxima, minima).
Tangent line at x = a has gradient f′(a) through (a, f(a)).
Optimisation: to maximise/minimise a quantity, model it as a function, set the derivative to 0, and check it is a max or min.
Quick check
What is f′(x)?
?The derivative f′(x) of a curve tells you its:
Kinematics
Displacement, velocity & acceleration
Motion links through calculus: velocity is the derivative of displacement; acceleration is the derivative of velocity.
v = ds⁄dt · a = dv⁄dtintegrate to go back: s = ∫v dt, v = ∫a dt
Worked example
s(t) = t³ − 3t² (metres).
v(t) = 3t² − 6t, so v(4) = 48 − 24 = 24 m/s
a(t) = 6t − 6, so a(4) = 24 − 6 = 18 m/s²
Calculate
Your turn — velocity
2A particle has displacement s(t) = t³ − 3t². Find its velocity v = ds⁄dt at t = 4 (in m/s).
m/s
Hint: v(t) = 3t² − 6t, then substitute t = 4.
Integration
Integration as anti-derivative & area
Integration reverses differentiation and measures the area between a curve and the x-axis.
∫ a xn dx = a xn+1⁄(n+1) + Cdefinite: ∫ab f(x) dx = F(b) − F(a)
Worked example
∫₁³ (2x + 1) dx = [x² + x]₁³
= (9 + 3) − (1 + 1) = 12 − 2 = 10
Calculate
Your turn — definite integral
3Evaluate ∫₁³ (2x + 1) dx.
Hint: antiderivative is x² + x; compute (3²+3) − (1²+1).
Trapezoidal rule
Estimating area numerically
When a function is hard (or given only as data), estimate ∫ using the trapezoidal rule with strips of width h:
Area ≈ h⁄2 [ y₀ + yn + 2(y₁ + … + yn−1) ]h = (b − a) ÷ n
Worked example
Estimate ∫₀⁴ x² dx with n = 4 strips (h = 1), y = 0,1,4,9,16.