Jump to content

Linear Algebra/Cramer's Rule

From Wikibooks, open books for an open world

Cramer's Rule

[edit | edit source]

Let's try to solve the systems of linear equations:
a11x1+a12x2+a13x3+...+a1nxn=b1
a21x1+a22x2+a23x3+...+a2nxn=b2
a31x1+a32x2+a33x3+...+a3nxn=b3
...
an1x1+an2x2+an3x3+...+annxn=bn

Which is the special case when the number of equations and the number of variables are the same.

Consider the matrix

to be denoted D.

First, we multiply the nth equation by the cofactor Co(anj) for the jth column, and add it all up. This gets us

Co(a1j)a11x1+Co(a1j)a12x2+Co(a1j)a13x3+...+Co(a1j)a1nxn+
Co(a2j)a21x1+Co(a2j)a22x2+Co(a2j)a23x3+...+Co(a2j)a2nxn+
Co(a3j)a31x1+Co(a3j)a32x2+Co(a3j)a33x3+...+Co(a3j)a3nxn+
+...+
Co(anj)an1x1+Co(anj)an2x2+Co(anj)an3x3+...+Co(anj)annxn
=
Co(a1j)b1+Co(a2j)b2+Co(a3j)b3+...+Co(anj)bn.

The left side cancels out except for Co(a1j)a1jxj+Co(a2j)a2jxj+Co(a3j)a3jxj+...+Co(anj)anjxj

which is equal to

and the right side is equal to

, to be denoted D(j), which is the same thing as D but with the jth column replaced by bk.

Dividing by D gets xj=.

This formula is called Cramer's Rule, and this solution exists when D is not equal to 0.

In particular, in the process of finding the solution, we also find that this is the only solution, so this solution is unique.

Example

[edit | edit source]

Consider the system of linear equations below.



If we only want the solution for, say, , we can apply Cramer's Rule to find that its solution is , and since we know
,
.