Module 03
Calculus and Mathematical Analysis
How do we analyze the behavior and changes of complex mathematical functions?
- lessons
- 20
- duration
- 35 h
- concepts
- 119
- available in English
- 20 / 20
- completed by you
0 of 20
Where it fits
Prerequisites
Leads to
Overview
Begin with a dense review of single-variable calculus and real analysis: limits, integrals, series, Taylor expansions, completeness, compactness and fixed points. Continue to the module’s core: multivariable differentiation as local linear algebra (differential, Jacobian, chain rule as a product of Jacobians, JVPs and VJPs, Hessian and multivariable Taylor), inverse and implicit function theorems, multiple integration with change of variables, and vector calculus. Finish with analysis of functions (uniform convergence, Fourier analysis and Laplace’s method) and dynamical systems: ODEs with existence, solution methods and stability, notions of PDEs, and the frontier of neural ODEs and the adjoint method.
Why it matters
Training a network is multivariable calculus: backpropagation is the chain rule applied with VJPs, optimization uses Taylor’s quadratic model, and the Hessian determines steps, stability and sharpness of minima. Change of variables with the Jacobian determinant underlies normalizing flows; continuity and heat equations support diffusion and flow matching; linear ODEs support state-space models (S4, Mamba); and Lyapunov stability appears in robot control and gradient-descent dynamics. In quantitative finance, second-order Taylor expansions give the Greeks and the Black–Scholes equation becomes the heat equation after a change of variables.
Lessons 20
- 01Limits, continuity and the derivative in one variableA dense, rigorous review of single-variable differential calculus with an eye to what follows: ε–δ language, little-o and big-O notation, the derivative as the best linear approximation, the mean value theorem and Lipschitz continuity. Each result connects to a concrete ML use: activation Lipschitz constants, finite-difference error and guaranteed bisection.
- 02The Riemann integral and the fundamental theorem of calculusA review of the Riemann integral through Darboux sums, both parts of the fundamental theorem of calculus, frequently used integration techniques (substitution and parts), and improper integrals, with the Gamma function as a first serious example. Convergence of improper integrals is emphasized because it determines whether expectations and moments exist.
- 03Sequences, series and completeness of the real numbersReview real sequences and series from the supremum axiom through Bolzano–Weierstrass and Cauchy criteria, then measure convergence order and rate.
- 04Taylor in one variable: polynomials, remainders and power seriesA review of Taylor's theorem with its three remainder forms (Peano, Lagrange and integral), and power series with their radius of convergence. Smooth and analytic functions are distinguished, and complex singularities are shown to determine the radius. The lab builds exp from scratch as a mathematical library does: argument reduction plus a polynomial with an error bound.
- 05Metric spaces, compactness and the Banach fixed-point theoremGeneralize convergence and continuity to metric spaces to reason simultaneously about ℝⁿ, function spaces and policy spaces. Covers topology of ℝⁿ, compactness and its consequences (extreme values and uniform continuity), completeness and Banach's fixed-point theorem, which later proves the inverse function and Picard–Lindelöf theorems and explains value iteration convergence.
- 06Partial derivatives, directional derivatives and the gradientA first step into several variables: path-dependent limits, partial and directional derivatives, and the gradient as steepest ascent direction and normal to level sets. A specialist idea is emphasized: the gradient depends on the chosen inner product, and changing the norm changes steepest descent (the gradient sign with ℓ∞, one coordinate with ℓ1, and the preconditioned gradient with Mahalanobis).
- 07The differential and the Jacobian matrixDefine the derivative of a map f: ℝⁿ → ℝᵐ as the linear map that best approximates it (Fréchet derivative), and the Jacobian matrix as its representation. Study the C¹ criterion, linearization, Jacobian determinant as a local volume factor and the mean value inequality, with applications to robot kinematics and neural-layer sensitivity.
- 08The multivariable chain rule, JVPs and VJPsThe multivariable chain rule says the differential of a composition is the composition of differentials, a product of Jacobians. From it come two objects enabling deep learning: the Jacobian–vector product (JVP), pushing perturbations forward, and the vector–Jacobian product (VJP), pulling sensitivities backward. This lesson establishes the mathematics and cost of associating the chain; automatic differentiation algorithms are built in m09.
- 09The Hessian, multivariable Taylor and local geometryThe Hessian is the Jacobian of the gradient and describes a function's curvature in each direction. This lesson proves Schwarz symmetry, second-order Taylor expansion with remainder, critical-point classification and directional curvature as a Rayleigh quotient, and introduces the Hessian–vector product, enabling curvature calculations for models with millions of parameters without forming the Hessian.
- 10Inverse and implicit function theorems and implicit differentiationWhen an equation F(x, θ) = 0 locally defines x as a differentiable function of θ, and how to differentiate that function without solving it explicitly. The inverse function theorem is proved using Banach's fixed point theorem, the implicit function theorem is derived from it, and both are applied at today's practical frontier: differentiation through solutions of equations and optimization problems (equilibrium layers, hypergradients, implicit meta-learning).
- 11Multiple integrals and change of variablesIntegration in ℝⁿ: iterated integrals and Fubini's theorem, change of variables with the absolute Jacobian determinant, polar and spherical coordinates, the Gaussian integral in any dimension, the volume of the n-dimensional ball and differentiation under the integral sign. These are the mathematical foundations of density transformations, normalizing flows and reparameterized gradient estimators.
- 12Vector calculus: fields, line integrals and integral theoremsVector fields, work and flux, divergence and curl, and the theorems relating behavior inside a region to behavior on its boundary (Green, Gauss and Stokes). Special attention is paid to what recurs in generative AI: score fields as conservative fields, divergence as a flow's expansion rate, and multivariable integration by parts underlying score matching.
- 13Laplace's method and asymptotic approximationsApproximate integrals depending on a large parameter, ∫e^{n f(x)}dx, by replacing the integrand with a Gaussian centered at the maximum. This yields Stirling's formula, the temperature behavior of logsumexp and softmax, and the idea that becomes the Laplace approximation of a posterior in m14. Asymptotic series are introduced: they may diverge while remaining excellent approximations.
- 14Uniform convergence and function approximationThe jump from sequences of numbers to sequences of functions: pointwise versus uniform convergence, the supremum norm and completeness of C[a, b], theorems for interchanging limits with integrals, derivatives and series, and two approximation results with consequences for learning: the Weierstrass theorem (with Bernstein polynomials) and Arzelà–Ascoli. This underlies universal approximation, Fourier series and existence of ODE solutions.
- 15Fourier series and the Fourier transformFunctions as vectors in an inner-product space and their frequency decomposition. The lesson covers L², Fourier series and their convergence modes (including the Gibbs phenomenon), Parseval's identity, the Fourier transform and the convolution theorem. These underlie signal spectral analysis, characteristic functions in m04, positional encodings and neural network spectral bias.
- 16ODEs: existence, uniqueness and solution methodsOrdinary differential equations as evolution laws. Prove Picard–Lindelöf using Banach's fixed point, examine uniqueness failures and finite-time blow-up, use Grönwall for continuous dependence on data, and review analytic solution methods: separable, first-order linear, and constant-coefficient second-order linear equations through the damped oscillator.
- 17Linear ODE systems, the matrix exponential and phase portraitsConstruct the matrix exponential, classify planar phase portraits, solve systems with inputs using Duhamel, prove Liouville’s formula and discretize continuous systems for state space models.
- 18Stability, Lyapunov functions and gradient flowsWhat happens near an equilibrium of a nonlinear system and how to certify it without solving the equation. Study stability notions, linearization (Hartman–Grobman), Lyapunov's direct method with LaSalle, gradient flow with its natural Lyapunov function, explicit Euler step stability as the gradient-descent step limit, and basic bifurcations. The lesson closes with the edge of stability in real networks.
- 19Introduction to partial differential equationsA conceptual guided tour, without numerical methods, of PDEs in AI and finance: transport and continuity (characteristics), heat (Gaussian fundamental solution and smoothing), waves (d'Alembert) and Laplace (harmonic functions). PDEs are classified, well-posedness discussed, and boundary problems solved by separation of variables with Fourier series. Numerical schemes belong to m29.
- 20Continuous dynamics in deep learning: sensitivities, the adjoint method and Neural ODEsHow to differentiate an ODE solution with respect to initial conditions and parameters, and how to do so with constant memory using the adjoint method, the continuous analog of reverse mode. This lets us interpret a ResNet as an Euler discretization, construct Neural ODEs and derive the instantaneous change-of-variables formula for continuous flows. The lesson closes the module by bringing together the chain rule, VJPs, linear systems and the continuity equation.
Module capstone
Identify, analyze and certify a dynamical system from data
Starting from noisy trajectories of a damped, forced pendulum (or a predator–prey model), build your own calculus toolkit: verified numerical Jacobians and Hessians; parameter fitting with gradients obtained by the adjoint method and checked against forward sensitivities and finite differences; stability analysis of equilibria by linearization; a Lyapunov function certifying a basin of attraction; the loss Hessian spectrum at the optimum to identify well-determined parameter combinations; and Fourier analysis of residuals to detect unmodeled dynamics. Deliver an executable notebook justifying each result with the module’s theorems.
Check what you already know
- Prove a simple limit using ε–δ and bound a differentiable function’s Lipschitz constant.
- Determine convergence of improper integrals and use the Gamma function.
- Determine the order and rate of convergence of a sequence of errors.
- Bound the error of a Taylor polynomial using the Lagrange remainder.
- Apply the Banach fixed-point theorem with its a priori and a posteriori error bounds.
- Compute gradients and directional derivatives and verify them numerically.
- Compute Jacobians and Jacobian determinants of vector-valued maps.
- Apply the multivariable chain rule as a product of Jacobians and calculate VJPs without forming the Jacobian.
- Classify critical points using Hessian eigenvalues, including degenerate cases.
- Differentiate implicitly using the implicit function theorem.
- Compute double integrals using polar coordinates and obtain the density of a transformed random variable.
- Apply Green’s theorem and the divergence theorem.
- Solve first-order linear ODEs and second-order ODEs with constant coefficients.
- Classify equilibria of a 2D linear system using trace and determinant.
- Solve the heat equation on an interval by separation of variables.
References
- Calculus
- Understanding Analysis
- Vector Calculus, Linear Algebra, and Differential Forms: A Unified Approach
- Differential Equations, Dynamical Systems, and an Introduction to Chaos
- Mathematics for Machine Learning
- Matrix Calculus for Machine Learning and Beyond (MIT 18.S096)