Updated date:

Math: How to Solve Linear Equations and Systems of Linear Equations

Author:

I studied applied mathematics, in which I did both a bachelor's and a master's degree.

What Is a Linear Equation?

A linear equation is a mathematical form in which there is an equality statement between two expressions, such that all terms are linear. Linear means that all variables appear to the power 1. So we can have x in our expression, but not for example x^2 or the square root of x. Also we cannot have exponential terms as 2^x, or goniometric terms, like the sine of x. An example of a linear equation with one variable is:

7x + 4 = 3x + 2

Here we see indeed an expression that has the variable x only appearing to the power one on both sides of the equality sign.

A linear expression represents a line in the two dimensional plane. Imagine a coordinate system with a y-axis and an x-axis as in the picture below. The 7x + 4 represents the line that crosses the y-axis at 4 and has a slope of 7. This is the case because when the line crosses the y-axis we have that x is equal to zero, and therefore 7x + 4 = 7 * 0 + 4 = 4. Furthermore, if x is increased by one, the value of the expression is increased by seven, and therefore the slope is seven. Equivalently 3x + 2 represents the line that crosses the y-axis at 2 and has a slope of 3.

Now the linear equation represents the point in which the two lines cross, which is called the intersection of the two lines.

Solving a Linear Equation

The way to solve a linear equation is to rewrite it in such a form that on the one side of the equality sign we end up with one term only containing x, and on the other side we have one term which is a constant. To achieve this we can perform several operations. Fist of all we can add or subtract a number on both sides of the equation. We must make sure that we perform the action on both sides such that the equality is preserved. Also we can multiply both sides with a number, or divide by a number. Again we must make sure that we perform the same action on both sides of the equality sign.

The example we had was:

7x + 4 = 3x +2

Our first step would be subtracting 3x on both sides to get:

7x + 4 - 3x = 3x + 2 - 3x

Which leads to:

4x + 4 = 2

Then we subtract 4 on both sides:

4x = -2

Finally, we divide both sides by 4 to get our answer:

x = -1/2

To check if this answer is indeed correct we can fill it in on both sides of the equation. If the answer is correct we should get two equal answers:

7* -1/2 + 4 = -3 1/2 + 4 = 1/2

3 * -1/2 + 2 = -1 1/2 + 2 = 1/2

So indeed both sides equal 1/2 if we choose x = - 1/2, which means that the lines intersect at the point (-1/2 , 1/2) in the coordinate system.

Lines of the Equations of the Example

Lines of the Equations of the Example

Solving a System of Linear Equations

We can look at systems of linear equations with more than one variable. To do this we must also have multiple linear equations. This is called a linear system. It might also happen that a linear system does not have a solution. To be able to solve a linear system we must at least have as many equations as there are variables. Furthermore, when we have a total of n variables, there must be exactly n linearly independent equations in the system to be able to solve it. Linearly independent means that we cannot get the equation by rearranging the other equations. For example if we have the equations 2x + y = 3 and 4x + 2y = 6 then they are dependent since the second is two times the first equation. If we would have only these two equations we would not be able to find one unique solution. In fact there are infinitely many solutions in this case, since for every x we could find one unique y for which the equalities both hold.

Even if we have an independent system it might happen that there is no solution. For example if we would have x + y = 1 and x + y = 6 it is obvious that there is no combination of x and y possible such that both equalities are satisfied, even though we have two independent equalities.

Example with Two Variables

An example of a linear system with two variables that has a solution is:

2x + 3y = 7

4x - 5y = 8

As you can see, there are two variables, x and y, and there are exactly two equations. This means we might be able to find a solution. The way to solve these kind of systems is to first solve one equation as we did before, however now our answer will contain the other variable. In other words we will write x in terms of y. Then we can fill in this solution in the other equation to get the value of that variable. So we will substitute for x the expression in terms of y that we found. Finally we can use the one equation to find the final answer. This might seem difficult as you read it, but this is not the case as you will see in the example.

We will start with solving the first equation 2x + 3y = 7 and get:

2x = 7 - 3y

x = 3 1/2 - 1 1/2 y

Then we fill in this solution in the second equation 4x - 5y = 8:

4*(3 1/2 - 1 1/2 y) - 5y = 8

14 - 6y - 5y = 8

14 - 11y = 8

-11y = -6

y = 6/11

Now we know the value of y we can use one of the equations to find x. We will use 2x + 3y = 7, but we could also have picked the other one. Since both should be satisfied with the same x and y in the end it does not matter which of the two we choose to calculate x. This results in:

2x + 3* 6/11 = 7

2x + 1 7/11 = 7

2x = 5 4/11

x = 59/22 = 2 15/22

So our final answer is x = 2 15/22 and y = 6/11.

We can check whether this is correct by filling in both equations:

2x + 3y = 2* 2 15/22 + 3* 6/11 = 5 8/22 + 1 7/11 = 5 8/22 + 1 14/22 = 7

4x - 5y = 4* 2 15/22 - 5* 6/11 = 10 16/22 - 2 8/11 = 10 16/22 - 2 16/22 = 8

So indeed both equations are satisfied and the answer is correct.




Solution of the Example System

Solution of the Example System

More than Two Variables

Of course we can also have systems with more than two variables. However, the more variables you have, the more equations you need to solve the problem. Therefore it will need more computations and it will be smart to use the computer to solve them. Often these systems will be represented using matrices and vectors instead of a list of equations. A lot of research has been done in the field of linear systems and very good methods have been developed to be able to solve very difficult and large systems in an efficient and fast way using the computer.

Linear systems of multiple variables appear all the time in all kinds of practical problems to having the knowledge on how to solve them is a very important topic to master when you want to work in the field of optimization.

This content is accurate and true to the best of the author’s knowledge and is not meant to substitute for formal and individualized advice from a qualified professional.