Math Core

Lesson 9.1 · Systems and Matrices

Systems of equations

Many real questions come with several unknowns and several facts that tie them together: two prices and two receipts, three currents in a circuit, the three coefficients of a parabola through three points. A system of equations packages those facts so you can solve for every unknown at once. This lesson reviews substitution and elimination, then organizes elimination into a step-by-step procedure on a grid of numbers, the augmented matrix, which is the doorway to the rest of this unit.

What a solution means

A solution of a system is an assignment of values to the variables that makes every equation true at the same time. For two linear equations in xx and yy, each equation is a line, and a solution is a point on both lines. That geometry tells you exactly what can happen.

Three possible outcomes for a linear system

A system of linear equations has either

  • exactly one solution (the lines, or planes, meet in a single point),
  • no solution (the system is inconsistent; for two lines, they are parallel), or
  • infinitely many solutions (the system is dependent; for two lines, they are the same line).

A linear system can never have exactly two or exactly five solutions.

The same three outcomes hold for three equations in xx, yy and zz, where each equation describes a plane in space.

Substitution and elimination

Substitution works well when one variable is already isolated or has coefficient 11: solve one equation for that variable and substitute the expression into the others.

Elimination adds a multiple of one equation to another so that a variable cancels. Adding equations is legal because if P=QP = Q and R=SR = S are both true, then P+R=Q+SP + R = Q + S is true too, and no solutions are gained or lost.

Worked example: Elimination with two variables

Solve the system

3x+2y=165x−4y=12\begin{aligned} 3x + 2y &= 16 \\ 5x - 4y &= 12 \end{aligned}

Multiply the first equation by 22 so the yy-coefficients are opposites: 6x+4y=326x + 4y = 32. Add it to the second equation:

(6x+4y)+(5x−4y)=32+12⟹11x=44⟹x=4.(6x + 4y) + (5x - 4y) = 32 + 12 \quad\Longrightarrow\quad 11x = 44 \quad\Longrightarrow\quad x = 4.

Substitute into the first equation: 3(4)+2y=163(4) + 2y = 16, so 2y=42y = 4 and y=2y = 2.

Check in the second equation: 5(4)−4(2)=20−8=125(4) - 4(2) = 20 - 8 = 12. The solution is (4,2)(4, 2).

If elimination wipes out both variables, look at what is left. A false statement such as 0=70 = 7 means the system is inconsistent. A true statement such as 0=00 = 0 means one equation was a multiple of the other, so the system is dependent. For example, 2x−3y=42x - 3y = 4 and −4x+6y=−8-4x + 6y = -8 are the same line (multiply the first by −2-2), so every point on that line is a solution. Change the second equation to −4x+6y=1-4x + 6y = 1 and the lines become parallel: adding twice the first equation gives 0=90 = 9, so there is no solution.

Augmented matrices and row operations

With three or more variables, writing xx, yy and zz over and over is clutter. The only things that matter are the coefficients and the constants, so line them up in a rectangular array.

Definition

Augmented matrix

The augmented matrix of a linear system has one row per equation. Each column holds the coefficients of one variable, and the last column (set off by a bar) holds the constants. For example,

x+y+z=62x−y+z=3x+2y−z=2⟷[11162−11312−12]\begin{aligned} x + y + z &= 6 \\ 2x - y + z &= 3 \\ x + 2y - z &= 2 \end{aligned} \qquad\longleftrightarrow\qquad \left[\begin{array}{ccc|c} 1 & 1 & 1 & 6 \\ 2 & -1 & 1 & 3 \\ 1 & 2 & -1 & 2 \end{array}\right]

The moves you make in elimination become three elementary row operations, none of which changes the solution set:

  1. Swap two rows.
  2. Multiply a row by a nonzero constant.
  3. Add a multiple of one row to another row.

The goal of Gaussian elimination is row-echelon form: a staircase shape with zeros below each leading entry. Once there, the last row gives one variable directly, and you back-substitute upward.

Worked example: Gaussian elimination with three variables

Solve the system in the definition above.

Clear the first column below the top entry with R2−2R1R_2 - 2R_1 and R3−R1R_3 - R_1:

[11160−3−1−901−2−4]\left[\begin{array}{ccc|c} 1 & 1 & 1 & 6 \\ 0 & -3 & -1 & -9 \\ 0 & 1 & -2 & -4 \end{array}\right]

