Cramer’s rule is an explicit formula for the solution of a system of linear equations with as many equations as unknowns, valid whenever the system has a unique solution. 1
Rule
Consider a system of equation and unknowns, represented as the following
Use Cramer’s rule to solve the following linear equations:
In matrix form, these equations can be expressed as
We can then calculate the determinants:
Since , a unique solution exists for , and . This solution is provided by Cramer’s rule as follows:
Practicality for Large Systems
Cramer’s rule, implemented in a naive way, is computationally inefficient for systems of more than two or three equations. 1 The standard implementation of Cramer’s rule requires calculating determinants for a system of n equations, each of which has a complexity of using basic methods. Cramer’s rule can also be numerically unstable even for 2×2 systems. 1
Though it is possible to reduce its complexity to the same as Gaussian elimination1, it is still not preferred for large systems in practice.