How to Solve a System of Linear Equations

Combination of shapes and alphabet
Yagi Studio / Getty Images

In mathematics, a linear equation is one that contains two variables and can be plotted on a graph as a straight line. A system of linear equations is a group of two or more linear equations that all contain the same set of variables. Systems of linear equations can be used to model real-world problems. They can be solved using a number of different methods:

  1. Graphing
  2. Substitution
  3. Elimination by addition
  4. Elimination by subtraction
01
of 04

Graphing

Caucasian teacher writing on chalkboard
Eric Raptosh Photography/Blend Images/Getty Images

Graphing is one of the simplest ways to solve a system of linear equations. All you have to do is graph each equation as a line and find the point(s) where the lines intersect.

For example, consider the following system of linear equations containing the variables x andy:

y = x + 3

y = -1x - 3

These equations are already written in slope-intercept form, making them easy to graph. If the equations were not written in slope-intercept form, you would need to simplify them first. Once that is done, solving for x and y requires just a few simple steps:

1. Graph both equations.

2. Find the point where the equations intersect. In this case, the answer is (-3, 0).

3. Verify that your answer is correct by plugging in the values x = -3 and y = 0 into the original equations.

y = x + 3

(0) = (-3) + 3

0 = 0

y = -1x - 3

0 = -1(-3) - 3

0 = 3 - 3

0 = 0

02
of 04

Substitution

Another way to solve a system of equations is by substitution. With this method, you are essentially simplifying one equation and incorporating it into the other, which allows you to eliminate one of the unknown variables.

Consider the following system of linear equations:

3x + y = 6

x = 18 -3y

In the second equation, x is already isolated. If that were not the case, we would first need to simplify the equation to isolate x. Having isolated x in the second equation, we can then replace the x in the first equation with the equivalent value from the second equation: (18 - 3y).

1. Replace x in the first equation with the given value of x in the second equation.

3 (18 – 3y) + y = 6

2. Simplify each side of the equation.

54 – 9y + y = 6

54 – 8y = 6

3. Solve the equation for y.

54 – 8y – 54 = 6 – 54
-8y = -48
-8y/-8 = -48/-8
y = 6

4. Plug in y = 6 and solve for x.

x = 18 -3y

x = 18 -3(6)

x = 18 - 18

x = 0

5. Verify that (0,6) is the solution.

x = 18 -3y

0 = 18 – 3(6)

0 = 18 -18

0 = 0

03
of 04

Elimination by Addition

If the linear equations you are given are written with the variables on one side and a constant on the other, the easiest way to solve the system is by elimination.

Consider the following system of linear equations:

x + y = 180

3x + 2y = 414

1. First, write the equations next to each other so that you can easily compare the coefficients with each variable.

2. Next, multiply the first equation by -3.

-3(x + y = 180)

3. Why did we multiply by -3? Add the first equation to the second to find out.

-3x + -3y = -540

+ 3x + 2y = 414

0 + -1y = -126

We have now eliminated the variable x.

4. Solve for the variable y:

y = 126

5. Plug in y = 126 to find x.

x + y = 180

x + 126 = 180

x = 54

6. Verify that (54, 126) is the correct answer.

3x + 2y = 414

3(54) + 2(126) = 414

414 = 414

04
of 04

Elimination by Subtraction

Another way to solve by elimination is to subtract, rather than add, the given linear equations.

Consider the following system of linear equations:

y - 12x = 3

y - 5x = -4

1. Instead of adding the equations, we can subtract them to eliminate y.

y - 12x = 3

- (y - 5x = -4)

0 - 7x = 7

2. Solve for x.

-7x = 7

x = -1

3. Plug in x = -1 to solve for y.

y - 12x = 3

y - 12(-1) = 3

y + 12 = 3

y = -9

4. Verify that (-1, -9) is the correct solution.

(-9) - 5(-1) = -4

-9 + 5 = -4

-4 = -4