Lines and Linear Equations

Solving a System of Equations by Graphing

A system of equations is a set of equations that must all be true at the same time. To solve two linear equations by graphing, graph both lines: the point where they cross is the solution. If the lines are parallel there is no solution, and if they are the same line there are infinitely many solutions.

Lines y = 2x − 1 and y = −x + 5 crossing at the solution (2, 3).

Check it yourself: every example here can be loaded into the Slope Intercept Form Calculator.

Open the Slope Intercept Form Calculator

What “solving a system” means

A system of equations is two or more equations with the same variables. A solution is a pair (x, y) that makes every equation true at once.

Each linear equation graphs as a line made of all the points that satisfy it. A point that satisfies both equations must lie on both lines — it is where they intersect.

Solving by graphing, step by step

Solve the system y = 2x − 1 and y = −x + 5.

  1. Graph the first line. y-intercept (0, −1), slope 2.
  2. Graph the second line on the same axes. y-intercept (0, 5), slope −1.
  3. Find the intersection. The lines cross at (2, 3).
  4. Check in both equations.
    • 2(2) − 1 = 3 ✓
    • −(2) + 5 = 3 ✓

The solution is x = 2, y = 3.

Try it in the calculator

The three cases

Three panels. Left: y = x + 1 and y = −x + 3 cross once at (1, 2). Middle: y = 2x + 1 and y = 2x − 2 are parallel with no intersection. Right: y = 0.5x + 1 and 2y = x + 2 are the same line.
Different slopes: one solution. Same slope, different intercept: none. Same line: infinitely many.
Text description of this figure

Three panels. Left: y = x + 1 and y = −x + 3 cross once at (1, 2). Middle: y = 2x + 1 and y = 2x − 2 are parallel with no intersection. Right: y = 0.5x + 1 and 2y = x + 2 are the same line.

  1. Graph both equations on the same axes.
  2. Read the intersection point and check it in both equations.
  3. Parallel lines: no solution. Same line: infinitely many.
Slopes Intercepts Graph Number of solutions
different any lines cross once exactly one
equal different parallel lines none
equal equal same line infinitely many

You can predict the case before graphing by writing both equations in slope-intercept form and comparing m and b. See parallel and perpendicular lines for the slope rules.

Example with standard form

Solve x + 2y = 8 and 3x − y = 3.

  1. Rewrite: y = −½x + 4 and y = 3x − 3.
  2. Graph both. They cross at (2, 3).
  3. Check: 2 + 2(3) = 8 ✓ and 3(2) − 3 = 3 ✓.

The graphing calculator accepts standard form directly — type x + 2y = 8 — and marks the intersection for you.

Try it in the calculator

When the answer is not a whole number

Solve y = x + 1 and y = −2x + 3. The lines cross between grid lines, near (0.67, 1.67). Graphing shows where to look; algebra gives the exact value. Setting x + 1 = −2x + 3 gives 3x = 2, so x = 2⁄3 and y = 5⁄3. The calculator’s intersection readout (0.6667, 1.667) agrees, and the slope intercept form calculator reports it as an exact fraction when you compare two lines.

Beyond straight lines

The same idea works for any two graphs: solutions are intersection points. A line and a parabola can meet 0, 1 or 2 times. See finding intersections of two graphs for curves and the numerical method the calculator uses.

Try it in the calculator

Common mistakes

  • Reading the intersection inaccurately. Always substitute your answer back into both equations.
  • Graphing in a window that misses the crossing. If the lines look parallel but have different slopes, zoom out.
  • Calling parallel lines “no graph”. The lines exist; they just never meet, so the system has no solution.
  • Stopping at x. A solution of a two-variable system is a pair (x, y).

Questions

Is graphing always accurate enough?

Graphing gives exact answers only when the intersection lands on clear grid values. For fractional answers, the calculator’s intersection tool or algebra (substitution or elimination) gives the exact point.

Can a system of two linear equations have exactly two solutions?

No. Two different straight lines meet at most once. Two solutions are possible only when at least one equation is not linear, such as a line and a parabola.

What is a consistent system?

A system with at least one solution. An inconsistent system has none (parallel lines); a dependent system has infinitely many (the same line).

Graph your own example with the Slope Intercept Form Calculator — free, in your browser.

Try it now

Sources and further reading

Worked examples and figures were produced and checked with the Graphing Calculator Lab engine. See the editorial policy.

Related guides

More in Lines and Linear Equations · All guides