For a symmetric positive definite matrix and a square matrix , how do you derive and , and how does appear in fitting a multivariate Gaussian by maximum likelihood?
Linear algebra and optimisation, Matrix calculus
Level L3 Intermediate. Length Medium. Nature Mat Mathematical.
What's being asked
Whether you can differentiate trace and log-determinant functions using differentials and connect them to Gaussian covariance estimation.
Key idea
Writing a scalar change immediately identifies the gradient : for this gives , and Jacobi's formula gives for symmetric .
Steps
- Use the differential–trace rule: for scalar , is the unique matrix satisfying .
- Differentiate : since trace is linear, , so ; in coordinates, .
- Derive via cofactor expansion: (the cofactor), and , so .
- Equivalently via Jacobi's formula, , which matches , simplifying to when is symmetric.
- Connect to Gaussian MLE: for data vectors and mean (equal to the sample mean at the MLE), the Gaussian log-likelihood equals up to an additive constant, where . Rewriting and setting the gradient with respect to to zero uses and to give , hence (equivalently, differentiating directly with respect to uses to give ).
Common mistakes
- Dropping the transpose on and when and are not assumed symmetric.
- Trying to apply the scalar rule directly without checking how depends on each entry .
How long your answer should be
Half a page; 4–5 minutes.
Last checked on 4 December 2026.
Read this
Previous in Linear algebra and optimisation: How is the Moore–Penrose pseudoinverse defined from the SVD , what does compute in general, and what are and for and ?
Next in Linear algebra and optimisation: What is the condition number of an invertible matrix , how does it bound the relative sensitivity of to perturbations in , and what happens for when is perturbed by ?