Linear equations are an effective tool in many mathematical and computational problems. Numerous processes can be described with their help, and they are the most easily solved. There are various ways of solving them, both approximately and exactly. Here we are going to introduce the so-called substitution method. You can use it to solve simple systems by hand. It can also help understand more advanced and general methods.
Let's look at an example:
If you look carefully you will notice, that the pair and is a solution of this system, because it satisfies both of those equations. But how can we obtain this result without guessing? And how can we show that this is the one and only solution? Let’s figure it out.
The idea of the method
The key idea here is that the solution of a system indeed satisfies all the equations. But before describing the method, let’s call to mind how to solve a linear equation for one variable in terms of others. Consider the first equation from the example
Remember that multiplication of both sides of the equation by the same nonzero number does not change its solutions, as well as adding the same terms to both sides. That's why you can do something like this:
Notice that we managed to isolate in the left part of the equation, and everything else is on the right side. This procedure is called solving an equation for in terms of . Obviously, it could be done to any linear equation. For example, if we solve
for in terms of , , and , the result will be
(Check it!) As you can see, the algorithm is very simple:
- Divide the whole equation by the coefficient before the required variable. That way you obtain coefficient before it (if it is already skip this step).
- Move all the terms except the required variables to the other side of the equation.
Obviously, you can change the sequence of these steps.
Let's get back to the systems. As it was remarked, if a system has a solution, it satisfies all of its equations. Look at the example again
The point here is that when we are solving this system, the variables are set to be equal in both equations (with it is the same). As we are not changing the set of solutions of the first equation (and therefore of the whole system) let’s solve it for in terms of . Now we have the following
Here you can use the expression for in the second equation (just change for ):
The process of replacement of a variable with the expression (marked in red) is called substitution. As you see, this is the equation of a single variable , which can be trivially solved:
So, now you have . But you already have the expression for in terms of :
And now you have the solution. Notice, that it is, obviously, the single solution, as every step of our method hasn’t changed the set of solutions, and there is no other pair of numbers that could be obtained through these steps.
Algorithm Description
In the previous section, you looked at substitution method application for a very simple system, which had one determined solution. Here we will try to describe the whole algorithm for an arbitrary system. Don't be confused, as we are going to give some examples in the following section. Let's say you have a system of equations with variables (,,…,)
- So the first step is to assume that the system has indeed a unique solution.
- Solve one of the equations of the system (for example the first one) for one of its variables in terms of others (for simplicity, we assume that is expressed from the first equation).
- Substitute the expression for to all the other equations. Now all the equations except the first contain only variables , , …, . That means that now we have a system of equations with variables.
- Repeat the previous steps for this system. For example, express in terms of , … , from the second equation and substitute it to others.
- Continue this procedure until you reach . If the system has the one and only solution, on this last step you will obtain the numerical value of .
- As is expressed only in terms of , knowing the value of you can calculate .
- You can continue this way, as each of the variables is expressed only in terms of previous ones, which are calculated in a previous step.
- After doing all these calculations, we obtain the solution of the system.
Here or there you can run across a subtlety. If the system has no solutions, you will end up with some untruthful equality (like ) on the last step of 5. Or you can end up with some identity (like ), which, of course, means that the system has infinitely many solutions.
Examples of application of the method
1) Let's look at an example
It does not matter in which order we are expressing the variables, therefore begin with solving the first equation for in terms of and :
(We've chosen to solve for because the calculations are the simplest in this case). Now we are substituting this expression to the remaining equations:
Now you have a system of two equations. Let's repeat the same procedure for (we are solving the second equation for it):
Now substituting it to the first equation we obtain:
This is an equation of one variable. Solving it gives us :
Use this value to calculate from the blue substitution:
Lastly, using both values and , we find from the orange substitution:
The solution of the system is
2) Another example:
Let's try to repeat the same algorithm. Firstly, solve the first equation for (again, as you see, this is the easiest way to begin):
Substituting:
Now solving the second equation for :
Substituting it to the second equation:
This is an identity, therefore the system has an infinite set of solutions. Moreover, here we can find the solutions for two of the variables in terms of one other, for example for and in terms of . To do that, substitute the expression for in expression for :
We added the last line to highlight the fact that now the system is solved in terms of . For each value of we obtain one particular solution. For example, if , then the solution is , if , then et cetera. The set of solutions could also be rewritten in terms of or . However, we are not going to describe this method of solving SLE further. Note that it is very important for continuing the study of linear algebra, especially when it comes to SLEs in which the number of variables and equations are different.
3) For the last example, let's see what's going to happen if a system doesn't have solutions:
As always, solve the first equation for :
Substitute to the second equation:
This is a contradiction, therefore this system doesn't have any solutions.
Conclusion
- Solving an equation for one of its variables in terms of others is a way to derive an expression for this variable using all the other variables in an equation.
- To solve a system of linear equations (or to show that it doesn't have solutions), first, reduce the number of variables solving the equations successively (in the about-mentioned sense) and substituting the received expressions in the remaining equations until you find the value for the last of the variables (or until you obtain truthful or untruthful identity). Secondly, if you find this particular value, procure the series of reverse substitutions until you find all the values.
- If you obtain an untruthful identity, that means the system doesn't have any solutions.
- If, on the contrary, you obtain a truthful identity, then the system has an infinite set of solutions and these solutions can be parametrized with the help of some of the variables.