Topic · Algebra

Systems of Linear Equations

Two or more linear equations bundled together, sharing the same unknowns. A single linear equation in two variables describes a whole line of solutions; a system asks which point — if any — sits on every line at once.

What you'll leave with

  • What a system of linear equations is, and what counts as a solution.
  • The three — and only three — outcomes any two-line system can have.
  • Three solving methods (substitution, elimination, graphing) and when to reach for each.
  • A geometric instinct: a "system" is really the question "where do these lines meet?"

1. What is a system of linear equations

System of linear equations

A finite collection of linear equations sharing the same variables. A solution is an assignment of values to those variables that makes every equation true simultaneously — not just one, not most, all of them.

A single linear equation in two variables, like $2x + 3y = 12$, has infinitely many solutions: every point on its line. That's usually too much freedom. A system pins things down by adding a second constraint. The classic example:

$$ \begin{aligned} 2x + 3y &= 12 \\ x - y &= 1 \end{aligned} $$

Each equation by itself is a line. The pair $(x, y) = (3, 2)$ satisfies both: $2(3) + 3(2) = 12$ ✓, and $3 - 2 = 1$ ✓. It's the only point that does. Geometrically, it's where the two lines cross.

Vocabulary

A system is consistent if it has at least one solution, inconsistent if it has none. A consistent system is independent if the solution is unique and dependent if there are infinitely many. Those three labels cover every case.

2. Three possible outcomes

Two lines in the plane can do exactly three things. Each corresponds to a different kind of solution set — and crucially, you can tell which case you're in from the equations alone, before solving.

Case 1 · Consistent & independent
One solution

Two lines with different slopes cross at exactly one point. The system has a unique solution $(x, y)$.

Case 2 · Inconsistent
No solution

Same slope, different intercepts — the lines run parallel and never meet. No pair $(x, y)$ can satisfy both equations.

Case 3 · Consistent & dependent
Infinitely many

The two equations describe the same line in disguise — same slope, same intercept. Every point on that line is a solution.

When you rearrange both equations into slope-intercept form $y = mx + b$:

SlopesInterceptsOutcome
Different ($m_1 \neq m_2$)AnythingOne solution
Same ($m_1 = m_2$)Different ($b_1 \neq b_2$)No solution
Same ($m_1 = m_2$)Same ($b_1 = b_2$)Infinitely many
Why this matters

If you're about to spend two minutes solving a system, take ten seconds first to check the slopes. If they match, you already know the answer is "no solution" or "infinitely many" — and which one tells you whether the algebra will produce a contradiction or a tautology.

3. Three ways to solve

Three standard methods. They give the same answer when one exists — the difference is which form of the equations they prefer, and how much paper they use.

Idea. Solve one equation for one variable, then plug that expression into the other. You collapse a two-variable problem into a one-variable problem — which you already know how to handle.

  1. Pick the easiest equation and isolate one variable (say $y$).
  2. Substitute the resulting expression for $y$ into the other equation. Now everything is in $x$.
  3. Solve that one-variable equation for $x$.
  4. Substitute the $x$-value back into the isolated expression to get $y$.

Best when one equation already has a variable with coefficient $\pm 1$ — isolation is free.

Idea. Scale the two equations so that one variable has equal-and-opposite coefficients, then add them. That variable cancels and you're left with one equation in one unknown.

  1. Decide which variable to eliminate. Multiply each equation by a constant chosen to make that variable's coefficients opposites.
  2. Add the two equations. The chosen variable vanishes.
  3. Solve for the remaining variable.
  4. Substitute back into either original equation to recover the other.

Best when equations are already in standard form $Ax + By = C$, and especially when coefficients line up neatly (e.g. $3y$ and $-3y$ already cancel).

Idea. Plot both lines on the same axes; the intersection point is the solution.

  1. Rewrite each equation in slope-intercept form $y = mx + b$.
  2. Plot each line — y-intercept first, then walk by the slope.
  3. Read off the intersection.

