Wize University Linear Algebra Textbook > Determinants

Cramer's Rule for Solving Linear Systems

0:00 / 0:00

Cramer's Rule

Cramer's rule is a method that uses determinants to solve systems of linear equations.

Definition of Ai\colorOne{A_i}

Let An×nA_{n \times n} be an invertible matrix, and let bRn\vec b \in \reals^n be a constant vector:
A=[a11a12a1na21a22a11an1an2ann],b=[b1b2bn]A = \left[ \begin{array}{rrr} a_{11} & a_{12} & \dots & a_{1n}\\ a_{21} & a_{22} & \dots & a_{11}\\ \vdots & \vdots & & \vdots\\ a_{n1} & a_{n2} & \dots &a_{nn}\\ \end{array} \right] ,\qquad \vec b= \begin{bmatrix} b_1\\ b_2\\ \vdots\\ b_n\\ \end{bmatrix}
Define AiA_i to be the matrix AA with column ii replaced by b\vec b.
For example, A2A_2 replaces column 2 of AA:
A2=[a11b1a1na21b2a11an1bnann]A_{\colorTwo{2}} = \left[ \begin{array}{rrr} a_{11} & \colorTwo{b_1} & \dots & a_{1n}\\ a_{21} & \colorTwo{b_2} & \dots & a_{11}\\ \vdots & \colorTwo{\vdots} & & \vdots\\ a_{n1} & \colorTwo{b_n} & \dots &a_{nn}\\ \end{array} \right]
PAGE BREAK

Cramer's Rule

Each component xix_i of the unique solution x\vec x to the linear system Ax=bA\vec{x}=\vec{b} is given by:
xi=det(Ai)det(A)\boxed{\quad x_i = \dfrac{\det{A_i}}{\det{A}} \quad}
Example
Write an expression for each component of the solution vector of the following SLE: [abcd][xy]=[pq]\begin{bmatrix} a&b\\c&d \end{bmatrix} \begin{bmatrix} \colorOne x\\ \colorOne y \end{bmatrix} = \begin{bmatrix} \colorTwo p\\ \colorTwo q \end{bmatrix}.
x=pbqdabcd,y=apcqabcd\colorOne x= \dfrac{ \left\vert \begin{array}{rr} \colorTwo p&b\\ \colorTwo q&d \end{array} \right\vert } { \left\vert \begin{array}{rr} a&b\\ c&d \end{array} \right\vert } , \qquad \colorOne y= \dfrac{ \left\vert \begin{array}{rr} a&\colorTwo p\\ c&\colorTwo q \end{array} \right\vert } { \left\vert \begin{array}{rr} a&b\\ c&d \end{array} \right\vert }
0:00 / 0:00

Example: Cramer's Rule

Determine the solution to the SLE using determinants:
2x+3y=15x4y=3\begin{aligned} 2x+3y&=1\\ 5x−4y&=-3 \end{aligned}
We can write the matrix equation:
[2354][xy]=[13]\begin{bmatrix} 2&3\\ 5&-4 \end{bmatrix}\begin{bmatrix} x\\y \end{bmatrix}=\begin{bmatrix} 1\\ -3 \end{bmatrix}
Apply Cramer's rule:
x=13342354 = (1)(4)(3)(3)(2)(4)(3)(5) = 523x =\dfrac{ \left\vert \begin{array}{rr} 1&3\\ -3&-4 \end{array} \right\vert } { \left\vert \begin{array}{rr} 2&3\\ 5&-4 \end{array} \right\vert } \ =\ \dfrac{(1)(-4)-(3)(-3)}{(2)(-4)-(3)(5)} \ =\ -\dfrac{5}{23}
y=21532354 = (2)(3)(1)(5)23 = 1123y=\dfrac{ \left\vert \begin{array}{rr} 2&1\\ 5&-3 \end{array} \right\vert } { \left\vert \begin{array}{rr} 2&3\\ 5&-4 \end{array} \right\vert } \ =\ \dfrac{(2)(-3)-(1)(5)}{-23} \ =\ \dfrac{11}{23}
Therefore, the unique solution is x=[5231123]\boxed{\vec x = \left[\begin{array}{r} -\dfrac{5}{23}\\[1.5em] \dfrac{11}{23}\\[0.5em] \end{array}\right] }.
Find yy given the system of linear equations:

[011420212][xyz]=[214]\left[ \begin{array}{rrr} 0&-1&1\\ 4&2&0\\ 2&1&-2 \end{array} \right] \begin{bmatrix} x\\y\\z\\ \end{bmatrix} = \begin{bmatrix} 2\\1\\4\\ \end{bmatrix}

Extra Practice