Class 12 Maths, Worked in Full Past papersGet updates
Chapter 4 · Determinants

Example 17: Solve three equations by the matrix method

ExamplesSolving systems AX = B · Section 4.6
The question

Solve the following system of equations by matrix method.

3x−2y+3z=82x+y−z=14x−3y+2z=4\begin{aligned} 3x - 2y + 3z &= 8\\ 2x + y - z &= 1\\ 4x - 3y + 2z &= 4 \end{aligned}
Exam answer

The system is AX=BAX = B⁠, where

A=[3−2321−14−32],X=[xyz], B=[814]\begin{aligned} A &= \begin{bmatrix} 3 & -2 & 3 \\ 2 & 1 & -1 \\ 4 & -3 & 2 \end{bmatrix}, \\ X &= \begin{bmatrix} x \\ y \\ z \end{bmatrix},\ B = \begin{bmatrix} 8 \\ 1 \\ 4 \end{bmatrix} \end{aligned}

Expanding along R1R_1⁠:

∣A∣=3∣1−1−32∣−(−2)∣2−142∣+3∣214−3∣=3(−1)+2(8)+3(−10)=−17\begin{aligned} |A| &= 3\begin{vmatrix} 1 & -1 \\ -3 & 2 \end{vmatrix} - (-2)\begin{vmatrix} 2 & -1 \\ 4 & 2 \end{vmatrix} \\ &\quad + 3\begin{vmatrix} 2 & 1 \\ 4 & -3 \end{vmatrix} \\ &= 3(-1) + 2(8) + 3(-10) \\ &= -17 \end{aligned}

∣A∣=−17≠0|A| = -17 \ne 0⁠. So AA is non-singular and the system has a unique solution, X=A−1BX = A^{-1}B⁠.

Cofactors:

A11=∣1−1−32∣=−1A12=−∣2−142∣=−8A13=∣214−3∣=−10\begin{aligned} A_{11} &= \begin{vmatrix} 1 & -1 \\ -3 & 2 \end{vmatrix} = -1 \\ A_{12} &= -\begin{vmatrix} 2 & -1 \\ 4 & 2 \end{vmatrix} = -8 \\ A_{13} &= \begin{vmatrix} 2 & 1 \\ 4 & -3 \end{vmatrix} = -10 \end{aligned} A21=−∣−23−32∣=−5A22=∣3342∣=−6A23=−∣3−24−3∣=1\begin{aligned} A_{21} &= -\begin{vmatrix} -2 & 3 \\ -3 & 2 \end{vmatrix} = -5 \\ A_{22} &= \begin{vmatrix} 3 & 3 \\ 4 & 2 \end{vmatrix} = -6 \\ A_{23} &= -\begin{vmatrix} 3 & -2 \\ 4 & -3 \end{vmatrix} = 1 \end{aligned} A31=∣−231−1∣=−1A32=−∣332−1∣=9A33=∣3−221∣=7\begin{aligned} A_{31} &= \begin{vmatrix} -2 & 3 \\ 1 & -1 \end{vmatrix} = -1 \\ A_{32} &= -\begin{vmatrix} 3 & 3 \\ 2 & -1 \end{vmatrix} = 9 \\ A_{33} &= \begin{vmatrix} 3 & -2 \\ 2 & 1 \end{vmatrix} = 7 \end{aligned} adj⁡A=[−1−5−1−8−69−1017]A−1=1∣A∣adj⁡A=−117[−1−5−1−8−69−1017]\begin{aligned} \operatorname{adj}A &= \begin{bmatrix} -1 & -5 & -1 \\ -8 & -6 & 9 \\ -10 & 1 & 7 \end{bmatrix} \\ A^{-1} &= \frac{1}{|A|}\operatorname{adj}A \\ &= -\frac{1}{17}\begin{bmatrix} -1 & -5 & -1 \\ -8 & -6 & 9 \\ -10 & 1 & 7 \end{bmatrix} \end{aligned} X=A−1B=−117[−1−5−1−8−69−1017][814]=−117[−8−5−4−64−6+36−80+1+28]=−117[−17−34−51]=[123]\begin{aligned} X &= A^{-1}B \\ &= -\frac{1}{17}\begin{bmatrix} -1 & -5 & -1 \\ -8 & -6 & 9 \\ -10 & 1 & 7 \end{bmatrix}\begin{bmatrix} 8 \\ 1 \\ 4 \end{bmatrix} \\ &= -\frac{1}{17}\begin{bmatrix} -8 - 5 - 4 \\ -64 - 6 + 36 \\ -80 + 1 + 28 \end{bmatrix} \\ &= -\frac{1}{17}\begin{bmatrix} -17 \\ -34 \\ -51 \end{bmatrix} = \begin{bmatrix} 1 \\ 2 \\ 3 \end{bmatrix} \end{aligned}

