MatrixCalculus provides matrix calculus for everyone. It is an online tool that computes vector and matrix derivatives (matrix calculus).

Valid input examples are:

By default:


Valid input operators are:

Layout conventions:

There are different layout conventions (numerator layout, denominator layout, mixed layout). Numerator layout is just the transpose of the denominator layout and mixed layout is a mixture of both. We use a mixed layout convention here. The resulting derivative is such that it can be used in a linear approximation of the function by forming a contraction along the corresponding last axes of the gradient. It is best illustrated by a few examples.
Common error messages: