Post on 25-Dec-2015
description
Cramer’s Rule
By
Lisa M.Vavra
In partial fulfillment of the requirements for the Master of Arts in
Teaching with a Specialization in the Teaching of Middle Level Mathematics in the
Department of Mathematics
Dr. David Fowler, Advisor
July 2010
2
Middle school students, especially those who take Algebra I, learn how to find the
intersection of two straight lines in the plane, and thus learn basic methods for solving
systems of two linear equations in two unknowns. In the Math in the Middle capstone
course, we studied the ideas used in middle school and expanded them; in particular,
we introduced matrices and row operations to solve larger systems of n linear
equations in m variables. In this paper, we will examine Cramer’s Rule, a 260-year old
approach to solving systems of n linear equations in n variables. Included in this paper
will be background information on Cramer, a brief introduction to determinants, and a
detailed explanation of Cramer’s Rule.
Gabriel Cramer
Gabriel Cramer (Gahb ree uhl Krahm uhr) was a Swiss mathematician born in
Geneva in 1704. His mother was Anne Mallet Cramer and his father, Jean Cramer, was
a medical doctor in Geneva. Gabriel had two brothers; one was a medical doctor and
the other a professor of law. In 1722, while he was still only eighteen years old, he
submitted a thesis on the theory of sound and was awarded a doctorate. Only two years
later, he was competing for the chair of philosophy at the Académie de Clavin in
Geneva with Giovanni Ludovico Calandrini. Cramer and Calandrini were offered the
mathematics chair on the understanding that they share the duties and share the salary.
3
The Academy also mandated that each should spend two to three years
travelling. While one person was assuming full responsibility and full salary, the other
would be travelling. Cramer taught geometry and mechanics, while Calandrini taught
algebra and astronomy. The arrangement was successful due to the nature of their
personalities. Cramer is said to have been “friendly, good-humoured, pleasant in voice
and appearance, and possessed of good memory, judgement and health” (see [4]). At
this time, although most courses were taught in Latin, Cramer taught his courses in
French and was considered to be very innovative.
Cramer was appointed to his position in 1724 and set for two years of travelling
in 1727. He travelled to many different cities and countries of Europe visiting with
leading mathematicians of his time. Cramer worked with Bernoulli, Euler, Halley and
many others. Cramer’s discussions with these mathematicians and his continued
correspondence with them had a big influence on his work.
Cramer returned to Geneva in 1729 and in 1734 became the sole Chair of
Mathematics. He led a very busy life. In addition to teaching and corresponding with
many mathematicians, he published several articles on a variety of topics, including
history of mathematics, geometry and philosophy. His major mathematical work is
Introduction à l'analyse des lignes courbes algébriques published in 1750. It is in this
work that Cramer’s Rule is published.
During the time Cramer was writing his Introduction à l'analyse des lignes
courbes algébriques, he continued to undertake large amounts of editorial work in
addition to his normal duties. Cramer was overworked, but for the most part was a
healthy man. A fall from his carriage, however, caused his health to deteriorate
4
suddenly. Cramer spent two months in bed recovering and was advised by his doctor
to spend some quiet time in the south of France to regain his strength. Cramer left
Geneva on December 21, 1751, to begin his journey and died three weeks later on
January 4, 1752, at the age of 47 in Bagnols-sur-Cèze, France.
The algorithm that bears Cramer’s name is an explicit formula for the solution of
a system of n linear equations in n variables. This formula gives the solution in terms
of determinants. A determinant can be described as a special number associated with a
square matrix. The determinant is a real number and reveals properties of the matrix.
Thus, before introducing Cramer’s rule, one must have a basic understanding of
determinants.
Determinants
If we start with the 2 x 2 matrix A =
2221
1211
aa
aa,
Then the determinant of A is defined as
Det(A) = 21122211 aaaa .
Students often remember how to compute the determinant of a 2 x 2 matrix by thinking
of it as the product of the numbers on the “positive diagonal” (i.e. 2211aa ) minus the
product of the numbers on the “negative diagonal” (i.e. 2112aa ).
We can take a similar approach to defining the determinant of a 3 x 3 matrix.
Consider first the following 3 x 3 matrix:
5
A =
333231
232221
131211
aaa
aaa
aaa
.
First we start with a11 and cross off each row and column containing a11. We have
reduced the 3 x 3 matrix into a 2 x 2 matrix. We repeat this same procedure for the
entries a21 and a31. What we are doing is called an expansion along the first column.
The matrices we obtain are:
333231
232221
131211
aaa
aaa
aaa
,
333231
232221
131211
aaa
aaa
aaa
,
333231
232221
131211
aaa
aaa
aaa
.
The determinant of A is
det (A) = a11det
3332
2322
aa
aa- a21det
3332
1312
aa
aa+ a31det
2322
1312
aa
aa
= ).()()( 221323123132133312213223332211 aaaaaaaaaaaaaaa
Using the definition of the determinant of a 2 x 2 matrices, the above expression can be
simplified algebraically and we find that the determinant of A is
det(A) = ).()( 312213332112322311322113312312332211 aaaaaaaaaaaaaaaaaa
Another way to find the determinant of a 3 x 3 matrix is to think of the answer as
the sum of the product of the numbers on each of the three “positive diagonals” minus
the sum of the product of the numbers on each of the “negative diagonals”. To visualize
the “diagonals”, it helps to repeat the first and second column as follows:
6
333231
232221
131211
aaa
aaa
aaa
32
22
12
31
21
11
a
a
a
a
a
a
.
The “positive diagonals” are shown in blue and the “negative diagonals” are shown in
red.
333231
232221
131211
aaa
aaa
aaa
32
22
12
31
21
11
a
a
a
a
a
a
Generations of future engineers have used this memorization device to compute
determinants of 3 x 3 matrices. Unfortunately, they are also disappointed to learn that
there is no comparable visual image to compute a 4 x 4 determinant. Before discussing
determinants of larger matrices, we will use determinants of 2 x 2 and 3 x 3 matrices to
introduce Cramer’s Rule and provide a proof that the algorithm works as long as the
determinant of the coefficient matrix of the system is nonzero.
Cramer’s Rule for Systems of 2 and 3 Equations
We begin with a system of two equations in two unknowns and show how to find
the solution using Cramer’s Rule. We also consider systems of three equations in three
unknowns and derive Cramer’s Rule. Finally we present the general formula for
systems of n equations in n unknowns.
Consider the following system of equations:
22221
11211
byaxa
byaxa
The coefficient matrix associated with this system is
7
.
As mentioned in the previous section, det(A) = 21122211 aaaa .
Cramer’s Rule requires finding the quotient of the determinants of matrices
associated to the system and can be used when the determinant of the coefficient
matrix is nonzero.
Assume the det(A) ≠0. Then Cramer’s rule gives the solution as follows:
x = D
Dx , y = D
Dy
where D , xD and yD are defined by:
D = det
2221
1211
aa
aa, xD =det
222
121
ab
ab and yD = det
221
111
ba
ba.
Thus the solution to the system above is
x = D
Dx = 21122211
212221
aaaa
baab
and y =D
Dy =21122211
211211
aaaa
abba
.
To really understand how Cramer’s Rule works, we will apply it to a specific
system of two equations in two unknowns. Consider the following system:
x – 2y = 7 3x + y = 7
The coefficient matrix for this system is
A =
13
21
.
We must first calculate the determinant of A to decide if Cramer’s Rule can be used. We
have
8
D = det
13
21 = (1·1) – (-2·3) = 7 ≠ 0.
Thus we can use Cramer’s Rule. The matrix used to find xD is formed by replacing the
first column (coefficients of the x terms) with the column of constant terms 1b , 2b and 3b .
The matrix to find yD is formed by replacing the second column (coefficients of the y
terms) with the column of constant terms. So,
xD = det
17
27 = (7 x 1) – (-2 x 7) = 21.
yD = det
73
71 = (1 x 7) – (7 x 3) = -14.
Cramer’s Rule says that
x = D
Dx = 7
21= 3 and y =
D
Dy =7
14 = -2.
We can verify these results by substituting into the original equations.
3 – 2(-2) = 3 + 4 = 7
3(3) + -2 = 9 + -2 = 7. Algebraic steps can be performed to derive Cramer’s Rule and thus justify the
use of determinants in solving the system of equations. Given this system of linear
equations:
)2(
)1(
22221
11211
byaxa
byaxa
we multiply equation (1) by 22a and equation (2) by 12a and we obtain the following
system of equations:
9
22122122211 abyaaxaa
12222122112 abyaaxaa . Adding the two equations to eliminate the variable y, we obtain:
1222212112221112222121122211 )( ababxaaaaababxaaxaa
Since we are assuming 21122211 aaaa ≠ 0, we obtain
x = 21122211
122221
aaaa
abab
We can follow a similar procedure to find the value of y. We can multiply equation
(1) by 21a and equation (2) by 11a . The resulting equivalent system of equations is
shown below.
11222112111
21121122111
abyaaxaa
abyaaxaa
We can add the two equations to eliminate the variable x. The resulting equation is:
1122112211211211221122112112 )( ababyaaaaababyaayaa
Since we are assuming 021122211 aaaa , we obtain
y = 22112112
112211
aaaa
abab
=21122211
211112
aaaa
abab
So the solution to the system of equations is:
x = 21122211
212221
aaaa
baab
and y = 21122211
211112
aaaa
abab
These were the same values obtained by using Cramer’s Rule. Therefore the
use of determinants is justified.
10
Both methods for solving a system of linear equations (algebraically and using
Cramer’s Rule) require the assumption that the quantity 21122211 aaaa does not equal
zero. Note that under this assumption, the solution is unique.
A system of two linear equations in two variables can be interpreted
geometrically. Each of the linear equations in the system represents a line. The two
lines will either intersect at one point, be parallel or coincide. As shown previously, a
system of two linear equations in two variables can be solved using Cramer’s Rule as
long as the determinant of the coefficient matrix does not equal 0. The solution is an
ordered pair. Therefore, when the determinant does not equal 0, the lines represented
by the two linear equations in the system intersect at one point and the system has a
unique solution.
It is important to look at systems where the determinant of the coefficient matrix
is 0. Since Cramer’s Rule uses the determinant in the denominator, if the denominator
is 0, Cramer’s Rule cannot be used. This also means that there will not be a unique
solution. By the previous geometric discussion, the lines represented by the two
equations will either be parallel or will coincide. If the lines are parallel, then the system
has no solution. If the lines coincide, then the system has an infinite number of
solutions. For example, consider this system of equations:
2x + y = 8 4x + 2y = 6 Then the
det 2 14 2
= (2 x 2) – (1 x 4) = 0.
We know there will be either no solution or an infinite number of solutions. The graphs
of lines are shown in the Figure 1.
11
Figure 1
Figure 1 illustrates the solution to the system geometrically. In fact, there is no solution
to the system of equations because the lines are parallel and have no common points.
Consider this new system of equations:
2x + y = 8 4x + 2y = 16
Note that this system has the same coefficient matrix as the previous example and so
the determinant is zero. The column of constant terms has changed. The solution of
this system is the line y = -2x + 8, where x is a real number, as shown in Figure 2.
Figure 2
The two lines coincide, thus there is an infinite number of solutions to the system.
12
In both of the above examples, the determinant of the coefficient matrix is equal
to 0. If the determinant does not equal 0, then Cramer’s Rule can be used to find the
unique solution. For example, in the first system of equations we considered,
x – 2y = 7 3x + y = 7,
the determinant of the coefficient matrix is not zero, and so we know the system has a
unique solution, namely (3,-2). The geometric representation of the system is shown in
Figure 3.
Figure 3 Now that we have shown that Cramer’s Rule works for systems of two linear
equations in two variables, we will examine systems of three linear equations in three
variables:
)3(
)2(
)1(
3333231
2131221
131211
bzayaxa
bzayaxa
bzayaxa
Cramer's rule gives the solution as follows;
13
D
Dy
DxD
x y , andD
Dz z
where D , xD , yD and zD are defined by
D = det
333231
232221
131211
aaa
aaa
aaa
xD = det
33323
23222
13121
aab
aab
aab
yD = det
33331
23221
13111
aba
aba
aba
zD = det
33231
22221
11211
baa
baa
baa
As we did previously, the matrix used to find D is simply the coefficient matrix A
associated with the original system of equations. The matrix Dx is formed by replacing
the first column (coefficients of the x terms) of A with the column of constant terms b1,b2
and b3. The matrix used to find Dy is formed by replacing the second column
(coefficients of the y terms) of A with the column of constant terms. Similarly, the matrix
to find Dz is formed by replacing the third column (coefficients of the z terms) of A with
the column of constant terms.
The first determinant we need to find is the value of D and then we will find Dx, Dy
and Dz. To evaluate each of these determinants, we will do expansion along the first
column using linear combinations of determinants of 2 x 2 determinants.
D = det
333231
232221
131211
aaa
aaa
aaa
)()(
)()()()()()(
)()()(
312213332112322311322113312312332211
221331231231321321331221322311332211
221323123132133312213223332211
aaaaaaaaaaaaaaaaaa
aaaaaaaaaaaaaaaaaa
aaaaaaaaaaaaaaa
14
To find the values of Dx, Dy and Dz we will do expansion along the column containing
the values b1,b2 and b3.
Dx = det
33323
23222
13121
aab
aab
aab
= )()()( 221323123321333122322333221 aaaabaaaabaaaab
Dy = det
33331
23221
13111
aba
aba
aba
= )()()( 211323113311333112312333211 aaaabaaaabaaaab
Dz = det
33231
22221
11211
baa
baa
baa
= )()()( 211222113311232112312232211 aaaabaaaabaaaab
Once all the determinants have been computed, we can find the values for x, y and z.
x = = )()(
)()()(
312213332112322311322113312312332211
221323123321333122322333221
aaaaaaaaaaaaaaaaaa
aaaabaaaabaaaab
y = = )()(
)()()(
312213332112322311322113312312332211
211323113311333112312333211
aaaaaaaaaaaaaaaaaa
aaaabaaaabaaaab
z = = )()(
)()()(
312213332112322311322113312312332211
211222113311232112312232211
aaaaaaaaaaaaaaaaaa
aaaabaaaabaaaab
Now we can apply Cramer’s Rule to a specific system of equations. Consider
the following system:
02
02
8642
yyx
zyx
zyx
15
We need to evaluate the determinant of the coefficient matrix associated with this
system and decide if Cramer’s Rule may be used. We have
det
211
121
642
= 2 det
21
12- 4 det
21
11+ 6 det
11
21
= (2 · (-3)) – 4(1) + 6(-1) = -16.
Since -16≠ 0, we know that Cramer’s Rule can be used to solve the system and there
will be a unique solution. Now we will find Dx, Dy and Dz and then solve for each of the
variables. The first column has two zeros, and we can take advantage of this by
expanding along the first column (thus there will be only one product to compute).
Dx = det
210
120
648
= 8 det
21
12 0 det
21
64 + 0 det
12
64= 8 ·(-3) = -24.
We will expand along the second column to calculate Dy.
Dy = det
201
101
682
= -8 det
21
11= (-8)·1 = -8.
Similarly, we will expand along the third column to calculate Dz.
Dz = det
011
021
842
= 8 det
11
21= 8 ·(-1) = -8
The solution to the system of equations is:
x = Dx/D = -24/-16 = 3/2
y = Dy/D = -8/-16= 1/2
z = Dz/D = -8/-16 = 1/2
16
We can verify the values by substituting them into the original equations of our system.
83232
16
2
14
2
32
02
11
2
3
2
1
2
12
2
3
012
1
2
3
2
12
2
1
2
3
Now that we have seen Cramer’s Rule work for a specific example, we can look
at the algebraic steps to derive Cramer’s Rule for systems of three equations in three
unknowns. First consider the first two equations in the system below:
)3(
)2(
)1(
3333231
2232221
1131211
bzayaxa
bzayaxa
bzayaxa
By multiplying the first equation by a22 and the second equation by (-a12), we will be able
to eliminate the “y” terms by adding the two equations. The following illustrates this
process:
212231222122112
122221322122211
bazaayaaxaa
bazaayaaxaa
)4( )()( 2121222312221321122211 babazaaaaxaaaa
Now we use the last equation in our original system and either the first or second
equation and repeat the process above to eliminate the “y” term. We will use the new
equation formed plus equation (4) found in the previous part to write a new system of
equations with two equations in two variables.
Consider the equations (2) and (3) from our original system:
17
)3(
)2(
3333231
2232221
bzayaxa
bzayaxa
We can eliminate the “y” terms by multiplying the first equation by a32 and the second
equation by –a22:
322332232223122
232322332223221
bazaayaaxaa
bazaayaaxaa
then add the two equations to obtain:
)5( )()( 3222323322322331223221 babazaaaaxaaaa .
Equations (4) and (5) will be used to create a new system of two equations in two
variables.
3222323322322331223221
2121222312221321122211
)()(
)()(
babazaaaaxaaaa
babazaaaaxaaaa
Previously, we have shown that we can derive Cramer’s rule by using algebraic
steps. At this point, since we have two equations in two unknowns, we can apply
Cramer’s Rule. To make this process a little easier, we use the following notation:
23122213
21122211
aaaab
aaaaa
322232
33223223
31223221
212122
babaf
aaaae
aaaad
babac
The resulting system of equations now becomes something more manageable.
feydx
cbyax
18
Assuming the determinant of the coefficient matrix of the system above does not equal
0, by Cramer’s Rule we know that x can be found by computing the quotient of two
determinants.
ed
ba
ef
bc
x
det
det
So,
bdae
bfcex
.
By substitution it follows that
x =))(())((
))(())((
31223221231222133322322321122211
3222322312221333223223212122
aaaaaaaaaaaaaaaa
babaaaaaaaaababa
=][
)]()()([
31231231221322211333211233221132231122
23122213332133312233223223122
aaaaaaaaaaaaaaaaaaa
aaaabaaaabaaaaba
= )()(
)()()(
312213332112322311322113312312332211
221323123321333122322333221
aaaaaaaaaaaaaaaaaa
aaaabaaaabaaaab
This is the exact value obtained by using Cramer’s Rule. A similar procedure could be
used to verify the values of y and z.
A linear equation in three variables represents geometrically a plane in space.
Given a system of three linear equations in three variables, each equation represents a
plane in space. The three planes can intersect in a point, intersect in a line, intersect in
a plane or not intersect al all. If the three planes intersect as pictured below, then the
three planes have one point in common and the corresponding system of equations has
a unique solution. The unique solution is represented by a black point in the picture. In
19
the case of a unique solution, the determinant of the coefficient matrix of the system is
not zero, and Cramer’s Rule can be used.
An example of a system of three equations in three unknowns with a unique
solution was given previously. Recall that the system was
02
02
8642
yyx
zyx
zyx
The solution is x = 3/2, y = 1/2 and z = 1/2. The dot in the figure above would illustrate
that exact point.
If the determinant of the coefficient matrix is zero, then the system has either no
solution, or infinitely many solutions, depending on the column of constant terms. If the
system has no solution, then there is no point at which all three planes intersect. This is
shown in the picture below.
It is possible that the determinant of the coefficient matrix equals zero and there are
infinitely many solutions. If the three planes intersect as pictured below, then the
20
system of three equations in three variables has a line of intersection as a solution and
therefore an infinite number of solutions.
An example of a system of three equations in three variables having a line as a solution is
x + 2y – z = 3 2x + 3y + z = 1 x + 3y – 4z =8
The coefficient matrix associated with this system is
431
132
121
Since determinant of this matrix is 0, we know that there is not a unique solution.
Solving this system, we find that the solution is a line, namely ( 75 t , 53 t , t ), t R .
Cramer’s Rule for Systems of n Equations in n Unknowns
Cramer’s Rule works for higher order systems. It is important to note that the rule works
only when the number of equations is the same as the number of variables. This
means that the matrix associated with the system is a square matrix and the
21
determinant can be evaluated. Consider a system of n equations in n unknowns x1, x2
….., xn of the form
nnnnnn
nn
nn
bxaxaxa
bxaxaxa
bxaxaxa
....
.
.
.
....
....
2211
22222121
11212111
The coefficient matrix A for the system above is
A =
a a … aa.....
a.....
… a.....
a a … a
The general form for Cramer’s Rule is the following. Let A be the n x n coefficient matrix of a system of n linear equations in n unknowns and
suppose that det A ≠ 0. Then the unique solution to the system is given by
,11 D
Dx ,2
2 D
Dx …….
D
Dx i
i ……….D
Dx n
n
where D=det(A) and iD is the determinant of the matrix formed by replacing the i-th
column with the column of constant terms 21 ,bb …. nb .
In order to apply Cramer’s Rule, we need to be able to compute determinants of
n by n matrices. As shown in the section “Determinants” the determinant of a 3 x 3
matrix is a linear combination of determinants of 2 x 2 matrices. We can recursively
compute the determinant of an n x n matrix by expanding along the first row as follows:
det(A) = nn AaAaAaAa 11131312121111 det....detdetdet
22
where Aij is the matrix obtained by deleting the i-th row and the j-th column. Alternately,
the general formula for the determinant of an n x n matrix A is given by the summation
of all possible permutation products of n elements. The determinant sign is positive if
the number of transpositions is even and negative if the number of transposition is odd.
The terms have alternating signs. The determinant can be expressed as:
,...det )()2(2)1(1
nnaaasignA
where sigma denotes the permutation on {1,2,…n}.
Recall for the 2 x 2 matrix the determinant contains two terms. The determinant of a 3 x
3 matrix contains six terms. In general the number of terms in the determinant of an n x
n matrix is n!.
Cramer’s Rule in the Classroom
Solving systems of equations is a part of the Algebra curriculum. Students are
taught several different strategies including substitution and elimination. Cramer’s Rule
is another strategy that could be used to solve systems of equations (assuming the
determinant of the coefficient matrix does not equal zero). I teach Algebra I, and
matrices are not included in our curriculum; however, I could see introducing the idea of
matrices and determinants if time permitted.
I discussed the use of Cramer’s Rule with the supervisor of Mathematics for my
school district. He informed me that in second year Algebra), Cramer’s Rule is taught as
a valuable tool to solve systems of linear equations. Cramer’s Rule gives an explicit
expression for the solution of a system and therefore is theoretically important. Typically
23
it is combined with operations on matrices, particularly finding the inverse of a square
matrix. Finding the determinant of a larger matrix requires the use of properties of
determinants. Therefore, it is useful to know those properties to solve systems of n
linear equations in n unknowns.
In my research of Cramer’s Rule I found that the use of Cramer’s Rule in the
algebra classroom is actually under debate. It appears that many people believe the
use of Cramer’s Rule for a system of two equations in two unknowns seems to be
useless and not necessary. Cramer’s Rule is easier for solving system of three
equations in three variables compared to doing row-reducing. It was also mentioned by
engineering students that most systems of equations are solved by using a computer
and rarely computed by hand. I would tend to agree with this comment because we
often allow computers to do the “work” traditionally done by hand. Computationally
speaking, Cramer’s Rule is inefficient for large matrices.
Cramer’s rule may not be the most efficient method to solve systems of linear
equations (i.e. a system of 5 equations in 5 unknowns); however, there is still value in
learning it. Some college algebra professors stated that for the weaker math student,
Cramer’s Rule is quite helpful. In fact, many students who are not able to solve
systems of equations using other methods are quite successful using Cramer’s Rule.
Personally, I believe students should be exposed to all methods of solving
systems of equations because it will provide students with some choice. Students may
have a better understanding of one method over the other and should be allowed the
use of whatever method they prefer. That is the beauty of mathematics- there are
multiple ways to arrive at the correct solution.
24
Works Cited
[1]Campbell, H. C. (1980). Linear Algebra with Applications. Englewood Cliffs: Prentice-Hall.
[2]Grossman, S. (1980). Elementary Linear Algebra. Belmont : Wadsworth Publishing Company.
[3]Strang, G. (1998). Linear Algebra and its Applications 3rd edition. Harcourt Brace Jovanich, Inc.
Web Sources
[4] http://www-groups.dcs.st-and.a.c.uk/~history/Biographies/Cramer.html.Retrieved on July 6 2010 at 11:24 p.m.
[5] http://www.mathwarehouse.com retrieved on July 6, 2010 at 11:16 p.m.
[6] http://ask.metafilter.com/147472/Do-we-have-to-know-Cramers-rule-for-the-exam,
Retrieved on July 8, 2010 at 2:05 p.m.