<meta http-equiv="refresh" content="1; url=/nojavascript/">
You are viewing an older version of this Concept. Go to the latest version.

# Writing and Solving a Matrix Equation for a Linear System

%
Progress
Progress
%
Writing and Solving a Matrix Equation for a Linear System

On Friday, an ice cream shop sold 15 small chocolate cones and 25 X-large chocolate cones. It also sold 20 small vanilla cones and 50 X-large vanilla cones. The shop's chocolate sales for the day totaled $220 and its vanilla sales totaled$410. How much did the shop charge for a small cone versus an X-large cone.

### Watch This

Watch the first half of this video, until about 4:30.

### Guidance

Look at the system:

$3x-5y &= 11\\7x-y &= 15.$

Working backwards, this system can be written as the matrix equation:

$\begin{bmatrix} 3 & -5\\7 & -1 \end{bmatrix} \begin{bmatrix} x\\y \end{bmatrix} = \begin{bmatrix} 11 \\ 15 \end{bmatrix}$ where the variables, $x$ and $y$ are the components of a variable matrix for which we can solve using an inverse as shown:

$\frac{1}{32} \begin{bmatrix} -1 & 5\\-7 & 3 \end{bmatrix}\begin{bmatrix} 3 & -5 \\7 & -1 \end{bmatrix}\begin{bmatrix} x \\y \end{bmatrix} &= \frac{1}{32} \begin{bmatrix} -1 & 5\\-7 & 3 \end{bmatrix}\begin{bmatrix} 11\\15 \end{bmatrix}\\\begin{bmatrix} 1 & 0\\0 & 1 \end{bmatrix} \begin{bmatrix} x\\y \end{bmatrix} &= \frac{1}{32}\begin{bmatrix} 64\\-32 \end{bmatrix}\\\begin{bmatrix} x \\y \end{bmatrix} &= \begin{bmatrix} 2\\-1 \end{bmatrix}$

In general, any system of linear equations in two variables can be written as a matrix equation that can then be solved using inverses. The coefficients of $x$ and $y$ form a $2 \times 2$ matrix and the constants form a $2 \times 1$ matrix as shown below.

$ax+by &= e \quad \Rightarrow \quad \begin{bmatrix} a & b\\c & d \end{bmatrix} \begin{bmatrix} x \\y \end{bmatrix} = \begin{bmatrix} e \\f \end{bmatrix}\\cx+dy &= f$

If we let $A = \begin{bmatrix} a & b \\c & d \end{bmatrix}, \ X= \begin{bmatrix} x \\y \end{bmatrix}$ and $B=\begin{bmatrix} e \\f \end{bmatrix},$ then we could write the equation as $AX=B$ . Now we can see what happens when we multiply both sides by $A^{-1}$ :

$A^{-1} AX &= A^{-1} B\\IX &= A^{-1} B\\X &= A^{-1} B$

So, we can find the matrix, $X$ , by “left multiplying” the matrix, $B$ , by $A^{-1}$ .

#### Example A

Solve the system using matrices: $3x+4y &= -14\\-2x + y &= -9$

Solution: First, let’s translate the system into a matrix equation:

$\begin{bmatrix} 3 & 4 \\-2 & 1 \end{bmatrix} \begin{bmatrix} x \\y \end{bmatrix} = \begin{bmatrix} -14\\-9 \end{bmatrix}$

Now we can “left multiply” both sides by the inverse of the coefficient matrix and solve:

$\begin{bmatrix} x \\y \end{bmatrix} &= \frac{1}{11} \begin{bmatrix} 1 & -4 \\2 & 3 \end{bmatrix} \begin{bmatrix} -14\\-9 \end{bmatrix}\\\begin{bmatrix} x \\y \end{bmatrix} &= \frac{1}{11} \begin{bmatrix} 22\\-55 \end{bmatrix}\\\begin{bmatrix} x \\y \end{bmatrix} &= \begin{bmatrix} 2 \\-5 \end{bmatrix}\\$

Therefore, the solution is (2, -5).

#### Example B

Solve the system using matrices: $-5x-2y &= 1\\3x+y &= -2$

Solution: First, let’s translate the system into a matrix equation:

$\begin{bmatrix} -5 & -2 \\3 & 1 \end{bmatrix} \begin{bmatrix} x \\y \end{bmatrix} = \begin{bmatrix} 1 \\-2 \end{bmatrix}$

Now we can “left multiply” both sides by the inverse of the coefficient matrix and solve:

$\begin{bmatrix} x \\y \end{bmatrix} &= \frac{1}{1} \begin{bmatrix} 1 & 2\\-3 & -5 \end{bmatrix} \begin{bmatrix} 1\\-2 \end{bmatrix}\\\begin{bmatrix} x\\y \end{bmatrix} &= 1 \begin{bmatrix} -3 \\7 \end{bmatrix}\\\begin{bmatrix} x \\ y \end{bmatrix} &= \begin{bmatrix} -3 \\ 7 \end{bmatrix}$

Therefore, the solution is (-3, 7).

#### Example C

Solve the system using matrices: $3x-2y &= 3\\-6x+4y &= 5$

Solution: First, let’s translate the system into a matrix equation:

$\begin{bmatrix} 3 & -2 \\-6 & 4 \end{bmatrix} \begin{bmatrix} x \\y \end{bmatrix} = \begin{bmatrix} 3 \\5 \end{bmatrix}$

What happens this time when we try to find the inverse of the coefficient matrix?

$\frac{1}{0} \begin{bmatrix} 4 & 2 \\6 & 3 \end{bmatrix}$

