<< Chapter < Page Chapter >> Page >

Cramer’s rule

Introduction

Cramer’s Rule is a technique that can be used to solve simultaneous linear equations. It is most often utilized when one is required to solve the system by hand rather than by computer. This is due to the fact that there are quicker, more efficient procedures such as Gauss elimination that can be implemented on the computer. The approach is based upon the use of determinants.

Mathematical preliminaries

Before we describe the procedure known as Cramer’s Rule, we begin with some mathematical preliminaries. Let us consider a pair of two simultaneous linear equations in two unknowns ( x 1 and x 2 ). We can write these equations as

a 11 x 1 + a 12 x 2 = b 1 size 12{a rSub { size 8{"11"} } x rSub { size 8{1} } +a rSub { size 8{"12"} } x rSub { size 8{2} } =b rSub { size 8{1} } } {}

and

a 21 x 1 + a 22 x x = b 2 size 12{a rSub { size 8{"21"} } x rSub { size 8{1} } +a rSub { size 8{"22"} } x rSub { size 8{x} } =b rSub { size 8{2} } } {}

Here the coefficients a 11 , a 12 , a 21 , and a 22 are known constants.

Now, let us solve this system of equations via Gauss elimination. We should recall that the basic idea behind Gauss elimination is to reduce the original set of equations into an equivalent form which is triangular and to use back-substitution once the first unknown is discovered.

We begin by multiplying each side of equation (1) by the value (- a 21 / a 11 ). This yields an equivalent equation of the form

a 21 x 1 a 21 a 12 a 11 x 2 = a 21 a 11 b 1 size 12{ - a rSub { size 8{"21"} } x rSub { size 8{1} } - { {a rSub { size 8{"21"} } a rSub { size 8{"12"} } } over {a rSub { size 8{"11"} } } } x rSub { size 8{2} } = - { {a rSub { size 8{"21"} } } over {a rSub { size 8{"11"} } } } b rSub { size 8{1} } } {}

Next, we add equation (3) to equation (2). In doing so, we note that the term involving x 1 is removed. The result of the addition of the two equations is

a 22 a 21 a 12 a 11 x 2 = b 2 a 21 a 11 b 1 size 12{ left (a rSub { size 8{"22"} } - { {a rSub { size 8{"21"} } a rSub { size 8{"12"} } } over {a rSub { size 8{"11"} } } } right )`x rSub { size 8{2} } =b rSub { size 8{2} } - left ( { {a rSub { size 8{"21"} } } over {a rSub { size 8{"11"} } } } right )`b rSub { size 8{1} } } {}

The value for the unknown x 2 can be easily found using equation (4). The solution is

x 2 = a 11 b 2 a 21 b 1 a 11 a 22 a 12 a 21 size 12{x rSub { size 8{2} } = { {a rSub { size 8{"11"} } `b rSub { size 8{2} } - a rSub { size 8{"21"} } `b rSub { size 8{1} } } over {a rSub { size 8{"11"} } a rSub { size 8{"22"} } - a rSub { size 8{"12"} } a rSub { size 8{"21"} } } } } {}

This result can be substituted back into equation (1) to produce an equation that can be solved for the unknown x 1 .

a 11 x 1 + a 12 a 11 b 2 a 21 b 1 a 11 a 22 a 12 a 21 = b 1 size 12{a rSub { size 8{"11"} } `x rSub { size 8{1} } +a rSub { size 8{"12"} } left ( { {a rSub { size 8{"11"} } `b rSub { size 8{2} } - a rSub { size 8{"21"} } `b rSub { size 8{1} } } over {a rSub { size 8{"11"} } `a rSub { size 8{"22"} } - a rSub { size 8{"12"} } `a rSub { size 8{"21"} } } } right )`=b rSub { size 8{1} } } {}

The solution for the unknown, x 1 , proceeds as follows. The equation ( ) tells us

a 11 x 1 = b 1 a 12 a 11 b 2 a 21 b 1 a 11 a 22 a 12 a 21 size 12{a rSub { size 8{"11"} } x rSub { size 8{1} } =b rSub { size 8{1} } - a rSub { size 8{"12"} } left ( { {a rSub { size 8{"11"} } `b rSub { size 8{2} } - a rSub { size 8{"21"} } `b rSub { size 8{1} } } over {a rSub { size 8{"11"} } `a rSub { size 8{"22"} } - a rSub { size 8{"12"} } `a rSub { size 8{"21"} } } } right )} {}

which can be expressed as

