MathPicBot owl mascot MathPicBot
ALGEBRA · 6 MIN READ

How to solve a system of linear equations, step by step

Two equations, two unknowns. Substitution and elimination both get you there. This guide shows when each is faster, with examples you can follow.

By the MathPicBot team · Updated July 2026

A system of linear equations is two or more equations that share the same unknowns. Solving it means finding the values that make every equation true at once. For two equations in xx and yy, that pair is the point where the two lines cross.

Method 1: Substitution

Substitution works best when one equation already has a variable on its own, or is easy to rearrange into that form. You solve one equation for a variable, then put that expression into the other.

WORKED EXAMPLE
{y=2x+13x+y=11\begin{cases} y = 2x + 1 \\ 3x + y = 11 \end{cases}
1. The first equation already gives yy, so replace yy in the second: 3x+(2x+1)=113x + (2x + 1) = 11.
2. Combine and solve: 5x+1=115x + 1 = 11, so 5x=105x = 10 and x=2x = 2.
3. Put x=2x = 2 back into y=2x+1y = 2x + 1 to get y=5y = 5.
ANSWER
x=2, y=5x = 2,\ y = 5

Method 2: Elimination

Elimination shines when the variables line up in columns. You add or subtract the equations so one variable cancels, then solve for the other. Scale an equation first if the coefficients do not match.

WORKED EXAMPLE
{3x+2y=162x2y=4\begin{cases} 3x + 2y = 16 \\ 2x - 2y = 4 \end{cases}
1. The yy terms are already opposite in size, so add the equations: (3x+2y)+(2x2y)=16+4(3x + 2y) + (2x - 2y) = 16 + 4.
2. That leaves 5x=205x = 20, so x=4x = 4.
3. Substitute into 2x2y=42x - 2y = 4: 82y=48 - 2y = 4, so y=2y = 2.
ANSWER
x=4, y=2x = 4,\ y = 2
MathPicBot owl
Two equations giving you trouble?
Photograph the system and MathPicBot solves it step by step.
Solve it now →

Which method should you use?

No solution or infinitely many

Not every system has one neat answer. If your steps collapse to something false like 0=50 = 5, the lines are parallel and there is no solution. If they collapse to something always true like 0=00 = 0, the two equations describe the same line and there are infinitely many solutions.

Check any solution by putting the pair back into both original equations. If both hold, you are done.