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

Exercise 4.5 · Q12: Solve x−y+z=4x-y+z=4⁠, 2x+y−3z=02x+y-3z=0⁠, x+y+z=2x+y+z=2 by the matrix method

Exercise 4.5Solving systems AX = B · Section 4.6.1
The question

Solve system of linear equations, using matrix method, in Exercises 7 to 14.

12.

x−y+z=42x+y−3z=0x+y+z=2\begin{aligned} x - y + z &= 4\\ 2x + y - 3z &= 0\\ x + y + z &= 2 \end{aligned}
Exam answer

The system is AX=BAX = B⁠, where

A=[1−1121−3111],X=[xyz], B=[402]\begin{aligned} A &= \begin{bmatrix} 1 & -1 & 1 \\ 2 & 1 & -3 \\ 1 & 1 & 1 \end{bmatrix}, \\ X &= \begin{bmatrix} x \\ y \\ z \end{bmatrix},\ B = \begin{bmatrix} 4 \\ 0 \\ 2 \end{bmatrix} \end{aligned}

Expanding along R1R_1⁠:

∣A∣=1∣1−311∣−(−1)∣2−311∣+1∣2111∣=1(4)+1(5)+1(1)=10\begin{aligned} |A| &= 1\begin{vmatrix} 1 & -3 \\ 1 & 1 \end{vmatrix} - (-1)\begin{vmatrix} 2 & -3 \\ 1 & 1 \end{vmatrix} \\ &\quad + 1\begin{vmatrix} 2 & 1 \\ 1 & 1 \end{vmatrix} \\ &= 1(4) + 1(5) + 1(1) \\ &= 10 \end{aligned}

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

Cofactors:

A11=∣1−311∣=4A12=−∣2−311∣=−5A13=∣2111∣=1\begin{aligned} A_{11} &= \begin{vmatrix} 1 & -3 \\ 1 & 1 \end{vmatrix} = 4 \\ A_{12} &= -\begin{vmatrix} 2 & -3 \\ 1 & 1 \end{vmatrix} = -5 \\ A_{13} &= \begin{vmatrix} 2 & 1 \\ 1 & 1 \end{vmatrix} = 1 \end{aligned} A21=−∣−1111∣=2A22=∣1111∣=0A23=−∣1−111∣=−2\begin{aligned} A_{21} &= -\begin{vmatrix} -1 & 1 \\ 1 & 1 \end{vmatrix} = 2 \\ A_{22} &= \begin{vmatrix} 1 & 1 \\ 1 & 1 \end{vmatrix} = 0 \\ A_{23} &= -\begin{vmatrix} 1 & -1 \\ 1 & 1 \end{vmatrix} = -2 \end{aligned} A31=∣−111−3∣=2A32=−∣112−3∣=5A33=∣1−121∣=3\begin{aligned} A_{31} &= \begin{vmatrix} -1 & 1 \\ 1 & -3 \end{vmatrix} = 2 \\ A_{32} &= -\begin{vmatrix} 1 & 1 \\ 2 & -3 \end{vmatrix} = 5 \\ A_{33} &= \begin{vmatrix} 1 & -1 \\ 2 & 1 \end{vmatrix} = 3 \end{aligned} adj⁡A=[422−5051−23]A−1=1∣A∣adj⁡A=110[422−5051−23]\begin{aligned} \operatorname{adj}A &= \begin{bmatrix} 4 & 2 & 2 \\ -5 & 0 & 5 \\ 1 & -2 & 3 \end{bmatrix} \\ A^{-1} &= \frac{1}{|A|}\operatorname{adj}A \\ &= \frac{1}{10}\begin{bmatrix} 4 & 2 & 2 \\ -5 & 0 & 5 \\ 1 & -2 & 3 \end{bmatrix} \end{aligned} X=A−1B=110[422−5051−23][402]=110[16+0+4−20+0+104+0+6]=110[20−1010]=[2−11]\begin{aligned} X &= A^{-1}B \\ &= \frac{1}{10}\begin{bmatrix} 4 & 2 & 2 \\ -5 & 0 & 5 \\ 1 & -2 & 3 \end{bmatrix}\begin{bmatrix} 4 \\ 0 \\ 2 \end{bmatrix} \\ &= \frac{1}{10}\begin{bmatrix} 16 + 0 + 4 \\ -20 + 0 + 10 \\ 4 + 0 + 6 \end{bmatrix} \\ &= \frac{1}{10}\begin{bmatrix} 20 \\ -10 \\ 10 \end{bmatrix} = \begin{bmatrix} 2 \\ -1 \\ 1 \end{bmatrix} \end{aligned}

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

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

