Recommended resources
The freely available resources this lesson will direct you to.
Hello! Last lesson, you used partial derivatives to predict how a function changes when its inputs change independently. Now suppose those inputs depend on other variables. A quantity might depend on position, for example, while position depends on time. The multivariable chain rule accounts for every route through which a change can reach the quantity you care about.
In this lesson, you will arrange partial derivatives into Jacobian matrices and multiply those matrices to differentiate composite functions. This notation will be useful whenever higher physics calls for a change of coordinates, a trajectory through a field, or several coupled quantities.
The Jacobian gathers the partial derivatives
Suppose a function takes two inputs and produces two outputs:
There are four first partial derivatives: each output can respond to either input. We arrange them with outputs as rows and inputs as columns:
The Jacobian is the vector-valued counterpart of the total differential from last lesson. Near a point, it predicts the change in all outputs caused by a small input change:
Watch the short portion of The Jacobian Matrix – Explained by DataMListic for a visual introduction to why the derivatives occupy these particular rows and columns.
The Jacobian Matrix - Explained
Watch this introduction to the Jacobian as the collection of first partial derivatives for a vector-valued function.
Watch the matrix layout. Focus on which index identifies an output and which identifies an input; that convention will determine the order of multiplication in the chain rule.
For a function with inputs and outputs, its Jacobian has rows and columns. A scalar-valued function therefore has a one-row Jacobian. Keeping track of these dimensions is more than bookkeeping: it helps catch incorrect chain-rule formulas.
Why Jacobians multiply
Let be a set of intermediate variables, and let be the final outputs. From the local linear approximations,
Substituting the first relation into the second gives the Jacobian chain rule:
The evaluation points matter. Differentiate with respect to its intermediate inputs, then evaluate that Jacobian at . Differentiate with respect to the original inputs and evaluate it at .
If has components, has , and has , the multiplication has dimensions
Matrix multiplication is generally not commutative, so these dimensions also help establish the correct order.
The University of Toronto’s 2.3 The Chain Rule presents the general formula, then specializes it to a scalar output and to a function evaluated along a one-parameter path. Read those parts now; you can leave its examples and optional proof for later.
Read the University of Toronto notes to connect the matrix equation with its familiar partial-derivative form.
In Section 2.3, read the subsection “The Chain Rule,” beginning with the general rule and continuing through its final paragraph before “Important special cases.” Then, under “Important special cases,” read “The case ℓ=1” and “The case ℓ=n=1,” from the scalar cases. Notice how one matrix-product entry becomes a sum of contributions from all intermediate variables.
Here is that entry written explicitly. If the intermediate components are and the final components are , then
Each term represents one intermediate variable through which affects . The matrix product collects those terms for every output and every input at once.
Follow the paths, then calculate
For a scalar output , the Jacobian is a row. The diagram below shows two intermediate variables, each depending on both original inputs. The two colored routes from to contribute separate terms to the derivative with respect to ; the routes from work the same way.

Consider the concrete functions
Before substituting for and , compute the two Jacobians:
Their product is the complete derivative of :
For instance, at , the intermediate point is . Evaluating each Jacobian at its appropriate point gives
Thus, near , a small change in alone produces approximately change in the output; a small change in alone produces approximately . As a check, substituting first gives , whose two partial derivatives agree with the product.
A common source of errors is using the same notation for a partial derivative of , with its intermediate inputs held independent, and a partial derivative of the composite, whose intermediate inputs now vary with or . Naming both functions, as and , keeps those operations distinct.
Multiple outputs and physical trajectories
The matrix rule is not limited to a scalar final result. Suppose we retain the same , but want two outputs:
Now has two rows. At the intermediate point ,
Consequently, at ,
The first row reproduces the scalar calculation. The second row gives the sensitivities of the other output to the same two original inputs. One multiplication has handled both outputs without changing the rule.
A particularly useful physical case has one time input. Suppose a particle follows a planar path , while a scalar field assigns a value to each position. Here is a two-entry column, and is a two-entry row:
This is the last lesson’s total differential applied when the input changes are determined by a path, rather than chosen independently. For example, take and a circular path , . Since and , the chain rule gives . The field value is constant on that path, even though both coordinates are changing.
A coordinate-change example
The same calculation applies when the original inputs are coordinates rather than time. In polar coordinates, and . If , the Jacobian chain rule determines both partial derivatives of in one product.
Read “Example 1: Polar coordinates” in the same University of Toronto notes. It provides a useful model for checking which variables are held fixed in each derivative.
Read the polar-coordinate example to see the matrix rule applied to a coordinate change.
In Section 2.3, under “Some examples” and “Example 1: Polar coordinates,” begin at the example’s opening description of distance and angle. Follow the polar example through the paragraph immediately before “Example 2: Motion of a particle.” Focus on the two columns of the coordinate Jacobian: the first records changes with r at fixed \theta, and the second records changes with \theta at fixed r.
In particular,
The first column of the product is ; the second is . In both, and must be evaluated at the corresponding Cartesian point, not at . Coordinate transformations recur throughout physics; for now, the central skill is to identify the composed functions and multiply their Jacobians in the right order.
Looking ahead
A Jacobian records the first-order response of every output to every input. For a composition, evaluate the outer Jacobian at the intermediate point and multiply it by the inner Jacobian. Matrix dimensions, evaluation points, and the distinction between an intermediate function and its composite are your most reliable checks.
Next, you will use the gradient to find how a scalar field changes in a specified direction. The path calculation above already hints at the connection: it pairs the field’s partial derivatives with the way position is changing.