Home Teaching Research Textbook TA & Grader positions

21-266 Vector Calculus using Matrix Algebra

Course description

21-266 is a first course in multivariate calculus geared towards students with a solid foundation in linear algebra (at the level of a B grade or higher in 21-241). It covers all the material that would appear in any standard multivariate calculus course, such as 21-259, but makes use of matrices and linear transformations to gain a deeper understanding, more general computational results, and therefore a broader range of applications.

Topics covered include scalar-valued and vector-valued functions, the principal axis theorem, quadrics (including conic sections and quadric surfaces), new coordinate systems, partial derivatives, tangent planes, the Jacobian matrix, the chain rule, gradient, divergence, curl, the Hessian matrix, linear and quadratic approximation, local and global extrema, Lagrange multipliers, multiple integration, parametrised curves, line integrals, conservative vector fields, parametrised surfaces, surface integrals, Green's theorem, Stokes's theorem and Gauss's theorem.

21-266 vs. other multivariate calculus courses

Of the dizzying number of multivariate calculus courses offered at CMU, 21-266 is most similar to 21-259 and 21-268:

21-266 most closely resembles 21-259, in that it covers all the standard topics and methods of multivariate calculus and is not a proof-based course—for this reason, it serves as a synonym of 21-259 for course prerequisites. However, because 21-266 has a linear algebra prerequisite, it covers topics in greater generality and in more conceptual depth than 21-259 (see 'Preview' below).

21-266 also resembles 21-268 in that it assumes prior knowledge of linear algebra and has a greater conceptual focus, but 21-266 is not a proof-based course and focuses primarily on the methods of calculus. In 21-266 we will gain an understanding of why results are true and will take care to state hypotheses carefully, but we will not go as far as proving results formally as is done in 21-268.

What does 21-266 have to do with computer science?

21-266 was designed according to the specifications of the School of Computer Science in order to meet their curricular needs. The course used to be reserved for SCS undergraduates and used to be called Vector Calculus for Computer Scientists. It is recommended that most SCS undergraduates take 21-266 to fulfill their multivariate calculus requirement, since future CS courses will draw from the 21-266 course content.

As of Spring 2026, by popular demand, 21-266 is open to students from all colleges. SCS students are prioritised for registration, so most non-SCS students will initially be added to the waitlist, but the reservations will be lifted after the registration period ends. The waitlists are handled on a first-come-first-serve basis, and I (Clive Newstead) have no control over the waitlist, so if you are waitlisted, please be patient and hold your pleading emails!

21-266 is a mathematics course, not a computer science course: at various points we will allude to areas in computer science (and other disciplines, such as physics, engineering and statistics) where the course material may be applied, but 21-266 does not assume any prior computer science knowledge, nor does it assume that students will go on to take computer science courses in the future.

Preview

Functions, in general, are extremely complicated mathematical objects, and they are difficult to use in computations. Calculus is all about building up a set of algebraic and numerical tools to reduce problems involving general functions to problems involving simpler functions that are easier to understand and compute, such as polynomials. A rich theory and many useful applications follow.

For example, for a (sufficiently nice) function ${\mathbf{f} : \mathbb{R}^n \to \mathbb{R}^m}$ at a point ${\mathbf{a} \in \mathbb{R}^n}$, we find that ${\mathbf{f}(\mathbf{x}) \approx \mathbf{f}(\mathbf{a}) + M(\mathbf{x}-\mathbf{a})}$ when ${\mathbf{x} \approx \mathbf{a}}$, where ${M}$ is a particular constant ${m \times n}$ matrix. In this sense, the function ${\mathbf{f}}$ behaves like the linear transformation represented by the matrix ${M}$ near the point ${\mathbf{x}=\mathbf{a}}$ (with translations by ${-\mathbf{a}}$ and by ${\mathbf{f}(\mathbf{a})}$, respectively, on either side). By studying this linear transformation we gain useful information about ${\mathbf{f}}$ and can approximate its values.

The matrix ${M}$ is called the Jacobian matrix of ${\mathbf{f}}$ at ${\mathbf{a}}$. It generalises the notion of a derivative of a single-variable function: compare the above with the univariate calculus result that ${f(x) \approx f(a) + m(x-a)}$ when ${x \approx a}$, where ${m=f'(a)}$. The Jacobian matrix is one of the central objects of study in 21-266 and is ubiquitous in vector calculus.

While we can study the Jacobian matrix in full generality, courses without a linear algebra prerequisite can only cover it in the guise of its individual components (called partial derivatives) or in the scalar-valued case (called the gradient vector); this makes formulae much more difficult to state, since they cannot include any matrix algebra, and much more difficult to understand, since the geometrical intuition gets buried.

This is just one of many examples of instances where we gain a deeper theoretical understanding and cleaner computational result by exploiting the linear algebra underlying multivariate calculus. For another example, the chain rule in 21-259 looks like this:

If ${z=g(x,y)}$, ${x=f_1(u,v)}$ and ${y=f_2(u,v)}$, then ${\dfrac{\partial z}{\partial u} = \dfrac{\partial z}{\partial x} \dfrac{\partial x}{\partial u} + \dfrac{\partial z}{\partial y} \dfrac{\partial y}{\partial u} \text{ and } \dfrac{\partial z}{\partial v} = \dfrac{\partial z}{\partial x} \dfrac{\partial x}{\partial v} + \dfrac{\partial z}{\partial y} \dfrac{\partial y}{\partial v}}$.

This result needs to be modified when the numbers of variables in each dependence changes, e.g. a different formula would be used if $z$ depended on three variables instead of just two.

In 21-266, the chain rule looks like this:

If ${\mathbf{z}=\mathbf{g}(\mathbf{x})}$ and ${\mathbf{x}=\mathbf{f}(\mathbf{u})}$, then ${D_{\mathbf{u}}\mathbf{z} = (D_{\mathbf{x}}\mathbf{z})(D_{\mathbf{u}}\mathbf{x})}$.

(The right-hand side of the last equation is a product of Jacobian matrices.) This single result already covers all variable dependence cases, and is more general in that the variable $\mathbf{z}$ can be a vector, and not just a scalar. The 21-259 formulae then all follow from this single result by looking at the individual terms of the matrix product.