∴ x=1, y=2, z=3\therefore\ x = 1,\ y = 2,\ z = 3⁠.

Want the reason behind every step, the basics and the checks?

The one idea this problem is built on

Three equations in three unknowns are one matrix equation AX=BAX = B⁠. If ∣A∣≠0|A| \ne 0⁠, then A−1=1∣A∣adj⁡AA^{-1} = \frac{1}{|A|}\operatorname{adj}A exists and X=A−1BX = A^{-1}B is the one and only solution. The work is mostly bookkeeping: nine cofactors, a transpose, and two matrix products, each of which can be checked.

Given, to find, and the plan
Given
The three linear equations above.
To find
All triples (x,y,z)(x, y, z) satisfying all three equations, using matrices.
Plan
Write AX=BAX = B⁠; compute ∣A∣|A|⁠; find all nine cofactors, the matrix of cofactors and adj⁡A\operatorname{adj}A⁠; form A−1A^{-1} and check AA−1=IAA^{-1} = I⁠; compute X=A−1BX = A^{-1}B⁠; substitute back.

Basics you need

1Expanding a 3×33\times3 determinant

Along row 1: ∣A∣=a11A11+a12A12+a13A13|A| = a_{11}A_{11} + a_{12}A_{12} + a_{13}A_{13}⁠, with signs +,−,++,-,+ and each minor a 2×22\times2 determinant. Basics: the + − + sign pattern

2Cofactors and adjoint

Aij=(−1)i+jMijA_{ij} = (-1)^{i+j}M_{ij}⁠; adj⁡A\operatorname{adj}A is the transpose of the matrix of cofactors. Basics: transpose and identity

3Matrix times column

A 3×33\times3 matrix times a 3×13\times1 column is a 3×13\times1 column: each entry is a row times the column. Basics: matrix facts the chapter uses

4The matrix method

If ∣A∣≠0|A| \ne 0⁠: AX=B⇒X=A−1BAX = B \Rightarrow X = A^{-1}B⁠, and this solution is unique (Case I, Section 4.6.1). Basics: why the inverse divides by |A|

