# 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 $$\begin{equation} A'(x) = \frac{d A(x)}{dx}, \end{equation}$$ which has the matrix elements

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

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, $$\begin{equation} \frac{d (A + B)}{dx} = \frac{dA}{dx} + \frac{dB}{dx}, \end{equation}$$ and $$\begin{equation} \frac{d (AB)}{dx} = \frac{dA}{dx} B + A \frac{dB}{dx}, \end{equation}$$ The latter result follows form the chain rule $$\begin{equation} \frac{d}{dx} \sum_{k} a_{ik}b_{kj} = \sum_{k} a'_{ij} b_{kj} + \sum_{k} a_{ik}b'_{kj}. \end{equation}$$ Similary, $$\begin{equation} \frac{d A^{n}}{dx} = A^{n-1} A' + A^{n-2}A'A + \cdots + A'A^{n-1}. \end{equation}$$ 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, $$\begin{equation} \frac{d A^{-1}}{dx} = - A^{-1} \frac{dA}{dx} A^{-1}. \end{equation}$$

Published on May 7, 2021

Last revised on May 6, 2021

References