Create your own
Lesson illustration

Solving Linear Systems by Substitution and Elimination

Hello. In the previous lesson, you solved quadratic equations by factoring or using the quadratic formula. Those problems asked for values of one unknown. This lesson moves to two unknowns and two equations: a linear system. The aim is to find an ordered pair that makes both equations true.

You will learn two exact algebraic methods:

  • Substitution, which replaces one variable by an equivalent expression.
  • Elimination, which combines equations so that one variable cancels.

Both methods are foundational for the larger systems, matrix methods, and model-fitting equations that appear later in machine learning mathematics.


1. What it means to solve a system

A two-equation linear system has a form such as

A solution is an ordered pair satisfying both equations simultaneously. It is essential that the same values of and work in both equations.

Geometrically, each equation represents a line. A solution is a point shared by the two lines.

Two lines on a Cartesian grid intersect at the highlighted point \((2,2)\). That point is the solution because it lies on both lines.

Usually, two distinct nonparallel lines meet at one point, giving one solution. But two other outcomes are possible:

  • The lines may be parallel, giving no solution.
  • The equations may describe exactly the same line, giving infinitely many solutions.

For now, focus on the usual case of one intersection point. Algebra lets us find that point exactly even when its coordinates are fractions that would be difficult to read from a graph.

4.1 Solve Systems of Linear Equations with Two Variables - Intermediate Algebra 2e | OpenStax

Read OpenStax Intermediate Algebra 2e, Section 4.1, for a structured reference to substitution and elimination. Its main value is the careful procedural checklist and its discussion of systems with one, none, or infinitely many solutions.

In the subsection “Solve a System of Equations by Substitution,” read the substitution walkthrough. Track how one equation is reduced to a one-variable equation, then how the second coordinate is recovered. Next, in “Solve a System of Equations by Elimination,” read the elimination introduction. Pay particular attention to the requirement to multiply every term of an equation. Finally, near the end of that same elimination subsection, read the exceptional cases. Notice how a true statement at the end signals infinitely many solutions.


2. Substitution: replacing equals by equals

Suppose one equation tells you exactly what one variable equals:

At every point on that line, and have the same value. Therefore, in the other equation of a system, any occurrence of may be replaced by . This is the substitution principle: equal quantities can replace each other.

Consider the system

The first equation is already solved for , so substitution is natural. Replace in the second equation:

Now there is only one variable:

We still need . Substitute this value into the conveniently isolated equation:

Therefore,

is the solution.

Check it in the second original equation:

The first equation also holds:

Fractions are not evidence of a mistake. They are often the exact coordinates of the intersection.

When no variable is isolated

Substitution also works when neither equation is initially solved for a variable. First rearrange the equation that can be isolated most easily.

The second equation has coefficient on , so isolate :

Now substitute this into the first equation:

Distribute carefully:

Combine like terms:

Use

to find the remaining coordinate:

Thus,

A direct check confirms both equations:

A substitution routine

Use this sequence every time:

  1. Isolate or in one equation.
  2. Replace that variable in the other equation with its equivalent expression.
  3. Solve the resulting one-variable equation.
  4. Substitute the value found into an original equation to obtain the other variable.
  5. State the answer as , in that order.
  6. Check the pair in both original equations.

Parentheses are especially important during substitution. For example, if

then replacing in must produce

not

The coefficient multiplies the entire expression that replaces .


3. Elimination: making one variable disappear

Substitution replaces one variable. Elimination removes one variable by adding equations whose coefficients have been made opposites.

Start with

The coefficients of are already opposites:

Add the left sides and add the right sides:

The -terms cancel:

Therefore,

Substitute into either original equation. Using the first,

So the solution is

The reason elimination is valid is that a solution satisfies both original equations. Adding equal quantities preserves equality. Since the same pair satisfies the first equation and the second equation, it must satisfy their sum as well.

Creating opposite coefficients

Usually, coefficients do not begin as opposites. In that case, multiply one or both entire equations by carefully chosen nonzero numbers.

Consider

Eliminating is convenient. The first equation has , so create in the second equation by multiplying every term of the second equation by :

This gives

Write the transformed system:

Now add:

Substitute into an original equation, such as

Then

The solution is

Verify both equations:

A common error is to multiply only the variable term. For example, multiplying

by does not give

The multiplier applies to every term:

Solving Systems of Equations By Elimination & Substitution With 2 Variables

Watch “Solving Systems of Equations By Elimination & Substitution With 2 Variables” from The Organic Chemistry Tutor. It provides concise visual demonstrations of both methods, including the crucial step of scaling an equation before elimination.

Watch direct elimination to see immediate cancellation, then scaled elimination for a case where an equation must be multiplied first. Continue with basic substitution, where one equation is already solved for a variable. Then watch equating expressions for the useful special case in which both equations are written as expressions for y.


4. Choosing the efficient method

Both methods arrive at the same solution when performed correctly. The goal is not to use one method universally, but to choose the method that keeps the algebra controlled and avoids unnecessary fractions.

System featureUsually preferableReason
A variable is already isolatedSubstitutionReplacement can begin immediately.
A variable has coefficient or SubstitutionIsolation is usually quick and clean.
Coefficients are opposites alreadyEliminationAdding cancels a variable immediately.
Coefficients have easy common multiplesEliminationScaling can create cancellation without solving for a variable first.
Both methods seem equally shortEither methodChoose the route with fewer operations and fewer sign risks.

For example,

strongly suggests substitution because is already isolated.

In contrast,

strongly suggests elimination because and cancel upon addition.

In machine learning, much larger systems will later be written compactly using matrices. The logic will remain the same: transform equations without changing their common solution, reduce the number of unknowns, and verify the result.


5. No solution and infinitely many solutions

Algebra can also reveal when two equations fail to intersect once.

Infinitely many solutions

Consider

Substitute into the second equation:

Simplifying gives

Subtracting from both sides gives

This is always true. It does not identify a particular , because every point on the first line also lies on the second. The equations represent the same line, so there are infinitely many solutions.

No solution

Now consider

Because both expressions equal , set them equal:

Subtract from both sides:

This is false. No value of can make it true, so the system has no solution. The two lines have the same slope but different vertical positions: they are parallel.

These outcomes provide a useful diagnostic:

Final simplified statementMeaning
A value such as Usually one solution; find the other coordinate.
A true identity such as Infinitely many solutions.
A contradiction such as No solution.

Conclusion

A two-equation linear system asks for the ordered pair that satisfies both equations.

The two central methods are:

  • Substitution: isolate one variable, replace it in the other equation, solve, then substitute back.
  • Elimination: scale equations if necessary, add them to cancel one variable, solve, then substitute back.

Whichever method you use, preserve equality at every step, distribute carefully through parentheses, and check the final ordered pair in both original equations. A final identity such as signals infinitely many shared points, while a contradiction signals no shared point.

Next, you will shift from solving equations to expressing mathematical claims precisely with sets, quantifiers, implications, and counterexamples.

Can't find a good explanation? Sign up and we'll make it for you

Sign up