a 11 x 1 = a 11 a 22 b 1 a 12 a 21 b 1 a 11 a 12 b 2 + a 12 a 21 b 1 a 11 a 22 a 12 a 21 size 12{a rSub { size 8{"11"} } `x rSub { size 8{1} } = { {a rSub { size 8{"11"} } `a rSub { size 8{"22"} } `b rSub { size 8{1} } - a rSub { size 8{"12"} } `a rSub { size 8{"21"} } `b rSub { size 8{1} } - a rSub { size 8{"11"} } `a rSub { size 8{"12"} } `b rSub { size 8{2} } +a rSub { size 8{"12"} } `a rSub { size 8{"21"} } `b rSub { size 8{1} } } over {a rSub { size 8{"11"} } `a rSub { size 8{"22"} } - a rSub { size 8{"12"} } `a rSub { size 8{"21"} } } } } {}

This can be reduced to the following equation

a 11 x 1 = a 11 a 22 b 1 a 11 a 12 b 2 a 11 a 22 a 12 a 21 size 12{a rSub { size 8{"11"} } `x rSub { size 8{1} } = { {a rSub { size 8{"11"} } `a rSub { size 8{"22"} } `b rSub { size 8{1} } - a rSub { size 8{"11"} } `a rSub { size 8{"12"} } `b rSub { size 8{2} } } over {a rSub { size 8{"11"} } `a rSub { size 8{"22"} } - a rSub { size 8{"12"} } `a rSub { size 8{"21"} } } } } {}

Dividing through by the constant a 11 yields an expression for x 1 .

x 1 = a 22 b 1 a 12 b 2 a 11 a 22 a 12 a 21 size 12{x rSub { size 8{1} } = { {a rSub { size 8{"22"} } `b rSub { size 8{1} } - a rSub { size 8{"12"} } `b rSub { size 8{2} } } over {a rSub { size 8{"11"} } `a rSub { size 8{"22"} } - a rSub { size 8{"12"} } `a rSub { size 8{"21"} } } } } {}

Equations (5) and (10) provide us the solution for the variables in terms of the set of constants associated with the original equations. Examination of equations (5) and (10) reveals that the solution for each variable includes the common term

Δ = a 11 a 22 a 12 a 21 size 12{Δ=a rSub { size 8{"11"} } `a rSub { size 8{"22"} } - a rSub { size 8{"12"} } `a rSub { size 8{"21"} } } {}

Suppose we write our original equations in matrix-vector form as follows

A x 1 x 2 = b 1 b 2 size 12{A` left [ matrix { x rSub { size 8{1} } {} ##x rSub { size 8{2} } } right ]= left [ matrix { b rSub { size 8{1} } {} ##b rSub { size 8{2} } } right ]} {}

where we define the coefficient matrix as

A = a 1,1 a 1,2 a 2,1 a 2,2 size 12{A= left [ matrix { a rSub { size 8{1,1} } {} # a rSub { size 8{1,2} } {} ##a rSub { size 8{2,1} } {} # a rSub { size 8{2,2} } {} } right ]} {}

Clearly, we see that the term Δ is equal to the determinant of the coefficient matrix

Δ = det ( A ) = A size 12{Δ="det"` \( A \) = lline A rline } {}

Next let us consider the numerator for the solution of the unknown x 1 as expressed in equation (10). We recognize that it, too, can be expressed by means of a determinant as is shown below

x 1 = a 2,2 b 1 a 1,2 b 2 = det b 1 a 1,2 b 2 a 2,2 size 12{x rSub { size 8{1} } =a rSub { size 8{2,2} } `b rSub { size 8{1} } - a rSub { size 8{1,2} } `b rSub { size 8{2} } ="det" left [ matrix { b rSub { size 8{1} } {} # a rSub { size 8{1,2} } {} ##b rSub { size 8{2} } {} # a rSub { size 8{2,2} } {} } right ]} {}

We note that the matrix in the equation can be obtained by merely replacing the first column of the original coefficient matrix with the vector

B = b 1 b 2 size 12{B= left [ matrix { b rSub { size 8{1} } {} ##b rSub { size 8{2} } } right ]} {}

So the solution for the unknown x 1 can be written as a ratio of determinants

x 1 = det b 1 a 1,2 b 2 a 2,2 Δ size 12{x rSub { size 8{1} } = { {"det" left [ matrix { b rSub { size 8{1} } {} # a rSub { size 8{1,2} } {} ##b rSub { size 8{2} } {} # a rSub { size 8{2,2} } {} } right ]} over {Δ} } } {}

Before we solve for the variable x2, we replace the second column of the original coefficient matrix with the vector B . With this replacement accomplished, we may write the solution for the unknown x 2 as a ratio of determinants

Get Jobilize Job Search Mobile App in your pocket Now!

Get it on Google Play Download on the App Store Now




Source:  OpenStax, Math 1508 (laboratory) engineering applications of precalculus. OpenStax CNX. Aug 24, 2011 Download for free at http://cnx.org/content/col11337/1.3
Google Play and the Google Play logo are trademarks of Google Inc.

Notification Switch

Would you like to follow the 'Math 1508 (laboratory) engineering applications of precalculus' conversation and receive update notifications?

Ask