Cramer's Rule

Today we'll use matrices to derive Cramer's Rule, a rule by which we can solve systems of equations by just plugging in numbers. (Cramer's Rule works for n×n matrices but we'll use the 2×2 case only.)

Let's start with a generic system of two linear equations in two unknowns:

ax+by = e cx+dy = f (1)

Now let A=( a b c d ); X=( x y ); E=( e f ).

We can see that the equation AX=E is equivalent to the system (1):

AX = E ( a b c d )( x y ) = ( e f ) ( ax+by cx+dy ) = ( e f )

Finding a solution means finding values for x and y that make it true, or in the language of matrices, finding a value for X that makes it true. Well, we already have a single (matrix) equation involving X:

AX = E

How do we solve it? If we were solving a simple equation about numbers, we could divide both sides by A, or equivalently, multiply both sides by 1A. With matrices, we can do almost the same thing: multiply both sides by A-1:

A-1AX = A-1E (2)

And, just like, say, 133=1, it is also true that A-1A=I so A-1AX=IX=X. Thus we can simplify equation (2) thus:

X=A-1E (3)

This tells us our solution! Because we learned recently that ( a b c d )-1=1| A |( d -b -c a ), we can work out the matrix multiplication:

X = A-1E = 1| A |( d -b -c a )( e f ) = 1| A |( de-bf af-ce )(4)

This (4) is Cramer's Rule.

Example

Solve the system

8x+5y = 2 2x-4y = -10

Solution (using Cramer's Rule):

X = 1| 8 5 2 -4 |( 2(-4)-5(-10) 8(-10)-2(2) ) = 18(-4)-25( 42 -84 ) = 1-42( 42 -84 ) = ( 42-42 -84-42 ) = ( -1 2 )

Now we should check that we have a solution. We can either plug into the system or into the matrix form. Let's try the latter.

( 8 5 2 -4 )( -1 2 ) = ( 8(-1)+52 2(-1)+(-4)2 ) = ( 2 -10 )

Whew. Let's try one more: Solve the system

2x+y = 3 5x+6y = 4

So let A=( 2 1 5 6 ); X=( x y ); E=( 3 4 ), and we wish to solve AX=E. Cramer's Rule says

X = 126-51( 63-14 24-53 ) = 17( 14 -7 ) = ( 2 -1 )

Let's check: ( 2 1 5 6 )( 2 -1 )=( 22+1(-1) 52+6(-1) )=( 3 4 ). Whew again.