Best when you want intuition or a quick sanity check. Worst when the answer involves fractions or large coordinates — graphical precision rarely beats two lines of algebra.

4. The same system, solved three ways

To see how the methods differ in practice, work the same system through all three. Take:

$$ \begin{aligned} 2x + 3y &= 12 \\ x - y &= 1 \end{aligned} $$

By substitution

The second equation has $x$ with coefficient $1$ — isolate it:

$$ x = 1 + y $$

Substitute into the first:

$$ 2(1 + y) + 3y = 12 \;\Longrightarrow\; 2 + 2y + 3y = 12 \;\Longrightarrow\; 5y = 10 \;\Longrightarrow\; y = 2 $$

Then $x = 1 + 2 = 3$. Solution: $(3, 2)$.

By elimination

Both equations in standard form. To eliminate $y$, multiply the second equation by $3$ so its $y$-coefficient becomes $-3$:

$$ \begin{aligned} 2x + 3y &= 12 \\ 3x - 3y &= 3 \end{aligned} $$

Add the two:

$$ 5x = 15 \;\Longrightarrow\; x = 3 $$

Substitute back into $x - y = 1$: $3 - y = 1$, so $y = 2$. Solution: $(3, 2)$.

By graphing

Rewrite each in slope-intercept form:

$$ \begin{aligned} y &= -\tfrac{2}{3}x + 4 \\ y &= x - 1 \end{aligned} $$

The first line starts at $(0, 4)$ and slopes down by $\tfrac{2}{3}$. The second starts at $(0, -1)$ and rises at slope $1$. They cross — visibly — at $(3, 2)$.

x y y = −(2/3)x + 4 y = x − 1 (3, 2) the unique solution −10 −8 −6 −4 −2 2 4 6 8 10 6 4 2 −2 −4 −6

5. Playground: two lines and their intersection

Tune the slope and intercept of each line. Watch the intersection move — or vanish — in real time. Try to find the slope-and-intercept combinations that produce each of the three outcomes.

L1: y = 1.0x + 2.0
L2: y = −1.0x + 4.0
One solution
at (1.00, 3.00)
1.0
2.0
−1.0
4.0
x y
Try it

Set both slopes to the same value and watch the intersection point fly off to infinity, then flicker off entirely when the lines become exactly parallel. Now match the intercepts too — the verdict switches from "no solution" to "infinitely many," because the two lines have quietly become one. The three cases aren't arbitrary categories; they're the three things the algebra can say.

6. Beyond two equations

Nothing here is special to two variables. A linear equation in three variables, like $x + 2y - z = 4$, describes a flat plane in 3-D space. A system of three such equations asks where three planes meet — usually at a single point, sometimes along a line, sometimes nowhere, sometimes everywhere on a shared plane.

The same three outcomes — one solution, none, infinitely many — survive in every dimension. What changes is the bookkeeping. Substitution and elimination still work, but with $n$ variables they get tedious. That's where matrices come in: a system can be written compactly as $A\mathbf{x} = \mathbf{b}$, and a procedure called Gaussian elimination is just the elimination method made mechanical. The system from §4, for instance, becomes:

$$ \underbrace{\begin{bmatrix} 2 & 3 \\ 1 & -1 \end{bmatrix}}_{A} \underbrace{\begin{bmatrix} x \\ y \end{bmatrix}}_{\mathbf{x}} = \underbrace{\begin{bmatrix} 12 \\ 1 \end{bmatrix}}_{\mathbf{b}} $$

Linear algebra picks up the story from here. You don't need any of it yet — but knowing the path exists makes it easier to take a second equation seriously: it's not a hassle, it's the start of a structure that goes a long way.

7. Common pitfalls

Solving for one variable and stopping

The solution is an ordered pair $(x, y)$, not a single number. After elimination gives you $x = 3$, you still have to substitute back to find $y$. Quoting "the solution is $x = 3$" loses half the answer.

Elimination sign errors when subtracting