The one idea this problem is built on

Write the system as AX=BAX = B⁠. Since ∣A∣≠0|A| \ne 0⁠, the coefficient matrix has an inverse, A−1=1∣A∣adj⁡AA^{-1} = \frac{1}{|A|}\operatorname{adj} A⁠, and X=A−1BX = A^{-1}B is the one and only solution. Most of the work is computing nine cofactors correctly, and the product A(adj⁡A)=∣A∣ IA(\operatorname{adj} A) = |A|\,I tells us whether we did.

Given, to find, and the plan
Given
x−y+z=4x - y + z = 4⁠, 2x+y−3z=02x + y - 3z = 0⁠, x+y+z=2x + y + z = 2⁠.
To find
xx⁠, yy⁠, zz by the matrix method.
Plan
(1) AX=BAX = B⁠. (2) ∣A∣|A| by expansion along row 1. (3) All nine minors and cofactors. (4) adj⁡A\operatorname{adj} A and A−1A^{-1}⁠. (5) Check A(adj⁡A)=∣A∣ IA(\operatorname{adj} A) = |A|\,I⁠. (6) X=A−1BX = A^{-1}B⁠. (7) Check in the three equations.

Basics you need

1A system is a matrix product

Row ii of AA times XX gives the left side of equation ii⁠. A term like −y-y has coefficient −1-1⁠; a term like zz has coefficient 11⁠. Basics: matrix facts the chapter uses

2Expanding a 3×33\times3 determinant

Along row 1: ∣A∣=a11M11−a12M12+a13M13|A| = a_{11}M_{11} - a_{12}M_{12} + a_{13}M_{13}⁠. The middle term has a minus sign from (−1)1+2(-1)^{1+2}⁠. Basics: the + − + sign pattern

3Minor, cofactor, adjoint

MijM_{ij}⁠: delete row ii⁠, column jj⁠. Aij=(−1)i+jMijA_{ij} = (-1)^{i+j}M_{ij}⁠. adj⁡A\operatorname{adj} A is the transpose of [Aij][A_{ij}]⁠. Basics: where the determinant comes from

4The inverse divides by ∣A∣|A|

A(adj⁡A)=∣A∣ IA(\operatorname{adj} A) = |A|\,I⁠, so A−1=1∣A∣adj⁡AA^{-1} = \frac{1}{|A|}\operatorname{adj} A when ∣A∣≠0|A| \ne 0⁠. Basics: why the inverse divides by |A|

