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

Example 16: Solve two equations by the matrix method

ExamplesSolving systems AX = B · Section 4.6
The question

Solve the system of equations

2x+5y=13x+2y=7\begin{aligned} 2x + 5y &= 1\\ 3x + 2y &= 7 \end{aligned}
Exam answer

The system is AX=BAX = B⁠, where

A=[2532], X=[xy], B=[17]A = \begin{bmatrix} 2 & 5 \\ 3 & 2 \end{bmatrix},\ X = \begin{bmatrix} x \\ y \end{bmatrix},\ B = \begin{bmatrix} 1 \\ 7 \end{bmatrix}

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

adj⁡A=[2−5−32]A−1=1∣A∣adj⁡A=−111[2−5−32]\begin{aligned} \operatorname{adj}A &= \begin{bmatrix} 2 & -5 \\ -3 & 2 \end{bmatrix} \\ A^{-1} &= \frac{1}{|A|}\operatorname{adj}A \\ &= -\frac{1}{11}\begin{bmatrix} 2 & -5 \\ -3 & 2 \end{bmatrix} \end{aligned} X=A−1B=−111[2−5−32][17]=−111[2−35−3+14]=−111[−3311]=[3−1]\begin{aligned} X &= A^{-1}B \\ &= -\frac{1}{11}\begin{bmatrix} 2 & -5 \\ -3 & 2 \end{bmatrix}\begin{bmatrix} 1 \\ 7 \end{bmatrix} \\ &= -\frac{1}{11}\begin{bmatrix} 2 - 35 \\ -3 + 14 \end{bmatrix} \\ &= -\frac{1}{11}\begin{bmatrix} -33 \\ 11 \end{bmatrix} = \begin{bmatrix} 3 \\ -1 \end{bmatrix} \end{aligned}

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

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

The one idea this problem is built on

Two linear equations are one matrix equation AX=BAX = B⁠: the coefficients form AA⁠, the unknowns form XX⁠, the right-hand sides form BB⁠. If ∣A∣≠0|A| \ne 0⁠, then A−1A^{-1} exists, and multiplying both sides by it on the left "undoes" AA⁠: X=A−1BX = A^{-1}B⁠. One matrix multiplication then gives both unknowns at once, and the solution is the only one.

Given, to find, and the plan
Given
2x+5y=12x + 5y = 1 and 3x+2y=73x + 2y = 7⁠.
To find
All pairs (x,y)(x, y) satisfying both equations.
Plan
Write the system as AX=BAX = B⁠; compute ∣A∣|A|⁠; since it is not 0, find A−1A^{-1} and compute X=A−1BX = A^{-1}B⁠; check the answer in both equations.

Basics you need

1Matrix times column

A 2×22\times2 matrix times a 2×12\times1 column is a 2×12\times1 column: each entry is a row of the matrix times the column. Basics: matrix facts the chapter uses

2Inverse of a 2×22\times2 matrix

If ∣A∣=ad−bc≠0|A| = ad - bc \ne 0⁠, then A−1=1∣A∣adj⁡AA^{-1} = \frac{1}{|A|}\operatorname{adj}A⁠, where adj⁡A\operatorname{adj}A swaps the diagonal entries and changes the sign of the other two. Basics: why the inverse divides by |A|

3Two lines in a plane

Each equation is a straight line. Two lines cross in exactly one point, are parallel (no common point), or are the same line (infinitely many). The determinant tells which case we are in. Basics: two lines: cross, parallel or the same