When subtracting one equation from another, every term on the subtracted side flips sign — including the right-hand side. Forgetting one negative is the most common bug in elimination. Two safer habits: always multiply by $-1$ explicitly and add, or write the subtraction term-by-term in a column.

Substituting into the equation you just used

After isolating $y$ from equation A, substitute that expression into equation B, not back into A. Substituting into A is harmless — it just collapses to $0 = 0$ — but it gives you no new information, and feels like progress until you realize you're stuck.

Misreading "0 = 0" and "0 = 5"

When all variables vanish during solving, the leftover equation tells you which case you're in. $0 = 0$ is a tautology — it's always true — so every point on the (single) line is a solution: infinitely many. $0 = 5$ (or any nonzero constant) is a contradiction — it's never true — so the system has no solution. These two outcomes look identical on paper for a moment; read them carefully.

8. Worked examples

Try each before opening the solution. Notice which method you reach for — and whether a different one would have been easier.

Example 1 · Solve by substitution: $\;2x + y = 7,\; x - y = 2$

Step 1. From the second equation: $x = y + 2$.

Step 2. Substitute into the first:

$$ 2(y + 2) + y = 7 \;\Longrightarrow\; 3y + 4 = 7 \;\Longrightarrow\; y = 1 $$

Step 3. Then $x = 1 + 2 = 3$.

Check. $2(3) + 1 = 7$ ✓ and $3 - 1 = 2$ ✓. Solution: $(3, 1)$.

Example 2 · Solve by elimination: $\;3x + 2y = 16,\; 5x - 2y = 0$

Step 1. The $y$-coefficients are already opposites ($+2$ and $-2$). Add the two equations:

$$ 8x = 16 \;\Longrightarrow\; x = 2 $$

Step 2. Substitute into either equation. Using $5x - 2y = 0$: $10 - 2y = 0$, so $y = 5$.

Check. $3(2) + 2(5) = 16$ ✓ and $5(2) - 2(5) = 0$ ✓. Solution: $(2, 5)$.

Example 3 · Classify: $\;2x - 4y = 6,\; x - 2y = 3$

Divide the first equation by $2$: $x - 2y = 3$. That's identical to the second equation.

The two equations are the same line in disguise. The system is consistent and dependent — there are infinitely many solutions, namely every point satisfying $x - 2y = 3$, which can be written as $\{(2t + 3, t) : t \in \mathbb{R}\}$.

Example 4 · Classify: $\;y = 2x + 1,\; y = 2x - 3$

Both lines have slope $2$ but different intercepts ($1$ versus $-3$). They're parallel and never meet.

The system is inconsistent: no solution. As a sanity check, subtract the equations: $0 = 4$, which is impossible.

Example 5 · Word problem: two coffees and three pastries

At a café, two coffees and three pastries cost $\$13$. One coffee and four pastries cost $\$12$. Find the price of each.

Step 1. Let $c$ be the price of a coffee and $p$ the price of a pastry. The two facts translate to:

$$ \begin{aligned} 2c + 3p &= 13 \\ c + 4p &= 12 \end{aligned} $$

Step 2. Multiply the second equation by $2$, then subtract from the first to eliminate $c$:

$$ 2c + 3p - (2c + 8p) = 13 - 24 \;\Longrightarrow\; -5p = -11 \;\Longrightarrow\; p = 2.20 $$

Step 3. Substitute back: $c + 4(2.20) = 12$, so $c = 12 - 8.80 = 3.20$.

Check. $2(3.20) + 3(2.20) = 6.40 + 6.60 = 13$ ✓ and $3.20 + 4(2.20) = 12$ ✓. Coffee is $\$3.20$; a pastry is $\$2.20$.

Sources & further reading

The material above draws on established references in algebra and elementary linear algebra. When this page has done its job, the links below are where to go for more rigor, more drill, or more visual intuition.

Test your understanding

A quiz that builds from easy to hard. Pick an answer to get instant feedback and a worked explanation. Your progress is saved in this browser — come back anytime to continue.

Question 1 of 24
0 correct