In linear algebra, 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. It expresses the solution in terms of the determinants of the (square) coefficient matrix and of matrices obtained from it by replacing one column by the column vector of right-hand-sides of the equations. It is named after Gabriel Cramer (1704–1752), who published the rule for an arbitrary number of unknowns in 1750, although Colin Maclaurin also published special cases of the rule in 1748 (and possibly knew of it as early as 1729).

Cramer’s rule implemented in a naïve way is computationally inefficient for systems of more than two or three equations. In the case of n equations in n unknowns, it requires computation of n + 1 determinants, while Gaussian elimination produces the result with the same computational complexity as the computation of a single determinant. Cramer’s rule can also be numerically unstable even for 2×2 systems. However, it has recently been shown that Cramer’s rule can be implemented in O(n3) time, which is comparable to more common methods of solving systems of linear equations, such as Gaussian elimination (consistently requiring 2.5 times as many arithmetic operations for all matrix sizes), while exhibiting comparable numeric stability in most cases.In linear algebra cramer’s rule is an explicit formula for the solution of a system of linear equation

## Contents

• General case
• Finding inverse matrix
• Applications
• Explicit formulas for small systems
• References

## General Case

Consider a system of n linear equations for n unknowns, represented in matrix multiplication form as follows:

where the n × n matrix A has a nonzero determinant, and the vector {x = (x1 …,xn)^{T} is the column vector of the variables. Then the theorem states that in this case the system has a unique solution, whose individual values for the unknowns are given by:

where {Ai} is the matrix formed by replacing the i-th column of A by the column vector b.

A more general version of Cramer’s rule considers the matrix equation

## Finding Inverse Matrix

Let A be an n × n matrix. Then

where adj(A) denotes the adjugate matrix of A, det(A) is the determinant, and I is the identity matrix. If det(A) is invertible in R, then the inverse matrix of A is

If R is a field (such as the field of real numbers), then this gives a formula for the inverse of A, provided det(A) ≠ 0. In fact, this formula will work whenever R is a commutative ring, provided that det(A) is a unit. If det(A) is not a unit, then A is not invertible.

## Applications

### Explicit formulas for small systems

Consider the linear system

which in matrix format is

Assume a1b2 − b1a2 nonzero. Then, with help of determinants, x and y can be found with Cramer’s rule as

The rules for 3 × 3 matrices are similar. Given

which in matrix format is

Then the values of x, y and z can be found as follows:

## References

1. ^ Cramer, Gabriel (1750). “Introduction à l’Analyse des lignes Courbes algébriques” (in French). Geneva: Europeana. pp. 656–659. Retrieved 2012-05-18.
2. ^ Kosinski, A. A. (2001). “Cramer’s Rule is due to Cramer”. Mathematics Magazine74: 310–312. doi:10.2307/2691101.
3. ^ MacLaurin, Colin (1748). A Treatise of Algebra, in Three Parts.
4. ^ Boyer, Carl B. (1968). A History of Mathematics (2nd ed.). Wiley. p. 431.
5. ^ Katz, Victor (2004). A History of Mathematics (Brief ed.). Pearson Education. pp. 378–379.
6. ^ Hedman, Bruce A. (1999). “An Earlier Date for “Cramer’s Rule”” (PDF). Historia Mathematica26 (4): 365–368. doi:10.1006/hmat.1999.2247.
7. ^ David Poole (2014). Linear Algebra: A Modern Introduction. Cengage Learning. p. 276. ISBN 978-1-285-98283-0.
8. ^ Joe D. Hoffman; Steven Frankel (2001). Numerical Methods for Engineers and Scientists, Second Edition,. CRC Press. p. 30. ISBN 978-0-8247-0443-8.