With the matrix notation in place, we distinguish coordinate partial derivatives from total differentiability, then use the chain rule before turning to applications.
Here is the standard basis vector with in position and elsewhere; Euclidean norms and linear maps preserving addition and scalar multiplication are assumed preparation, with refreshers in vectors and norms and linear maps and linearization.
Matrix notation and products
Definition
When a matrix product is defined
If is an matrix and is an matrix, then the product is defined and is an matrix.
If the number of columns of does not equal the number of rows of , then the product is undefined.
Definition
Matrix multiplication
Suppose is an matrix and is an matrix.
Then the entry of is
So each output entry is the dot-product-style combination of row of with column of .
Identity matrices do nothing, on purpose
Definition
Identity matrix
For each positive integer , the identity matrix is the square matrix with on the main diagonal and everywhere else.
For example,
The identity matrix matters because it preserves any compatible matrix:
whenever the sizes match.
Worked example
Why multiplying by the identity changes nothing
Let
Then
The first column of reproduces the first column of , and the second column reproduces the second column of .
Counterexample mode
Matching dimensions do not guarantee commutativity
The claim “two square matrices of the same size always satisfy ” is false even though both products exist and have the same size. Take
Both are real matrices, so the hypothesis is satisfied. Direct row-by-column multiplication gives
For example, , whereas . One unequal corresponding entry is enough to prove . The failure has a structural explanation: multiplying this on the right keeps the second column and zeros the first, while multiplying it on the left keeps the second row and zeros the first.
A valid replacement is: a square matrix commutes with every scalar multiple of the identity of the same size. Indeed, if , then . For arbitrary square matrices, commutativity needs its own justification; matching dimensions guarantees that multiplication is defined, not that factors can be interchanged.
Matrix multiplication represents composition
The multiplication rule is not arbitrary. It is the rule that makes matrices encode linear transformations in sequence.
If a vector is first sent to , and then that result is sent to , the combined effect is
That is why the inner dimensions must match. The output of the first map must be a valid input for the second one.
Theorem
Associativity matches repeated composition
Whenever the products are defined,
So we may regroup a chain of matrix products without changing the final linear transformation.
This does not mean that order may be changed. Associativity lets us change parentheses, not the order of the factors themselves.
Definition
Transpose
If is an matrix, then its transpose is the matrix whose entry is .
Equivalently,
So every row of becomes a column of , and every column of becomes a row.
Theorem
Basic properties of transpose
Let and have the same size when they are added, let be a scalar, and suppose is and is when they are multiplied. Then:
Proof
Entrywise proof of the product rule
Let be and be . Then is , so both and are . For and , the entry of the first matrix is
On the other hand, the entry of is
The last equality uses commutativity of scalar multiplication, not commutativity of matrix multiplication. Corresponding entries therefore agree, so . The dimensions also explain the reversed order: is and is , whereas would generally not even be defined.
Coordinate partial derivatives
Definition
Partial derivative at a point
Let be open, let , and let . The th partial derivative is the limit
when that finite limit exists. We also write . For two variables, and .
Definition
Gradient and repeated partial derivatives
When all first partial derivatives exist at , the gradient is
We use the convention : first differentiate with respect to , then with respect to . A function is of class on an open set if all partial derivatives of orders at most exist and are continuous there.
Theorem
Algebra of partial derivatives
If and have an th partial derivative at , then so do and , with
If also , the quotient is defined along the coordinate line sufficiently near and
Total differentiability and local linear models
Definition
Differentiability with a linear remainder
Let be open and . We say is differentiable at if there is a linear map such that
The map is the derivative, denoted . The notation abbreviates the displayed limit.
Definition
Linearization and total differential
The linearization of at is the affine function
For a scalar-valued differentiable function,
The first-order predicted change is called the total differential:
Theorem
Consequences and uniqueness of a derivative
If is differentiable at , it is continuous at . Its coordinate partial derivatives exist there and are the columns of . The linear map satisfying the differentiability definition is unique.
Proof
Continuity, coordinate derivatives and uniqueness
A linear map in finite-dimensional Euclidean spaces has a bound for some constant . The defining expansion therefore gives
Thus is continuous at . Set in the expansion and divide by . The remainder tends to zero after division, so the th coordinate derivative is .
If both and satisfy the definition, subtraction gives . Taking shows for every basis vector. A linear map is determined by its values on a basis, so .
Theorem
Continuous first partial derivatives are sufficient
Let be defined on an open set. If all first partial derivatives exist on a neighbourhood of and are continuous at , then is differentiable at . In particular, every function on an open set is differentiable there. The same statement applies component by component to a vector-valued function.
Proof
Why continuous partial derivatives control every direction
For two variables, write the change from to as two coordinate changes:
The one-variable mean value theorem gives intermediate coordinates between and , and between and , so the change equals
After subtracting , divide the absolute remainder by . Since each coordinate increment has absolute value at most this norm, the ratio is at most
Both terms tend to zero by continuity. Zero coordinate increments simply omit the corresponding difference. In more variables, telescope along the coordinate directions in the same way.
Worked example
A continuous function with partial derivatives but no derivative
Define
The inequality gives , so is continuous at zero. Both coordinate restrictions vanish, hence both partial derivatives at zero are zero.
If a derivative existed, its coordinate columns would force it to be the zero map. Its remainder would then be itself. Along ,
for every nonzero . The required ratio does not tend to zero. Thus the function is continuous and has both coordinate derivatives, but is not differentiable at the origin.
The chain rule and rates of change
Definition
A derivative in a specified direction
Let be defined on an open neighbourhood of , and let be a unit vector. The directional derivative is
when the finite two-sided limit exists. Because , the parameter measures signed distance along the line.
Theorem
Matrix chain rule
Let be differentiable at , and let be differentiable at . Assume are open and the composite is defined near . Then
The matrix sizes are .
Proof
Composing two linear approximations
Write , and . For a small input displacement,
Put . The outer expansion is
Substitution gives the linear term and remainder . A linear-map bound shows that for all sufficiently small . Consequently , and the outer remainder estimate gives as well. At this remainder is zero. Thus the composite has the required linear approximation with derivative .
Theorem
Rates along curves and the gradient
If is differentiable at and is differentiable at , then
In particular, for a unit vector ,
If , the maximum unit directional rate is , attained in the direction ; the minimum is its negative, attained in the opposite direction.
For matrix calculations we write the gradient as a column. A scalar output has a one-row Jacobian:
For , the Jacobian has output rows and input columns. This fixes the multiplication order in the chain rule; it does not change the partial derivatives.
Multivariable Sensitivity in Hypothetical Models
A scenario table is a linear map
For holdings , suppose two specified scenarios give changes
At the changes are . Each column gives the two scenario responses to one unit of the corresponding holding. These are deterministic scenario outputs, not probabilities.
Discounted payment: domains, partials, and rate units
Let
The formula is mathematically defined for . Here the model takes and . Derivatives at an interior point use nearby inputs in every direction; at a boundary one must specify an extension or the relevant one-sided convention.
Holding the other input fixed gives
At , , the value is , with and . The first partial is per payment unit; the second is per unit rate proportion. An increase of means one percentage point, not one percent of the existing rate.
For simultaneous changes and , the first-order estimate is
The predicted new value is about , while the exact value is . A changing rate offsets part of the payment increase. The approximation is not an exact finite-change identity. A shock of would be a hundred times larger than .
A quadratic model has an exact remainder
For
we have . If , direct expansion gives
Because , the remainder magnitude is at most . Thus guarantees an error at most in the output's units, using the chosen coordinate scales. A vanishing linear term does not force the quadratic change to vanish.
Follow a budget-preserving path
Let with . Through use , . The chain rule gives
Small positive decreases the cost to first order along this specified feasible path. This calculation does not by itself locate a global constrained optimum.
Practice with full solutions
P01. For and , find and .
Solution. and .
P02. Find the gradient of and state its real domain.
Solution. The domain is . The gradient is . The logarithm requires ; differentiation does not remove this restriction.
P03. For at , calculate , , and .
Solution. , , and .
P04. Estimate the change in P03 when and . Interpret the rate unit.
Solution. The estimate is . The rate rises by , or percentage points, not by of its existing value.
P05. Differentiate for , , and . Verify by expansion.
Solution. , , and . The derivative is . Expanding gives , whose derivative agrees.
P06. Find the Jacobian of . Use it to approximate from and compare with the exact value.
Solution. , so . For , the predicted change is , giving . The exact second output is , so exact minus predicted is ; the first output is exact.
P07. At , find the directional derivative of in the unit direction .
Solution. The gradient is , hence at the point. Its dot product with the given unit vector is .
P08. For , find the exact first-order remainder and bound it by .
Solution. For , the remainder is . Its magnitude is at most . Dividing by makes the remainder ratio tend to zero.
P09. Refute “both partial derivatives exist at a point, so the linearization is valid” using and elsewhere. Compute both axis difference quotients and a diagonal limit.
Solution. Each coordinate restriction is zero, so and for nonzero . Both partial derivatives are zero. But for , not tending to the assigned value zero. The function is not continuous and therefore not differentiable at zero.
P10. For and , calculate by Jacobian multiplication and verify by expansion.
Solution. The outer derivative is . Therefore
The expanded function is , whose two partial derivatives agree. The outer derivative is evaluated at and multiplies the inner Jacobian on the left.