Solution

  1. Write the system as AX=BAX = B

    A=[3−2321−14−32],X=[xyz],B=[814].A = \begin{bmatrix} 3 & -2 & 3 \\ 2 & 1 & -1 \\ 4 & -3 & 2 \end{bmatrix}, \quad X = \begin{bmatrix} x \\ y \\ z \end{bmatrix}, \quad B = \begin{bmatrix} 8 \\ 1 \\ 4 \end{bmatrix}.

    AA is 3×33\times3 and XX is 3×13\times1⁠, so AXAX is 3×13\times1⁠, like BB⁠. Row by row, AXAX has entries 3x−2y+3z3x - 2y + 3z⁠, 2x+y−z2x + y - z and 4x−3y+2z4x - 3y + 2z⁠, so AX=BAX = B is exactly the given system.

    Each row of AA lists one equation's coefficients in the order x,y,zx, y, z⁠. In the second equation "+ y+\,y" means coefficient 11 and "− z-\,z" means coefficient −1-1⁠; these are the easiest entries to get wrong.
  2. Compute ∣A∣|A|⁠, expanding along row 1

    No row or column of AA contains a zero, so every expansion has three terms; we use row 1, as the textbook does. Signs +,−,++,-,+⁠:

    ∣A∣=3∣1−1−32∣−(−2)∣2−142∣+3∣214−3∣.\begin{aligned} |A| &= 3\begin{vmatrix} 1 & -1 \\ -3 & 2 \end{vmatrix} - (-2)\begin{vmatrix} 2 & -1 \\ 4 & 2 \end{vmatrix}\\ &\quad + 3\begin{vmatrix} 2 & 1 \\ 4 & -3 \end{vmatrix}. \end{aligned}

    The minors:

    ∣1−1−32∣=2−3=−1,∣2−142∣=4+4=8,∣214−3∣=−6−4=−10.\begin{aligned} \begin{vmatrix} 1 & -1 \\ -3 & 2 \end{vmatrix} &= 2 - 3 = -1,\\ \begin{vmatrix} 2 & -1 \\ 4 & 2 \end{vmatrix} &= 4 + 4 = 8,\\ \begin{vmatrix} 2 & 1 \\ 4 & -3 \end{vmatrix} &= -6 - 4 = -10. \end{aligned} ∣A∣=3(−1)+2(8)+3(−10)=−3+16−30=−17.|A| = 3(-1) + 2(8) + 3(-10) = -3 + 16 - 30 = -17.

    Since ∣A∣=−17≠0|A| = -17 \ne 0⁠, AA is non-singular: A−1A^{-1} exists and the system has a unique solution.

    The middle term is −a12M12=−(−2)(8)=+16-a_{12}M_{12} = -(-2)(8) = +16⁠: the sign pattern's minus meets the entry's own minus. The textbook writes this line as 3(2−3)+2(4+4)+3(−6−4)=−173(2 - 3) + 2(4 + 4) + 3(-6 - 4) = -17⁠.
    Section 4.2.3; Case I, Section 4.6.1. Lesson: expanding a 3 × 3 determinant
  3. Cofactors of row 1

    The minors of row 1 were found in Step 2; attach the signs +,−,++,-,+⁠:

    A11=(+1)(−1)=−1,A12=(−1)(8)=−8,A13=(+1)(−10)=−10.\begin{aligned} A_{11} &= (+1)(-1) = -1,\\ A_{12} &= (-1)(8) = -8,\\ A_{13} &= (+1)(-10) = -10. \end{aligned}
    Reusing the minors from the expansion saves work. As a check, a11A11+a12A12+a13A13a_{11}A_{11} + a_{12}A_{12} + a_{13}A_{13} is 3(−1)+(−2)(−8)+3(−10)=−17=∣A∣3(-1) + (-2)(-8) + 3(-10) = -17 = |A|⁠.
    Definition 2, Section 4.4. Lesson: minors and cofactors
  4. Cofactors of row 2

    Delete row 2 and each column in turn; signs −,+,−-,+,-⁠:

    A21=−∣−23−32∣=−(−4+9)=−5,A22=+∣3342∣=6−12=−6,A23=−∣3−24−3∣=−(−9+8)=1.\begin{aligned} A_{21} &= -\begin{vmatrix} -2 & 3 \\ -3 & 2 \end{vmatrix} = -(-4 + 9) = -5,\\ A_{22} &= +\begin{vmatrix} 3 & 3 \\ 4 & 2 \end{vmatrix} = 6 - 12 = -6,\\ A_{23} &= -\begin{vmatrix} 3 & -2 \\ 4 & -3 \end{vmatrix} = -(-9 + 8) = 1. \end{aligned}
    In M21M_{21}⁠, the product down the main diagonal is (−2)(2)=−4(-2)(2) = -4 and down the other diagonal (3)(−3)=−9(3)(-3) = -9⁠, so M21=−4−(−9)=5M_{21} = -4 - (-9) = 5⁠. Writing each product with its sign before subtracting avoids most errors.
    ad−bcad - bc with negative entries: keep every bracket. Basics: algebra the chapter leans on
  5. Cofactors of row 3

    Delete row 3 and each column in turn; signs +,−,++,-,+⁠:

    A31=+∣−231−1∣=2−3=−1,A32=−∣332−1∣=−(−3−6)=9,A33=+∣3−221∣=3+4=7.\begin{aligned} A_{31} &= +\begin{vmatrix} -2 & 3 \\ 1 & -1 \end{vmatrix} = 2 - 3 = -1,\\ A_{32} &= -\begin{vmatrix} 3 & 3 \\ 2 & -1 \end{vmatrix} = -(-3 - 6) = 9,\\ A_{33} &= +\begin{vmatrix} 3 & -2 \\ 2 & 1 \end{vmatrix} = 3 + 4 = 7. \end{aligned}
    All nine now agree with the textbook: A11=−1A_{11} = -1⁠, A12=−8A_{12} = -8⁠, A13=−10A_{13} = -10⁠, A21=−5A_{21} = -5⁠, A22=−6A_{22} = -6⁠, A23=1A_{23} = 1⁠, A31=−1A_{31} = -1⁠, A32=9A_{32} = 9⁠, A33=7A_{33} = 7⁠.
  6. Matrix of cofactors, adj⁡A\operatorname{adj}A and A−1A^{-1}

    [Aij]=[−1−8−10−5−61−197].[A_{ij}] = \begin{bmatrix} -1 & -8 & -10 \\ -5 & -6 & 1 \\ -1 & 9 & 7 \end{bmatrix}.

    Transpose (rows become columns):

    adj⁡A=[−1−5−1−8−69−1017].\operatorname{adj}A = \begin{bmatrix} -1 & -5 & -1 \\ -8 & -6 & 9 \\ -10 & 1 & 7 \end{bmatrix}.

    Since ∣A∣=−17≠0|A| = -17 \ne 0⁠,

    A−1=1∣A∣adj⁡A=−117[−1−5−1−8−69−1017].\begin{aligned} A^{-1} &= \frac{1}{|A|}\operatorname{adj}A\\ &= -\frac{1}{17}\begin{bmatrix} -1 & -5 & -1 \\ -8 & -6 & 9 \\ -10 & 1 & 7 \end{bmatrix}. \end{aligned}
    The cofactors of row 1 (−1,−8,−10-1, -8, -10⁠) become column 1 of the adjoint, and so on. Keeping −117-\frac{1}{17} outside avoids fractions until the very end.
    Definition 3, Section 4.5.1; Theorem 4, Section 4.5. Lesson: the adjoint
  7. Check: AA−1=IAA^{-1} = I

    It is enough to check A(adj⁡A)=∣A∣ I=−17IA(\operatorname{adj}A) = |A|\,I = -17I⁠. Row ii of AA times column jj of adj⁡A\operatorname{adj}A⁠:

    c11=3(−1)+(−2)(−8)+3(−10)=−17,c12=3(−5)+(−2)(−6)+3⋅1=0,c13=3(−1)+(−2)⋅9+3⋅7=0,c21=2(−1)+1(−8)+(−1)(−10)=0,c22=2(−5)+1(−6)+(−1)⋅1=−17,c23=2(−1)+1⋅9+(−1)⋅7=0,c31=4(−1)+(−3)(−8)+2(−10)=0,c32=4(−5)+(−3)(−6)+2⋅1=0,c33=4(−1)+(−3)⋅9+2⋅7=−17.\begin{aligned} c_{11} &= 3(-1) + (-2)(-8) + 3(-10) = -17,\\ c_{12} &= 3(-5) + (-2)(-6) + 3\cdot1 = 0,\\ c_{13} &= 3(-1) + (-2)\cdot9 + 3\cdot7 = 0,\\ c_{21} &= 2(-1) + 1(-8) + (-1)(-10) = 0,\\ c_{22} &= 2(-5) + 1(-6) + (-1)\cdot1 = -17,\\ c_{23} &= 2(-1) + 1\cdot9 + (-1)\cdot7 = 0,\\ c_{31} &= 4(-1) + (-3)(-8) + 2(-10) = 0,\\ c_{32} &= 4(-5) + (-3)(-6) + 2\cdot1 = 0,\\ c_{33} &= 4(-1) + (-3)\cdot9 + 2\cdot7 = -17. \end{aligned}

    So A(adj⁡A)=−17IA(\operatorname{adj}A) = -17I and AA−1=−117(−17I)=IAA^{-1} = -\frac{1}{17}(-17I) = I⁠.

    If any cofactor were wrong, some entry here would fail to be −17-17 or 00⁠. Checking the inverse before using it means an error cannot travel into the solution.
  8. Compute X=A−1BX = A^{-1}B

    X=−117[−1−5−1−8−69−1017][814].X = -\frac{1}{17}\begin{bmatrix} -1 & -5 & -1 \\ -8 & -6 & 9 \\ -10 & 1 & 7 \end{bmatrix}\begin{bmatrix} 8 \\ 1 \\ 4 \end{bmatrix}.

    Row times column:

    row 1: (−1)8+(−5)1+(−1)4=−17,row 2: (−8)8+(−6)1+9⋅4=−34,row 3: (−10)8+1⋅1+7⋅4=−51.\begin{aligned} \text{row 1}&: \ (-1)8 + (-5)1 + (-1)4 = -17,\\ \text{row 2}&: \ (-8)8 + (-6)1 + 9\cdot4 = -34,\\ \text{row 3}&: \ (-10)8 + 1\cdot1 + 7\cdot4 = -51. \end{aligned} [xyz]=−117[−17−34−51]=[123].\begin{bmatrix} x \\ y \\ z \end{bmatrix} = -\frac{1}{17}\begin{bmatrix} -17 \\ -34 \\ -51 \end{bmatrix} = \begin{bmatrix} 1 \\ 2 \\ 3 \end{bmatrix}.

    Comparing entries: x=1x = 1⁠, y=2y = 2⁠, z=3z = 3.

    X=A−1BX = A^{-1}B comes from pre-multiplying AX=BAX = B by A−1A^{-1} (Case I, Section 4.6.1). Each entry of the column is then divided by −17-17⁠: −17−17=1\frac{-17}{-17} = 1⁠, −34−17=2\frac{-34}{-17} = 2⁠, −51−17=3\frac{-51}{-17} = 3⁠.
    Case I, Section 4.6.1; equality of matrices. Lesson: solving systems AX = B
  9. Check in every original equation

    3(1)−2(2)+3(3)=3−4+9=8,2(1)+2−3=1,4(1)−3(2)+2(3)=4−6+6=4.\begin{aligned} 3(1) - 2(2) + 3(3) &= 3 - 4 + 9 = 8,\\ 2(1) + 2 - 3 &= 1,\\ 4(1) - 3(2) + 2(3) &= 4 - 6 + 6 = 4. \end{aligned}

    All three right-hand sides 8,1,48, 1, 4 are reproduced.

    The solution must satisfy the equations as given, not just our matrix version of them; substituting back tests everything at once, including the setting up in Step 1.
