Skip to main content
Back to module
Calculus & Linear Algebra for STEM · Multivariable Ideas

Where this shows up

Reading30mLesson 3 of 3 in this module

Connect derivatives, integrals, gradients and matrices to probability, machine learning, engineering and science.

Why this matters

You now have the core of calculus and linear algebra: rates, accumulation, differential equations, vectors, matrices, gradients and eigenvalues. This lesson maps those ideas onto the courses and careers that use them, so you can recognise them when they appear in a statistics paper, a structural model or a machine learning library. There is no new technique here, only connections.

Probability and statistics

  • Densities are integrated. For a continuous random variable with density f(x), the probability of landing between a and b is the area ∫ from a to b of f(x) dx. The total area is 1. The mean is ∫ x·f(x) dx, a weighted average computed with an integral.
  • The CDF and PDF are a derivative pair. The cumulative distribution function F(x) is the integral of the density, and the density is the derivative of F.
  • Maximum likelihood is optimisation. To fit a model, you choose parameters that maximise the likelihood (usually its logarithm). That means setting derivatives to zero or running gradient ascent, exactly as in Lessons 3 and 10.
  • Covariance matrices summarise how variables move together. Their eigenvectors give PCA's principal components, and their eigenvalues say how much variance each one explains.
  • Actuarial models use exponential decay and integrals for survival probabilities and the present value of continuous cash flows, for example ∫ e^(−δt) · cash flow dt.

Machine learning

  • Data are matrices. A dataset with n rows and p features is an n × p matrix X. A linear model's predictions for every row at once are X @ w: one matrix-vector product.
  • Training is gradient descent. The loss (for example mean squared error) is a function of the weights. Its gradient says how to nudge every weight to reduce the loss, and the update w ← w − η∇L repeats until it settles.
  • Backpropagation is the chain rule. A neural network is a long composition of functions; backprop applies the chain rule layer by layer to get the gradient efficiently.
  • Least squares has a matrix solution. Linear regression's best weights solve the normal equations (XᵀX) w = Xᵀy, a linear system like those in Lesson 8. Libraries solve it with stable factorisations rather than an inverse.
  • Embeddings and similarity use dot products and cosine similarity (Lesson 7) to compare words, images and users.

Engineering and the physical sciences

  • Statics checks that force vectors sum to zero at every joint, which becomes a matrix system for a whole truss. Finite element software solves systems with millions of unknowns.
  • Dynamics and circuits are differential equations: Newton's second law, RC and RLC circuits, heat flow. Simulation tools step them forward with methods descended from Euler's.
  • Vibration analysis finds a structure's natural frequencies as eigenvalues.
  • Thermodynamics relies on partial derivatives (how energy changes with temperature at constant pressure).
  • Chemistry uses rate laws (differential equations) for kinetics, integrals for work and heat, and matrices for balancing reactions and fitting spectra.
  • Operations research optimises costs subject to constraints (linear programming is linear algebra with inequalities), and sensitivity analysis is a set of partial derivatives.

The tools you will use

Most of this work happens in software, not on paper. NumPy handles vectors, matrices and eigenvalues; SciPy adds integration (scipy.integrate), differential equation solvers (solve_ivp) and optimisers (scipy.optimize); SymPy does symbolic algebra; PyTorch and JAX compute gradients automatically. The scientific-python, probability-and-inference and machine-learning-foundations courses build on this one directly.

The value of knowing the maths is judgement: choosing a sensible step size, spotting a singular matrix, recognising that a model diverged because the learning rate was too large, or that an integral needs more points.

Quick recap

  • Probability: integrals give probabilities and expectations; fitting a model is optimisation.
  • Machine learning: data are matrices, training is gradient descent, backprop is the chain rule.
  • Engineering and science: systems of equations, differential equations and eigenvalues model structures, circuits and reactions.
  • Software does the arithmetic; understanding the maths lets you trust and debug it.

Try it

This lesson has no code exercise. Use the quiz in the Do tab to connect each technique with where it is used.

Also in this lesson: