Systems and Elimination

Solve linear systems with equations, row operations, and matrix notation.

A system of linear equations asks for values that satisfy several linear conditions at the same time. In two variables, each equation is a line. Solving the system means finding where the lines intersect.

Linear algebra writes systems compactly as

\[ A\mathbf{x}=\mathbf{b}. \]

Here \(A\) is the coefficient matrix, \(\mathbf{x}\) is the vector of unknowns, and \(\mathbf{b}\) is the right-hand-side vector.

What you should be able to do

By the end of this lesson, you should be able to:

  • write a small system as \(A\mathbf{x}=\mathbf{b}\);
  • solve two equations by elimination;
  • explain why row operations preserve solutions;
  • classify systems as one solution, no solution, or infinitely many solutions;
  • check a proposed solution by substitution;
  • use SymPy to solve and row-reduce systems.

Matrix notation for systems

The system

\[ \begin{aligned} x+y &= 5,\\ x-y &= 1 \end{aligned} \]

can be written as

\[ \underbrace{\begin{bmatrix}1&1\\1&-1\end{bmatrix}}_{A} \underbrace{\begin{bmatrix}x\\y\end{bmatrix}}_{\mathbf{x}} = \underbrace{\begin{bmatrix}5\\1\end{bmatrix}}_{\mathbf{b}}. \]

The first row of \(A\) stores the coefficients in the first equation. The second row stores the coefficients in the second equation.

Worked example: one solution

Solve

\[ \begin{aligned} x+y &= 5,\\ x-y &= 1. \end{aligned} \]

Add the two equations:

\[ (x+y)+(x-y)=5+1. \]

This gives \(2x=6\), so \(x=3\). Substitute into \(x+y=5\):

\[ 3+y=5 \quad \Rightarrow \quad y=2. \]

The solution is \((x,y)=(3,2)\). Check it:

\[ 3+2=5, \qquad 3-2=1. \]

Three possible outcomes

One solution

Two nonparallel lines intersect at one point. Algebraically, the equations are independent enough to determine one vector.

No solution

Parallel distinct lines never meet. Algebraically, elimination may produce an impossible statement such as

\[ 0=5. \]

Infinitely many solutions

The two equations describe the same line. Elimination may produce

\[ 0=0. \]

This means one equation was redundant, not that every point in the plane is a solution. The solution set is the whole line described by the remaining equation.

WarningCommon pitfall

The statement \(0=0\) does not mean “the answer is zero.” It means the equation added no new restriction. You must describe the remaining free variable or line of solutions.

Practice exercises

  1. Write \(2x-y=3\) and \(4x+5y=7\) as \(A\mathbf{x}=\mathbf{b}\).
  2. Solve \(x+y=5\) and \(x-y=1\).
  3. Classify \(x+y=2\) and \(2x+2y=4\).
  4. Classify \(x+y=2\) and \(x+y=5\).
  5. Check whether \((1,2)\) solves \(2x+y=4\) and \(x-y=-1\).
  1. \(A=\begin{bmatrix}2&-1\\4&5\end{bmatrix}\), \(\mathbf{x}=\begin{bmatrix}x\\y\end{bmatrix}\), and \(\mathbf{b}=\begin{bmatrix}3\\7\end{bmatrix}\).
  2. \((x,y)=(3,2)\).
  3. Infinitely many solutions. The second equation is twice the first.
  4. No solution. The same left side cannot equal both 2 and 5.
  5. Yes. \(2(1)+2=4\) and \(1-2=-1\).

Subtopic guided practice and checkpoints

Solving a linear system means keeping the solution set unchanged while making the equations easier to read.

Lab 1: translate equations into \(A\mathbf{x}=\mathbf{b}\)

Guess first. In \(A\mathbf{x}=\mathbf{b}\), where do the unknowns go?

Guided exercise.

For

\[ \begin{aligned} 2x+y&=8,\\ -x+3y&=7, \end{aligned} \]

write

\[ A=\begin{bmatrix}2&1\\-1&3\end{bmatrix}, \qquad \mathbf{x}=\begin{bmatrix}x\\y\end{bmatrix}, \qquad \mathbf{b}=\begin{bmatrix}8\\7\end{bmatrix}. \]

The unknowns are collected in the vector \(\mathbf{x}\). The coefficients belong in \(A\), and the constants belong in \(\mathbf{b}\).

Checkpoint. Write \(3x-2y=1\) and \(5x+y=9\) as \(A\mathbf{x}=\mathbf{b}\).

Lab 2: eliminate one variable step by step

Guess first. For \(x+y=6\) and \(x-y=2\), should adding the equations eliminate \(x\) or \(y\)?

Guided exercise.

Solve

\[ \begin{aligned} x+y&=6,\\ x-y&=2. \end{aligned} \]

Add the equations:

\[ (x+y)+(x-y)=6+2. \]

The \(y\) terms cancel, so

\[ 2x=8 \quad \Rightarrow \quad x=4. \]

Substitute into the first equation:

\[ 4+y=6 \quad \Rightarrow \quad y=2. \]

The solution is \((4,2)\).

Checkpoint. Solve \(x+y=9\) and \(x-y=3\) using the same add-the-equations strategy.

Lab 3: check a solution by substitution

Guess first. If a point satisfies only one equation in a two-equation system, is it a solution of the system?

Guided exercise.

Check whether \((2,3)\) solves

\[ \begin{aligned} x+y&=5,\\ 2x-y&=1. \end{aligned} \]

Substitute into both equations:

\[ 2+3=5 \quad \text{true}, \]

and

\[ 2(2)-3=1 \quad \text{true}. \]

Both equations are true, so \((2,3)\) is a solution.

Checkpoint. Check whether \((1,4)\) solves \(x+y=5\) and \(2x-y=1\).

Lab 4: classify the outcome after elimination

Guess first. What does \(0=7\) mean in a system-solving problem?

Guided exercise.

Consider

\[ \begin{aligned} x+y&=3,\\ 2x+2y&=10. \end{aligned} \]

Twice the first equation gives \(2x+2y=6\), but the second equation says \(2x+2y=10\). These cannot both be true. Elimination would produce an impossible statement such as \(0=4\), so the system has no solution.

Checkpoint. Classify \(x+y=4\) and \(2x+2y=8\). Explain why the answer is not “one solution.”

Lab 5: describe infinitely many solutions carefully

Guess first. If two equations describe the same line, does every point in the plane solve the system?

Guided exercise.

For

\[ x+y=4, \qquad 2x+2y=8, \]

the second equation is twice the first. The system has infinitely many solutions, but only on the line \(x+y=4\). One way to describe them is

\[ (x,y)=(t,4-t) \]

for any real number \(t\).

Checkpoint. Describe the solutions of \(x-y=1\) and \(2x-2y=2\) using a parameter.

  1. \(A=\begin{bmatrix}3&-2\\5&1\end{bmatrix}\), \(\mathbf{x}=\begin{bmatrix}x\\y\end{bmatrix}\), and \(\mathbf{b}=\begin{bmatrix}1\\9\end{bmatrix}\).
  2. Adding gives \(2x=12\), so \(x=6\). Then \(6+y=9\), so \(y=3\).
  3. \((1,4)\) satisfies \(x+y=5\), but \(2(1)-4=-2\), not \(1\), so it is not a solution.
  4. The equations describe the same line, so there are infinitely many solutions, not one solution.
  5. Let \(y=t\). Then \(x=t+1\), so the solutions are \((t+1,t)\) for any real number \(t\).

Systems guessing game

Use this checkpoint to practice classification, substitution, and elimination moves.

Using this lesson with edumath and SymPy

Use computation to check your elimination work. SymPy can solve systems exactly and show row-reduced forms.

from edumath.linear_algebra import solve_linear_system, validate_solution_vector

A = [[1, 1], [1, -1]]
b = [5, 1]
solution = solve_linear_system(A, b)
print(solution)
print(validate_solution_vector(solution, A, b).message)
[3. 2.]
Correct.
import sympy as sp

A = sp.Matrix([[1, 1], [1, -1]])
b = sp.Matrix([5, 1])
print(A.LUsolve(b))
print(A.row_join(b).rref())
Matrix([[3], [2]])
(Matrix([
[1, 0, 3],
[0, 1, 2]]), (0, 1))