Solution

  1. Write the system as AX=BAX = B

    A=[1−1121−3111],A = \begin{bmatrix} 1 & -1 & 1 \\ 2 & 1 & -3 \\ 1 & 1 & 1 \end{bmatrix}, X=[xyz],B=[402].X = \begin{bmatrix} x \\ y \\ z \end{bmatrix},\quad B = \begin{bmatrix} 4 \\ 0 \\ 2 \end{bmatrix}.

    AA is 3×33\times3 and XX is 3×13\times1⁠, so AXAX is defined and is 3×13\times1⁠, like BB⁠:

    AX=[x−y+z2x+y−3zx+y+z].AX = \begin{bmatrix} x - y + z \\ 2x + y - 3z \\ x + y + z \end{bmatrix}.

    So AX=BAX = B is exactly the given system.

    The unwritten coefficients are ±1\pm1⁠: xx means 1x1x and −y-y means (−1)y(-1)y⁠. The right-hand side of the second equation is 0, and it still takes its place in BB⁠.
    Section 4.6.1 (matrix form); Section 3.4.5 (row times column). Lesson: solving systems AX = B
  2. Compute ∣A∣|A| by expanding along row 1

    No row or column has a zero, so take row 1, whose entries 1,−1,11, -1, 1 are small. Signs + − ++\,-\,+⁠:

    ∣A∣=1∣1−311∣−(−1)∣2−311∣+1∣2111∣=1(4)−(−1)(5)+1(1)=4+5+1=10.\begin{aligned} |A| &= 1\begin{vmatrix} 1 & -3 \\ 1 & 1 \end{vmatrix} - (-1)\begin{vmatrix} 2 & -3 \\ 1 & 1 \end{vmatrix}\\ &\qquad + 1\begin{vmatrix} 2 & 1 \\ 1 & 1 \end{vmatrix}\\ &= 1(4) - (-1)(5) + 1(1)\\ &= 4 + 5 + 1 = 10. \end{aligned}

    (The three minors, 44⁠, 55 and 11⁠, are worked out in Step 3.) So ∣A∣=10≠0|A| = 10 \ne 0⁠: AA is nonsingular and the solution is unique.

    Two minus signs meet in the middle term: the sign (−1)1+2=−1(-1)^{1+2} = -1 of the position and the entry a12=−1a_{12} = -1 itself. Their product is +1+1⁠, so the term adds 55⁠. Writing −(−1)(5)-(-1)(5) in full is the safest way not to lose one of them.
    Section 4.2.3 (expansion along a row); Section 4.6.1, Case I. Lesson: expanding a 3 × 3 determinant
  3. Find all nine minors and cofactors

    Row 1 (entries 1,−1,11, -1, 1⁠):

    M11=∣1−311∣=(1)(1)−(−3)(1)=4,A11=(−1)1+1(4)=4,M12=∣2−311∣=(2)(1)−(−3)(1)=5,A12=(−1)1+2(5)=−5,M13=∣2111∣=(2)(1)−(1)(1)=1,A13=(−1)1+3(1)=1.\begin{aligned} M_{11} &= \begin{vmatrix} 1 & -3 \\ 1 & 1 \end{vmatrix}\\ &= (1)(1) - (-3)(1) = 4,\\ A_{11} &= (-1)^{1+1}(4) = 4,\\ M_{12} &= \begin{vmatrix} 2 & -3 \\ 1 & 1 \end{vmatrix}\\ &= (2)(1) - (-3)(1) = 5,\\ A_{12} &= (-1)^{1+2}(5) = -5,\\ M_{13} &= \begin{vmatrix} 2 & 1 \\ 1 & 1 \end{vmatrix}\\ &= (2)(1) - (1)(1) = 1,\\ A_{13} &= (-1)^{1+3}(1) = 1. \end{aligned}

    Row 2 (entries 2,1,−32, 1, -3⁠):

    M21=∣−1111∣=(−1)(1)−(1)(1)=−2,A21=(−1)2+1(−2)=2,M22=∣1111∣=(1)(1)−(1)(1)=0,A22=(−1)2+2(0)=0,M23=∣1−111∣=(1)(1)−(−1)(1)=2,A23=(−1)2+3(2)=−2.\begin{aligned} M_{21} &= \begin{vmatrix} -1 & 1 \\ 1 & 1 \end{vmatrix}\\ &= (-1)(1) - (1)(1) = -2,\\ A_{21} &= (-1)^{2+1}(-2) = 2,\\ M_{22} &= \begin{vmatrix} 1 & 1 \\ 1 & 1 \end{vmatrix}\\ &= (1)(1) - (1)(1) = 0,\\ A_{22} &= (-1)^{2+2}(0) = 0,\\ M_{23} &= \begin{vmatrix} 1 & -1 \\ 1 & 1 \end{vmatrix}\\ &= (1)(1) - (-1)(1) = 2,\\ A_{23} &= (-1)^{2+3}(2) = -2. \end{aligned}

    Row 3 (entries 1,1,11, 1, 1⁠):

    M31=∣−111−3∣=(−1)(−3)−(1)(1)=2,A31=(−1)3+1(2)=2,M32=∣112−3∣=(1)(−3)−(1)(2)=−5,A32=(−1)3+2(−5)=5,M33=∣1−121∣=(1)(1)−(−1)(2)=3,A33=(−1)3+3(3)=3.\begin{aligned} M_{31} &= \begin{vmatrix} -1 & 1 \\ 1 & -3 \end{vmatrix}\\ &= (-1)(-3) - (1)(1) = 2,\\ A_{31} &= (-1)^{3+1}(2) = 2,\\ M_{32} &= \begin{vmatrix} 1 & 1 \\ 2 & -3 \end{vmatrix}\\ &= (1)(-3) - (1)(2) = -5,\\ A_{32} &= (-1)^{3+2}(-5) = 5,\\ M_{33} &= \begin{vmatrix} 1 & -1 \\ 2 & 1 \end{vmatrix}\\ &= (1)(1) - (-1)(2) = 3,\\ A_{33} &= (-1)^{3+3}(3) = 3. \end{aligned}
    Each minor keeps the four entries that are in neither the row nor the column of aija_{ij}⁠, in their original arrangement. M22=0M_{22} = 0 because rows 1 and 3 of AA⁠, with column 2 deleted, are both (1,1)(1, 1)⁠: a 2×22\times2 determinant with two equal rows is 0. A zero cofactor is perfectly allowed.
    Definitions 1 and 2, Section 4.4. Lesson: minors and cofactors
  4. Build adj⁡A\operatorname{adj} A and A−1A^{-1}

    Matrix of cofactors:

    [4−5120−2253]\begin{bmatrix} 4 & -5 & 1 \\ 2 & 0 & -2 \\ 2 & 5 & 3 \end{bmatrix}

    Transpose it to get the adjoint, then divide by ∣A∣=10|A| = 10⁠:

    adj⁡A=[422−5051−23],\operatorname{adj} A = \begin{bmatrix} 4 & 2 & 2 \\ -5 & 0 & 5 \\ 1 & -2 & 3 \end{bmatrix}, A−1=110[422−5051−23].A^{-1} = \frac{1}{10}\begin{bmatrix} 4 & 2 & 2 \\ -5 & 0 & 5 \\ 1 & -2 & 3 \end{bmatrix}.
    Row 1 of cofactors (4,−5,1)(4, -5, 1) becomes column 1 of the adjoint, and so on. Keeping 110\frac{1}{10} outside the matrix avoids writing nine fractions.
    Definition 3, Section 4.5.1; Theorem 4, Section 4.5. Lesson: the adjoint
  5. Check: A(adj⁡A)=10 IA(\operatorname{adj} A) = 10\,I

    (1,1): 1(4)+(−1)(−5)+1(1)=4+5+1=10,(1,2): 1(2)+(−1)(0)+1(−2)=2+0−2=0,(1,3): 1(2)+(−1)(5)+1(3)=2−5+3=0,(2,1): 2(4)+1(−5)+(−3)(1)=8−5−3=0,(2,2): 2(2)+1(0)+(−3)(−2)=4+0+6=10,(2,3): 2(2)+1(5)+(−3)(3)=4+5−9=0,(3,1): 1(4)+1(−5)+1(1)=4−5+1=0,(3,2): 1(2)+1(0)+1(−2)=2+0−2=0,(3,3): 1(2)+1(5)+1(3)=2+5+3=10.\begin{aligned} (1,1)&:\ 1(4) + (-1)(-5) + 1(1)\\ &= 4 + 5 + 1 = 10,\\ (1,2)&:\ 1(2) + (-1)(0) + 1(-2)\\ &= 2 + 0 - 2 = 0,\\ (1,3)&:\ 1(2) + (-1)(5) + 1(3)\\ &= 2 - 5 + 3 = 0,\\ (2,1)&:\ 2(4) + 1(-5) + (-3)(1)\\ &= 8 - 5 - 3 = 0,\\ (2,2)&:\ 2(2) + 1(0) + (-3)(-2)\\ &= 4 + 0 + 6 = 10,\\ (2,3)&:\ 2(2) + 1(5) + (-3)(3)\\ &= 4 + 5 - 9 = 0,\\ (3,1)&:\ 1(4) + 1(-5) + 1(1)\\ &= 4 - 5 + 1 = 0,\\ (3,2)&:\ 1(2) + 1(0) + 1(-2)\\ &= 2 + 0 - 2 = 0,\\ (3,3)&:\ 1(2) + 1(5) + 1(3)\\ &= 2 + 5 + 3 = 10. \end{aligned} A(adj⁡A)=[100001000010]=10 I,A(\operatorname{adj} A) = \begin{bmatrix} 10 & 0 & 0 \\ 0 & 10 & 0 \\ 0 & 0 & 10 \end{bmatrix} = 10\,I,

    so AA−1=110(10 I)=IAA^{-1} = \frac{1}{10}(10\,I) = I⁠.

    Each diagonal entry is a row of AA times its own cofactors, which is ∣A∣=10|A| = 10⁠; each off-diagonal entry is a row times the cofactors of a different row, which is 0. All nine cofactors are confirmed.
    Theorem 1, Section 4.5; Note in Section 4.4. Basics: why the inverse divides by |A|
  6. Compute X=A−1BX = A^{-1}B

    A−1A^{-1} (3×33\times3⁠) times BB (3×13\times1⁠) is 3×13\times1⁠. First (adj⁡A)B(\operatorname{adj} A)B⁠:

    row 1: 4(4)+2(0)+2(2)=16+0+4=20,row 2: (−5)(4)+0(0)+5(2)=−20+0+10=−10,row 3: 1(4)+(−2)(0)+3(2)=4+0+6=10.\begin{aligned} \text{row 1}&:\ 4(4) + 2(0) + 2(2)\\ &= 16 + 0 + 4 = 20,\\ \text{row 2}&:\ (-5)(4) + 0(0) + 5(2)\\ &= -20 + 0 + 10 = -10,\\ \text{row 3}&:\ 1(4) + (-2)(0) + 3(2)\\ &= 4 + 0 + 6 = 10. \end{aligned} X=[xyz]=110[20−1010]=[2−11].X = \begin{bmatrix} x \\ y \\ z \end{bmatrix} = \frac{1}{10}\begin{bmatrix} 20 \\ -10 \\ 10 \end{bmatrix} = \begin{bmatrix} 2 \\ -1 \\ 1 \end{bmatrix}.

    So x=2x = 2⁠, y=−1y = -1⁠, z=1z = 1.

    X=A−1BX = A^{-1}B follows from AX=BAX = B by multiplying on the left by A−1A^{-1} and using A−1A=IA^{-1}A = I⁠. The 0 in BB wipes out the middle column of adj⁡A\operatorname{adj} A in every row, which is why each sum has a "+ 0+\,0".
    Section 4.6.1, Case I. Lesson: inverse of a matrix
  7. Check in all three original equations

    x−y+z=2−(−1)+1=4,2x+y−3z=2(2)+(−1)−3(1)=0,x+y+z=2+(−1)+1=2.\begin{aligned} x - y + z &= 2 - (-1) + 1 = 4,\\ 2x + y - 3z &= 2(2) + (-1) - 3(1) = 0,\\ x + y + z &= 2 + (-1) + 1 = 2. \end{aligned}

    All three hold.

    Substituting into the original equations, not into AX=BAX = B⁠, also confirms that AA and BB were copied correctly in Step 1.
