# Differentiation of matrices

Matrix elements can be functions of one or more variables. These functions may be differentiation. In this case, one can define the the derivative of a matrix.

Definition: The derivative of a matrix $A$ is a matrix whose elements are the derivatives of the matrix elements of $A$.

Thus, the matrix $A'$ with $$$$A'(x) = \frac{d A(x)}{dx},$$$$ which has the matrix elements

$$$$a'_{ij} = \frac{d a_{ij} (x)}{dx}$$$$

In general, the derivative of a matrix will not commute with the matrix itself. Apart from this fact, one may use all formulae that are familiar from calculus, and they follow from the definition $(1)$. For example, $$$$\frac{d (A + B)}{dx} = \frac{dA}{dx} + \frac{dB}{dx},$$$$ and $$$$\frac{d (AB)}{dx} = \frac{dA}{dx} B + A \frac{dB}{dx},$$$$ The latter result follows form the chain rule $$$$\frac{d}{dx} \sum_{k} a_{ik}b_{kj} = \sum_{k} a'_{ij} b_{kj} + \sum_{k} a_{ik}b'_{kj}.$$$$ Similary, $$$$\frac{d A^{n}}{dx} = A^{n-1} A' + A^{n-2}A'A + \cdots + A'A^{n-1}.$$$$ Note that this is not always equal to $n A^{n-1} A'$, because $A$ and $A'$ do not necessarily commute.

The derivative of the inverse of a matrix $A$ can be found the following way. Since $A^{-1} A = \mathbb{I}$, we have \begin{align*} 0 = \frac{d}{dx}(A^{-1} A) = \frac{d A^{-1}}{dx} A + A^{-1} \frac{dA}{dx}, \end{align*} and consequently, $$$$\frac{d A^{-1}}{dx} = - A^{-1} \frac{dA}{dx} A^{-1}.$$$$

Published on May 7, 2021

Last revised on May 6, 2021

References