5. Systems of Linear Equations (2 Variables)
Before you start
- Solve single-variable linear equations using inverse operations
- Substitute numerical values into multi-term expressions accurately
- Read a slope-intercept line and identify slope and y-intercept
- Apply distribution and combine like terms when scaling an equation
By the end you'll be able to
- Solve a 2-variable system using substitution with one variable already isolated
- Solve a 2-variable system using elimination by aligning opposite coefficients
- Classify a system as one solution, no solution, or infinitely many from its row-reduced form
- Compute the determinant of a 2x2 coefficient matrix and interpret its sign
- Translate a 2-equation system into matrix form A x = b
Systems of Linear Equations
A system is two or more equations with the same variables, true simultaneously. Solving a system means finding the variable values that satisfy all equations at once. Geometrically: finding where the lines (or planes, or hyperplanes) intersect.
Two methods, one outcome
The two algebraic methods you’ll use most are substitution and elimination. Both arrive at the same answer; elimination is faster when both equations are in standard form ($ax + by = c$). Substitution is faster when one equation is already solved for a variable.
For the example below, we’ll use elimination because the equations are in standard form.
Worked example
Step 1 — choose a variable to eliminate. We’ll eliminate
Step 2 — scale each equation so the
- Multiply equation 1 by
: - Multiply equation 2 by
:
Critical detail: when you multiply an equation by a constant, you must multiply every term — including the right-hand-side constant. Forgetting to scale the constant is the most common mistake at this step.
Step 3 — add the equations. The
Step 4 — substitute back into either original equation. Using equation 1:
Solution:
Three possible outcomes
Every linear system has exactly one of three outcomes:
- Unique solution. Lines intersect at one point. Most systems are like this.
- No solution. Lines are parallel — they never intersect. Algebraically, you’ll arrive at
a contradiction like
. - Infinitely many solutions. Lines are the same — every point on the line satisfies both
equations. Algebraically, you’ll arrive at
.
Determinant of a 2×2 matrix
For a 2×2 matrix
A 2×2 system has a unique solution exactly when this determinant is nonzero. If
Connection to linear algebra
Solving a system of
has solution
Connection to machine learning
The closed-form solution to linear regression is a system of linear equations solved with matrices:
The matrix
When you see a “singular matrix” error from such a routine, it means your system has no unique solution — the design matrix is rank-deficient, equivalent to the “no solution” or “infinitely many solutions” cases above.
Common mistakes
These are the traps learners hit most often on this topic. Knowing them in advance is half the fix.
Forgetting to scale the right-hand-side constant
When you multiply Equation 1 by 3 to align coefficients, multiply EVERY term — including the constant.
3x + 4y = 10becomes9x + 12y = 30, not9x + 12y = 10.Adding equations when subtraction was needed
To eliminate a variable, the coefficients must be opposite signs. If both equations have
, subtract one from the other (or scale one to first). Solving for one variable and stopping
A 2-variable system needs both
AND . After finding , substitute back into either original equation to find . Don’t deliver half an answer.
Practice problems
Try each on paper first. Click Show solution only after you've made a real attempt.
- Problem 1Solve by substitution:
and . Show solution
Substitute:
. Then . Answer: (3, 6).
- Problem 2Solve by elimination:
and . Show solution
Eliminate y: scale to plus-or-minus 12.
- 9x + 12y = 30.
- 8x - 12y = 4.
- Add: 17x = 34 so x = 2; then y = 1.
Answer: (2, 1).
- Problem 3Solve:
and . Show solution
vs. give . No solution — parallel lines. - Problem 4What does it mean if elimination yields
? Show solution
The two equations are equivalent. Infinitely many solutions, often written
. - Problem 5Solve:
and . Show solution
From Eq1,
. Sub: , . Answer: (1, 3).
- Problem 6Compute the determinant of
. Show solution
. - Problem 7Translate this system to matrix form:
, . Show solution
Practice quiz
- Question 1Solve by substitution: y = 2x and x + y = 9
- Question 2Solve by elimination: x + y = 5; x − y = 1
- Question 3If a system has parallel lines, the system has:
- Question 4If two equations describe the same line, the system has:
- Question 5Solve: 3x + y = 7 and 2x - y = 3. Give as (x, y).
- Question 6Solve: 2x + 3y = 12; x = y + 1. Give as (x, y).
- Question 7What’s the determinant of the matrix [[3, 4], [2, -3]]? (Just the number.)
- Question 8Geometrically, the solution to a 2-variable system is:
- Question 9Closed-form linear regression is essentially:
- Reflection 10What does a zero determinant tell you about a 2x2 system?
Week 5 recap
You solved 2-variable systems by substitution and elimination, classified the three possible outcomes (one solution, none, or infinitely many), and previewed how matrix determinants encode that classification numerically. Three trap families fell: the scale-the-constant trap (forgetting to multiply the right-hand side when scaling an equation), the wrong-operation trap (adding when subtraction was needed because coefficients had the same sign), and the half-solution trap (stopping after one variable). Each outcome supports later coursework: substitution generalizes to back-substitution in upper-triangular form; elimination generalizes to row reduction; classification by determinant becomes the singular-matrix test that protects numerical code from divide-by-zero failures. Closed-form linear regression is the same operation scaled to many features.
Coming next: Week 6 — Systems of 3 Variables & Intro to Matrices
Next week scales to three variables and introduces matrices as the compact bookkeeping device. You will execute Gaussian elimination by hand on a 3-variable system, recognize the three legal row operations (swap, scale, add multiple), and meet the identity matrix as the multiplicative identity for matrix algebra. The pattern generalizes directly to the algorithm that every linear-algebra library uses internally for solving systems of any size.
Saved in your browser only — no account, no server.