Cramer’s rule
Cramer’s rule is used to solve a system of linear equations whose coefficient matrix is non-singular.
Cramer systems
Take a system of linear equations Ax = b. We call this system a Cramer system if A is a square non-singular matrix. This means that the determinant of the matrix is always non-zero, so the matrix has no linearly dependent rows or columns.
By the Rouché–Capelli theorem, every Cramer system has exactly one solution. The Rouché–Capelli theorem says that if rank(A) = rank(A|b) = k, then the system has a solution. The matrix A of a Cramer system is square and has the greatest possible rank. This means that if we attach any further column to this matrix, that column must be a linear combination of the columns of A. So attaching the column b does not increase the rank of A.
The Rouché–Capelli theorem also says that we need n − k parameters to express the solution, where n is the number of variables and k is the rank rank(A|b). For a Cramer system, n = k, so we need zero parameters to express the solution. That is why every Cramer system has exactly one solution.
Next, let Ai be the matrix A modified so that column i is replaced by the column b. Formally, we define the matrix Ai like this:
where aij are the elements of A and bi are the elements of b.
Cramer’s rule
Let Ax = b be a Cramer system of linear equations. Cramer’s rule says that this system has exactly one solution (x1, x2, …, xn), where
Let’s see the rule in action on a small example. We solve the following system using Cramer’s rule.
The coefficient matrix is:
The determinant of the matrix is:
Next we form the matrices A1 and A2. They are:
We work out the determinants of these matrices:
Now we work out x1 and x2 in turn. By Cramer’s rule, for x1 we have
Substituting, we get
The same for the second element x2:
The solution of the system is therefore the pair (x1, x2) = (3, 1).
Cramer’s rule is most useful when you want to turn the method into an algorithm, because it is easy to program. Solving a system by hand with Cramer’s rule is usually more work than solving it by Gaussian elimination.
Chapters: Systems of linear equations, Cramer’s rule, Homogeneous systems of linear equations