Solution

  1. Write the system as AX=BAX = B

    A=[2532],X=[xy],B=[17].A = \begin{bmatrix} 2 & 5 \\ 3 & 2 \end{bmatrix}, \quad X = \begin{bmatrix} x \\ y \end{bmatrix}, \quad B = \begin{bmatrix} 1 \\ 7 \end{bmatrix}.

    AA is 2×22\times2 and XX is 2×12\times1⁠, so AXAX is defined and is 2×12\times1⁠, the same order as BB⁠. Its entries are

    AX=[2x+5y3x+2y],AX = \begin{bmatrix} 2x + 5y \\ 3x + 2y \end{bmatrix},

    so AX=BAX = B says exactly 2x+5y=12x + 5y = 1 and 3x+2y=73x + 2y = 7⁠.

    Row 1 of AA holds the coefficients of the first equation, 22 and 55⁠, in the same order as the unknowns in XX⁠; row 2 holds 33 and 22⁠. Multiplying out AXAX confirms that nothing was misplaced.
    Section 4.6.1: a system is written as AX=BAX = B⁠. Lesson: solving systems AX = B
  2. Compute ∣A∣|A|

    ∣A∣=∣2532∣=2⋅2−5⋅3=4−15=−11.|A| = \begin{vmatrix} 2 & 5 \\ 3 & 2 \end{vmatrix} = 2\cdot2 - 5\cdot3 = 4 - 15 = -11.

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

    This is Case I of Section 4.6.1. The determinant decides whether the matrix method can be used at all: with ∣A∣=0|A| = 0 there would be no inverse, and the system would have either no solution or infinitely many.
    Case I, Section 4.6.1; Theorem 4, Section 4.5. Basics: two lines: cross, parallel or the same
  3. Find A−1A^{-1}

    The cofactors are A11=2A_{11} = 2⁠, A12=−3A_{12} = -3⁠, A21=−5A_{21} = -5⁠, A22=2A_{22} = 2⁠. Transposing their matrix (equivalently: swap the diagonal 2s, change the signs of 5 and 3):

    adj⁡A=[2−5−32],\operatorname{adj}A = \begin{bmatrix} 2 & -5 \\ -3 & 2 \end{bmatrix}, A−1=−111[2−5−32].A^{-1} = -\frac{1}{11}\begin{bmatrix} 2 & -5 \\ -3 & 2 \end{bmatrix}.
    A−1=1∣A∣adj⁡AA^{-1} = \frac{1}{|A|}\operatorname{adj}A and 1∣A∣=1−11=−111\frac{1}{|A|} = \frac{1}{-11} = -\frac{1}{11}⁠. Keeping the fraction outside the matrix avoids working with elevenths until the very end.
    Theorem 4, Section 4.5; Remark after Example 12. Lesson: inverse of a matrix
  4. Why X=A−1BX = A^{-1}B

    Multiply both sides of AX=BAX = B on the left by A−1A^{-1}⁠:

    A−1(AX)=A−1B(A−1A)X=A−1BIX=A−1BX=A−1B.\begin{aligned} A^{-1}(AX) &= A^{-1}B\\ (A^{-1}A)X &= A^{-1}B\\ IX &= A^{-1}B\\ X &= A^{-1}B. \end{aligned}
    Each line uses one rule: pre-multiplying both sides by the same matrix keeps them equal; the associative law regroups; A−1A=IA^{-1}A = I⁠; and IX=XIX = X⁠. It must be the left side, because XX sits to the right of AA⁠; BA−1BA^{-1} would not even be defined (2×12\times1 times 2×22\times2⁠). Since A−1A^{-1} is unique, so is XX⁠.
    Case I, Section 4.6.1. Lesson: solving systems AX = B
  5. Compute X=A−1BX = A^{-1}B

    X=−111[2−5−32][17].X = -\frac{1}{11}\begin{bmatrix} 2 & -5 \\ -3 & 2 \end{bmatrix}\begin{bmatrix} 1 \\ 7 \end{bmatrix}.

    Row times column:

    row 1: 2⋅1+(−5)⋅7=−33,row 2: (−3)⋅1+2⋅7=11.\begin{aligned} \text{row 1}&: \ 2\cdot1 + (-5)\cdot7 = -33,\\ \text{row 2}&: \ (-3)\cdot1 + 2\cdot7 = 11. \end{aligned} [xy]=−111[−3311]=[3−1].\begin{bmatrix} x \\ y \end{bmatrix} = -\frac{1}{11}\begin{bmatrix} -33 \\ 11 \end{bmatrix} = \begin{bmatrix} 3 \\ -1 \end{bmatrix}.

    Equal matrices have equal entries, so x=3x = 3⁠, y=−1y = -1.

    −111⋅(−33)=3-\frac{1}{11}\cdot(-33) = 3 and −111⋅11=−1-\frac{1}{11}\cdot 11 = -1⁠. Comparing the entries of two equal 2×12\times1 matrices gives one equation per entry.
    Equality of matrices, Chapter 3, Section 3.3.1. Basics: rows, columns and positions
  6. Check in both equations, and AA−1=IAA^{-1} = I

    With x=3x = 3⁠, y=−1y = -1⁠:

    2x+5y=6−5=1,3x+2y=9−2=7.\begin{aligned} 2x + 5y &= 6 - 5 = 1,\\ 3x + 2y &= 9 - 2 = 7. \end{aligned}

    Both equations hold. Also A adj⁡AA\,\operatorname{adj}A should be ∣A∣ I=−11I|A|\,I = -11I⁠:

    (1,1): 2⋅2+5(−3)=−11,(1,2): 2(−5)+5⋅2=0,(2,1): 3⋅2+2(−3)=0,(2,2): 3(−5)+2⋅2=−11,\begin{aligned} (1,1)&: \ 2\cdot2 + 5(-3) = -11,\\ (1,2)&: \ 2(-5) + 5\cdot2 = 0,\\ (2,1)&: \ 3\cdot2 + 2(-3) = 0,\\ (2,2)&: \ 3(-5) + 2\cdot2 = -11, \end{aligned}

    so AA−1=−111(−11I)=IAA^{-1} = -\frac{1}{11}(-11I) = I⁠.

    Substituting into the original equations is the real test of a solution. Checking AA−1=IAA^{-1} = I also confirms the inverse used in Step 5.
  7. The picture: two lines crossing once

    Each equation is a line. Their slopes are −25-\frac{2}{5} and −32-\frac{3}{2}⁠, which differ, so the lines are not parallel and cross at exactly one point, (3,−1)(3, -1)⁠.

    −2 2 3 4 6 −4 −2 −1 2 x y (3, −1) 2x + 5y = 1 3x + 2y = 7
    The blue line 2x+5y=12x + 5y = 1 and the gold line 3x+2y=73x + 2y = 7 (equal scales on both axes) meet only at (3,−1)(3, -1)⁠, the solution found with A−1A^{-1}⁠.
    For two lines a1x+b1y=c1a_1x + b_1y = c_1 and a2x+b2y=c2a_2x + b_2y = c_2⁠, the determinant a1b2−a2b1a_1b_2 - a_2b_1 is 0 exactly when the two lines have the same direction (parallel or identical lines). Here it is −11≠0-11 \ne 0⁠, which is the algebraic way of saying "the lines cross once".
    ∣A∣≠0|A| \ne 0 means a unique solution. Basics: two lines: cross, parallel or the same