Result

∣A∣=10≠0|A| = 10 \ne 0⁠, and

A−1=110[422−5051−23].A^{-1} = \frac{1}{10}\begin{bmatrix} 4 & 2 & 2 \\ -5 & 0 & 5 \\ 1 & -2 & 3 \end{bmatrix}.

The unique solution is x=2x = 2⁠, y=−1y = -1⁠, z=1z = 1.

(Textbook answer: x=2x = 2⁠, y=−1y = -1⁠, z=1z = 1⁠.)

Check it with numbers

By elimination. Subtract the first equation from the third: (x+y+z)−(x−y+z)=2−4(x + y + z) - (x - y + z) = 2 - 4⁠, so 2y=−22y = -2 and y=−1y = -1⁠. Then the first equation gives x+z=4+y=3x + z = 4 + y = 3⁠, and the second gives 2x−3z=−y=12x - 3z = -y = 1⁠. Substituting x=3−zx = 3 - z⁠: 6−2z−3z=16 - 2z - 3z = 1⁠, so z=1z = 1 and x=2x = 2⁠. The same solution.

A second expansion of ∣A∣|A|⁠. Along column 2, with cofactors A12=−5A_{12} = -5⁠, A22=0A_{22} = 0⁠, A32=5A_{32} = 5⁠: (−1)(−5)+1(0)+1(5)=10(-1)(-5) + 1(0) + 1(5) = 10⁠.