The inverse does not exist so there is no unique solution to the system. Now we must use an alternative method to determine whether there are infinite solutions or no solution. Let’s use linear combination:

$& \ 2(3x-2y=3) \quad \Rightarrow \ \ \cancel{6x} - 4y = 6\\& -6x+4y = 5 \qquad \quad \underline{- \cancel{6x} +4y = 5 \; \;}\\& \qquad \qquad \qquad \qquad \qquad \qquad \ 0=11$

Therefore, there is no solution.

Intro Problem Revisit The system of equations represented by this situation is

$15x + 25y &= 220\\20x + 50y &= 410$

Solution: First, let’s translate the system into a matrix equation:

$\begin{bmatrix} 15 & 25 \\20 & 50 \end{bmatrix} \begin{bmatrix} x \\y \end{bmatrix} = \begin{bmatrix} 220 \\410 \end{bmatrix}$

Now we can “left multiply” both sides by the inverse of the coefficient matrix and solve:

$\begin{bmatrix} x \\y \end{bmatrix} &= \frac{1}{250} \begin{bmatrix} 50 & -25\\-20 & 15 \end{bmatrix} \begin{bmatrix} 220\\410 \end{bmatrix}\\\begin{bmatrix} x\\y \end{bmatrix} &= \frac{1}{250} \begin{bmatrix} 750 \\750 \end{bmatrix}\\\begin{bmatrix} x \\ y \end{bmatrix} &= \begin{bmatrix} 3 \\ 7 \end{bmatrix}$

Therefore, the shop charges $3 for a small cone and$7 for an X-large cone.

### Guided Practice

Solve the systems using matrices.

1. $2x+y &= -5\\-3x-2y &= 2$

2. $7x-y &= 8\\3y &= 21x-24$

3. $4x+5y &= 5\\-8x+15y &= 5$

1. Translate to a matrix equation and solve.

$\begin{bmatrix} 2 & 1 \\ -3 & -2 \end{bmatrix} \begin{bmatrix} x \\ y \end{bmatrix} &= \begin{bmatrix} -5 \\2\end{bmatrix}\\\begin{bmatrix} x \\y \end{bmatrix} &= \frac{1}{-1} \begin{bmatrix} -2 & -1 \\ 3 & 2 \end{bmatrix} \begin{bmatrix} -5 \\2\end{bmatrix}\\\begin{bmatrix} x \\y \end{bmatrix} &= -1 \begin{bmatrix} 8\\-11 \end{bmatrix} \\\begin{bmatrix} x \\y \end{bmatrix} &= \begin{bmatrix} -8 \\11 \end{bmatrix}$

Therefore, the solution is (-8, 11).

2. First, rewrite the second equation as $-21x+3y=-24$ so the coefficient matrix can be identified.

$\begin{bmatrix} 7 & -1 \\-21 & 3 \end{bmatrix} \begin{bmatrix} x \\y \end{bmatrix} = \begin{bmatrix} 8 \\-24 \end{bmatrix},$

However $\begin{bmatrix} 7 & -1 \\ -21 & 3 \end{bmatrix}^{-1}$ does not exist. Using linear combinations:

$& \quad \ 3(7x-y=8) \quad \Rightarrow \quad \ \cancel{21x} -3y =24\\& -21x +3y =-24 \qquad \ \underline{- \cancel{21x} +3y =-24 \;}\\& \qquad \qquad \qquad \qquad \qquad \qquad \qquad 0=0$

Therefore, there are infinite solutions.

3. Translate to a matrix equation and solve.

$\begin{bmatrix} 4 & 5\\-8 & 15 \end{bmatrix} \begin{bmatrix} x\\y \end{bmatrix} &= \begin{bmatrix} 5\\5 \end{bmatrix}\\\begin{bmatrix} x\\y \end{bmatrix} &= \frac{1}{100} \begin{bmatrix} 15 & -5\\8 & 4 \end{bmatrix} \begin{bmatrix} 5 \\5 \end{bmatrix}\\\begin{bmatrix} x\\y \end{bmatrix} &= \frac{1}{100} \begin{bmatrix} 50\\60 \end{bmatrix}\\\begin{bmatrix} x\\y \end{bmatrix} &= \begin{bmatrix} \frac{1}{2}\\\frac{3}{5} \end{bmatrix}$

Therefore, the solution is $\left( \frac{1}{2} , \frac{3}{5} \right)$ .

### Practice

Solve the systems of linear equations using matrices.

1. .
$2x+13y &= -29\\4x-3y &= 29$

$3x-7y &= 98\\-2x+5y &= -69$

$7x-9y &= 31\\10x+5y &= -45$

$3x-2y &= 1\\7x-5y &= -2$

$3x-5y &= 2\\-9x+15y &= 4$

$4x-3y &= -5\\12x+9y &= -3$

$6x+9y &= -3\\-5x-7y &= -1$

$x+4y &= 7\\-2x &= 8y -14$

$x+y &= 45\\-3x+2y &= -10$

$4x+6y &= 8\\-9y &= 2x-2$

$2x-y &= -30\\x+2y &= 10$

$14x-7y &= -1\\7x+21y &= 10$

$-3x+4y &= 5\\2x-y &= -10$

$6x-12y &= -18\\5x-10y &= -15$

1. Tommy and Max start a lawn care business. They both charge by the hour for mowing and raking leaves. One week Tommy mowed lawns for 10 hours and raked leaves for 6 hours and earned a total of $114. In the same week, Max mowed lawns for 8 hours and raked leaves for 9 hours and earned a total of$118.50. Assuming they both charge the same rates for each of their services, how much do they charge per hour for mowing? For raking leaves?