Result

With AA having rows 2,52, 5 and 3,23, 2⁠, ∣A∣=−11≠0|A| = -11 \ne 0 and

X=A−1B=−111[−3311]=[3−1].X = A^{-1}B = -\frac{1}{11}\begin{bmatrix} -33 \\ 11 \end{bmatrix} = \begin{bmatrix} 3 \\ -1 \end{bmatrix}.

The unique solution is x=3x = 3⁠, y=−1y = -1. (This agrees with the textbook's own solution.)

Check it with numbers

Elimination gives the same answer independently. Multiply the first equation by 3 and the second by 2: 6x+15y=36x + 15y = 3 and 6x+4y=146x + 4y = 14⁠. Subtracting, 11y=−1111y = -11⁠, so y=−1y = -1⁠; then 2x=1−5y=62x = 1 - 5y = 6 and x=3x = 3⁠.

Common mistakes
  1. Writing X=BA−1X = BA^{-1}⁠. BB is 2×12\times1 and A−1A^{-1} is 2×22\times2⁠, so BA−1BA^{-1} is not even defined. Pre-multiply: X=A−1BX = A^{-1}B⁠.
  2. Losing the sign of 1∣A∣\frac{1}{|A|}⁠. ∣A∣=−11|A| = -11⁠, so the factor is −111-\frac{1}{11}⁠; dropping it gives x=−3x = -3⁠, y=1y = 1⁠, which fails both equations.
  3. Mixing up rows of AA⁠. Row 1 must be the coefficients of the first equation, in the order x,yx, y⁠.
  4. Not checking. Substituting x=3x = 3⁠, y=−1y = -1 back takes seconds and catches every slip.
What to take away
  1. System →AX=B\to AX = B⁠; if ∣A∣≠0|A| \ne 0⁠, the unique solution is X=A−1BX = A^{-1}B⁠.
  2. For two unknowns, ∣A∣≠0|A| \ne 0 means the two lines are not parallel, so they cross once.
  3. Always substitute the answer into the original equations.

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)
2×22\times2 determinant ad−bcad - bcStep 2Section 4.2.2 (Lesson: determinant of a square matrix)
∣A∣≠0|A| \ne 0⁠: unique solution X=A−1BX = A^{-1}BSteps 2, 4Case I, Section 4.6.1
A−1=1∣A∣adj⁡AA^{-1} = \frac{1}{|A|}\operatorname{adj}A⁠; 2×22\times2 adjointStep 3Theorem 4, Section 4.5; Remark after Example 12
Associative law, A−1A=IA^{-1}A = I⁠, IX=XIX = XStep 4Chapter 3, Section 3.4.6 (Basics: matrix facts the chapter uses)
Equal matrices have equal entriesStep 5Chapter 3, Section 3.3.1
A(adj⁡A)=∣A∣ IA(\operatorname{adj}A) = |A|\,IStep 6Theorem 1, Section 4.5
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 →