Result

∣A∣=−17≠0|A| = -17 \ne 0⁠, so the system has the unique solution

X=A−1B=−117[−17−34−51]=[123],X = A^{-1}B = -\frac{1}{17}\begin{bmatrix} -17 \\ -34 \\ -51 \end{bmatrix} = \begin{bmatrix} 1 \\ 2 \\ 3 \end{bmatrix},

that is x=1x = 1⁠, y=2y = 2⁠, z=3z = 3. (This agrees with the textbook's own solution.)

Check it with numbers

Elimination gives the same answer independently. From the second equation, z=2x+y−1z = 2x + y - 1⁠. Substituting into the first: 3x−2y+6x+3y−3=83x - 2y + 6x + 3y - 3 = 8⁠, so 9x+y=119x + y = 11⁠. Into the third: 4x−3y+4x+2y−2=44x - 3y + 4x + 2y - 2 = 4⁠, so 8x−y=68x - y = 6⁠. Adding these two, 17x=1717x = 17⁠, so x=1x = 1⁠; then y=11−9=2y = 11 - 9 = 2 and z=2+2−1=3z = 2 + 2 - 1 = 3⁠. Same answer.

Common mistakes
  1. Wrong sign on the middle term of the expansion. It is −a12M12=−(−2)(8)=+16-a_{12}M_{12} = -(-2)(8) = +16⁠.
  2. Forgetting the transpose. Using [Aij][A_{ij}] instead of adj⁡A\operatorname{adj}A gives a wrong A−1A^{-1}⁠; the check in Step 7 would fail.
  3. Dropping −117-\frac{1}{17}⁠. Without it the "solution" would be −17,−34,−51-17, -34, -51⁠.
  4. Misreading coefficients. "2x+y−z2x + y - z" has coefficients 2,1,−12, 1, -1⁠.
What to take away
  1. Matrix method: AX=BAX = B⁠, check ∣A∣≠0|A| \ne 0⁠, then X=1∣A∣(adj⁡A)BX = \frac{1}{|A|}(\operatorname{adj}A)B⁠.
  2. Check the inverse (A adj⁡A=∣A∣ IA\,\operatorname{adj}A = |A|\,I⁠) before using it, and check the solution in the original equations after.
  3. Keeping 1∣A∣\frac{1}{|A|} outside the matrix keeps the arithmetic in whole numbers until the end.

Every fact used, and where it comes from

FactUsed inSource
Writing a system as AX=BAX = BStep 1Section 4.6.1 (Lesson: solving systems AX = B)
Expansion along a rowStep 2Section 4.2.3 (Lesson: expanding a 3 × 3 determinant)
Minors and cofactorsSteps 3 to 5Definitions 1 and 2, Section 4.4 (Lesson: minors and cofactors)
adj⁡A\operatorname{adj}A = transpose of [Aij][A_{ij}]Step 6Definition 3, Section 4.5.1
A−1=1∣A∣adj⁡AA^{-1} = \frac{1}{|A|}\operatorname{adj}A when ∣A∣≠0|A| \ne 0Step 6Theorem 4, Section 4.5 (Lesson: inverse of a matrix)
A(adj⁡A)=∣A∣ IA(\operatorname{adj}A) = |A|\,IStep 7Theorem 1, Section 4.5
∣A∣≠0|A| \ne 0⁠: unique solution X=A−1BX = A^{-1}BSteps 2, 8Case I, Section 4.6.1
Found an error, or want more?

Tell us if something on this page is wrong or unclear, or if you would like a fuller explanation, another method or a new feature. Send feedback on this problem →