Common mistakes
  1. Losing a minus sign in the expansion. The middle term is −a12M12=−(−1)(5)=+5-a_{12}M_{12} = -(-1)(5) = +5⁠. Writing −5-5 gives ∣A∣=0|A| = 0 and the false conclusion that there is no unique solution.
  2. Skipping the transpose. The cofactor matrix and adj⁡A\operatorname{adj} A differ here (for example position (1, 2) holds −5-5 in one and 22 in the other).
  3. Writing 11 for the coefficient of −y-y⁠. It is −1-1⁠; the sign belongs to the coefficient.
What to take away
  1. With no zeros to exploit, expand along the row with the smallest entries, and write every sign in full.
  2. The product A(adj⁡A)=∣A∣ IA(\operatorname{adj} A) = |A|\,I checks all nine cofactors at once; a single wrong cofactor shows up as a non-zero off-diagonal entry or a wrong diagonal one.
  3. A zero on the right-hand side or a zero cofactor is not a problem; only ∣A∣=0|A| = 0 would stop the method.

Every fact used, and where it comes from

FactUsed inSource
A system written as AX=BAX = BStep 1Section 4.6.1 (Lesson: solving systems)
Matrix product, row times columnSteps 1, 5, 6Section 3.4.5 (Chapter 3)
Expansion along a row, signs (−1)i+j(-1)^{i+j}Step 2Section 4.2.3 (Lesson: expanding a 3 × 3 determinant)
Minor and cofactorStep 3Definitions 1 and 2, Section 4.4 (Lesson: minors and cofactors)
adj⁡A\operatorname{adj} A = transpose of [Aij][A_{ij}]Step 4Definition 3, Section 4.5.1 (Lesson: the adjoint)
A(adj⁡A)=∣A∣ IA(\operatorname{adj} A) = |A|\,I⁠; a row times other cofactors gives 0Step 5Theorem 1, Section 4.5; Note in Section 4.4
A−1=1∣A∣adj⁡AA^{-1} = \frac{1}{|A|}\operatorname{adj} A when ∣A∣≠0|A| \ne 0Step 4Theorem 4, Section 4.5 (Lesson: inverse of a matrix)
X=A−1BX = A^{-1}B is the unique solutionSteps 2, 6Section 4.6.1, Case I
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 →