Swap R2R_2 and R3R_3 so the pivot is a 11, then do R3+3R2R_3 + 3R_2:

[111601−2−400−7−21]\left[\begin{array}{ccc|c} 1 & 1 & 1 & 6 \\ 0 & 1 & -2 & -4 \\ 0 & 0 & -7 & -21 \end{array}\right]

This is row-echelon form. Read the rows from the bottom up:

−7z=−21⟹z=3y−2(3)=−4⟹y=2x+2+3=6⟹x=1\begin{aligned} -7z &= -21 &&\Longrightarrow z = 3 \\ y - 2(3) &= -4 &&\Longrightarrow y = 2 \\ x + 2 + 3 &= 6 &&\Longrightarrow x = 1 \end{aligned}

The solution is (1,2,3)(1, 2, 3). Check in the original third equation: 1+2(2)−3=21 + 2(2) - 3 = 2. ✓

Common mistake

When you apply a row operation, apply it to the whole row, including the constant after the bar. Forgetting the last column is the most common arithmetic slip in Gaussian elimination, and it produces a wrong answer that looks perfectly reasonable. Always check your final answer in an original equation.

If a row reduces to [000c]\left[\begin{array}{ccc|c} 0 & 0 & 0 & c \end{array}\right] with c≠0c \ne 0, that row says 0=c0 = c, and the system has no solution. If a row becomes all zeros and no contradiction appears, the system has infinitely many solutions (at least one variable is free).

Nonlinear systems

When one of the equations is not linear (a circle, a parabola, a hyperbola), row operations no longer apply, but substitution still does. Now the number of solutions can be 00, 11, 22, 33, 44 or more, depending on how the curves cross.

Worked example: A line and a circle

Solve the system x2+y2=25x^2 + y^2 = 25 and y=x+1y = x + 1.

Substitute y=x+1y = x + 1 into the circle:

x2+(x+1)2=252x2+2x+1=25x2+x−12=0(x+4)(x−3)=0\begin{aligned} x^2 + (x + 1)^2 &= 25 \\ 2x^2 + 2x + 1 &= 25 \\ x^2 + x - 12 &= 0 \\ (x + 4)(x - 3) &= 0 \end{aligned}

So x=3x = 3 or x=−4x = -4. Use the linear equation to find each yy: y=4y = 4 or y=−3y = -3. The solutions are (3,4)(3, 4) and (−4,−3)(-4, -3).

The line crosses the circle at two points.Open in grapher →

Tip

After finding xx in a nonlinear system, substitute back into the simpler equation (often the linear one). Substituting into x2+y2=25x^2 + y^2 = 25 would give y=±4y = \pm 4 and tempt you to include false points such as (3,−4)(3, -4), which is not on the line.

Practice

Practice 1

Solve the system x+y=10x + y = 10 and x−y=4x - y = 4.

Enter a point like (2, -3)

Practice 2

Solve the system 2x+3y=72x + 3y = 7 and 4x−y=−74x - y = -7.

Enter a point like (2, -3)

Practice 3

How many solutions does the system 3x−6y=93x - 6y = 9 and x−2y=4x - 2y = 4 have?

Practice 4

A system has been reduced to this row-echelon form. Find the solution (x,y,z)(x, y, z).

[12−13014100012]\left[\begin{array}{ccc|c} 1 & 2 & -1 & 3 \\ 0 & 1 & 4 & 10 \\ 0 & 0 & 1 & 2 \end{array}\right]

Enter a point like (2, -3)

Practice 5

Solve the system.

x+y+z=2x−y+2z=92x+y−z=−3\begin{aligned} x + y + z &= 2 \\ x - y + 2z &= 9 \\ 2x + y - z &= -3 \end{aligned}

Enter a point like (2, -3)

Practice 6

The parabola y=x2−2xy = x^2 - 2x and the line y=x+4y = x + 4 intersect at two points. Find the xx-coordinates of both points.

Separate answers with commas, e.g. 2, -5

Practice 7

A theater sold 150 tickets for a total of $1,400. Adult tickets cost $12 and student tickets cost $7. How many adult tickets were sold?

Enter a number. Fractions like 3/4 and sqrt(2) are OK.

Practice 8

The parabola y=ax2+bx+cy = ax^2 + bx + c passes through (1,2)(1, 2), (2,7)(2, 7) and (−1,4)(-1, 4). Find (a,b,c)(a, b, c).

Enter a point like (2, -3)