How to solve an equation using the Gauss method. Gauss method and systems of linear equations that have no solutions

Today we deal with the Gauss method for solving systems of linear algebraic equations. You can read about what these systems are in the previous article devoted to solving the same SLAE by the Cramer method. The Gauss method does not require any specific knowledge, only care and consistency are needed. Despite the fact that from the point of view of mathematics, school preparation is enough for its application, mastering this method often causes difficulties for students. In this article, we will try to reduce them to nothing!

Gauss method

M Gauss method is the most universal method for solving SLAE (with the exception of very large systems). Unlike the one discussed earlier, it is suitable not only for systems that have a unique solution, but also for systems that have an infinite number of solutions. There are three options here.

  1. The system has a unique solution (the determinant of the main matrix of the system is not equal to zero);
  2. The system has an infinite number of solutions;
  3. There are no solutions, the system is inconsistent.

So, we have a system (let it have one solution), and we are going to solve it using the Gaussian method. How it works?

The Gaussian method consists of two stages - direct and inverse.

Direct Gauss method

First, we write the augmented matrix of the system. To do this, we add a column of free members to the main matrix.

The whole essence of the Gaussian method is to bring the given matrix to a stepped (or, as they say, triangular) form by means of elementary transformations. In this form, there should be only zeros under (or above) the main diagonal of the matrix.

What can be done:

  1. You can rearrange the rows of the matrix;
  2. If there are identical (or proportional) rows in the matrix, you can delete all but one of them;
  3. You can multiply or divide a string by any number (except zero);
  4. Zero lines are removed;
  5. You can add a string multiplied by a non-zero number to a string.

Reverse Gauss method

After we transform the system in this way, one unknown xn becomes known, and it is possible to find all the remaining unknowns in reverse order, substituting the already known x's into the equations of the system, up to the first.

When the Internet is always at hand, you can solve the system of equations using the Gauss method online . All you have to do is enter the odds into the online calculator. But you must admit, it is much more pleasant to realize that the example was solved not by a computer program, but by your own brain.

An example of solving a system of equations using the Gauss method

And now - an example, so that everything becomes clear and understandable. Let a system of linear equations be given, and it is necessary to solve it by the Gauss method:

First, let's write the augmented matrix:

Now let's take a look at the transformations. Remember that we need to achieve a triangular form of the matrix. Multiply the 1st row by (3). Multiply the 2nd row by (-1). Let's add the 2nd row to the 1st and get:

Then multiply the 3rd row by (-1). Let's add the 3rd line to the 2nd:

Multiply the 1st row by (6). Multiply the 2nd row by (13). Let's add the 2nd line to the 1st:

Voila - the system is brought to the appropriate form. It remains to find the unknowns:

The system in this example has a unique solution. We will consider the solution of systems with an infinite set of solutions in a separate article. Perhaps at first you will not know where to start with matrix transformations, but after appropriate practice you will get your hands on it and will click the Gaussian SLAE like nuts. And if you suddenly come across a SLAU, which turns out to be too tough a nut to crack, contact our authors! you can by leaving an application in the Correspondence. Together we will solve any problem!


Gauss method great for solving systems of linear algebraic equations (SLAE). It has several advantages over other methods:

  • firstly, there is no need to pre-investigate the system of equations for compatibility;
  • secondly, the Gauss method can be used to solve not only SLAEs in which the number of equations coincides with the number of unknown variables and the main matrix of the system is nondegenerate, but also systems of equations in which the number of equations does not coincide with the number of unknown variables or the determinant of the main matrix is ​​equal to zero;
  • thirdly, the Gaussian method leads to a result with a relatively small number of computational operations.

Brief review of the article.

First, we give the necessary definitions and introduce some notation.

Next, we describe the algorithm of the Gauss method for the simplest case, that is, for systems of linear algebraic equations, the number of equations in which coincides with the number of unknown variables and the determinant of the main matrix of the system is not equal to zero. When solving such systems of equations, the essence of the Gauss method is most clearly visible, which consists in the successive elimination of unknown variables. Therefore, the Gaussian method is also called the method of successive elimination of unknowns. Let us show detailed solutions of several examples.

In conclusion, we consider the Gaussian solution of systems of linear algebraic equations whose main matrix is ​​either rectangular or degenerate. The solution of such systems has some features, which we will analyze in detail using examples.

Page navigation.

Basic definitions and notation.

Consider a system of p linear equations with n unknowns (p can be equal to n ):

Where are unknown variables, are numbers (real or complex), are free members.

If a , then the system of linear algebraic equations is called homogeneous, otherwise - heterogeneous.

The set of values ​​of unknown variables, in which all equations of the system turn into identities, is called SLAU decision.

If there is at least one solution to a system of linear algebraic equations, then it is called joint, otherwise - incompatible.

If a SLAE has a unique solution, then it is called certain. If there is more than one solution, then the system is called uncertain.

The system is said to be written in coordinate form if it has the form
.

This system in matrix form records has the form , where - the main matrix of SLAE, - the matrix of the column of unknown variables, - the matrix of free members.

If we add to the matrix A as the (n + 1)-th column the matrix-column of free terms, then we get the so-called expanded matrix systems of linear equations. Usually, the augmented matrix is ​​denoted by the letter T, and the column of free members is separated by a vertical line from the rest of the columns, that is,

The square matrix A is called degenerate if its determinant is zero. If , then the matrix A is called non-degenerate.

The following point should be noted.

If the following actions are performed with a system of linear algebraic equations

  • swap two equations,
  • multiply both sides of any equation by an arbitrary and non-zero real (or complex) number k,
  • to both parts of any equation add the corresponding parts of the other equation, multiplied by an arbitrary number k,

then we get an equivalent system that has the same solutions (or, like the original one, has no solutions).

For an extended matrix of a system of linear algebraic equations, these actions will mean elementary transformations with rows:

  • swapping two strings
  • multiplication of all elements of any row of the matrix T by a non-zero number k ,
  • adding to the elements of any row of the matrix the corresponding elements of another row, multiplied by an arbitrary number k .

Now we can proceed to the description of the Gauss method.

Solving systems of linear algebraic equations, in which the number of equations is equal to the number of unknowns and the main matrix of the system is nondegenerate, by the Gauss method.

What would we do at school if we were given the task of finding a solution to a system of equations .

Some would do so.

Note that by adding the left side of the first equation to the left side of the second equation, and the right side to the right side, you can get rid of the unknown variables x 2 and x 3 and immediately find x 1:

We substitute the found value x 1 \u003d 1 into the first and third equations of the system:

If we multiply both parts of the third equation of the system by -1 and add them to the corresponding parts of the first equation, then we get rid of the unknown variable x 3 and can find x 2:

We substitute the obtained value x 2 \u003d 2 into the third equation and find the remaining unknown variable x 3:

Others would have done otherwise.

Let's solve the first equation of the system with respect to the unknown variable x 1 and substitute the resulting expression into the second and third equations of the system in order to exclude this variable from them:

Now let's solve the second equation of the system with respect to x 2 and substitute the result obtained into the third equation in order to exclude the unknown variable x 2 from it:

It can be seen from the third equation of the system that x 3 =3. From the second equation we find , and from the first equation we get .

Familiar solutions, right?

The most interesting thing here is that the second solution method is essentially the method of sequential elimination of unknowns, that is, the Gauss method. When we expressed unknown variables (first x 1 , next x 2 ) and substituted them into the rest of the equations of the system, we thereby excluded them. We carried out the exception until the moment when the last equation left only one unknown variable. The process of sequential elimination of unknowns is called direct Gauss method. After the forward move is completed, we have the opportunity to calculate the unknown variable in the last equation. With its help, from the penultimate equation, we find the next unknown variable, and so on. The process of successively finding unknown variables while moving from the last equation to the first is called reverse Gauss method.

It should be noted that when we express x 1 in terms of x 2 and x 3 in the first equation, and then substitute the resulting expression into the second and third equations, the following actions lead to the same result:

Indeed, such a procedure also allows us to exclude the unknown variable x 1 from the second and third equations of the system:

Nuances with the elimination of unknown variables by the Gauss method arise when the equations of the system do not contain some variables.

For example, in SLAU in the first equation, there is no unknown variable x 1 (in other words, the coefficient in front of it is zero). Therefore, we cannot solve the first equation of the system with respect to x 1 in order to exclude this unknown variable from the rest of the equations. The way out of this situation is to swap the equations of the system. Since we are considering systems of linear equations whose determinants of the main matrices are different from zero, there always exists an equation in which the variable we need is present, and we can rearrange this equation to the position we need. For our example, it is enough to swap the first and second equations of the system , then you can solve the first equation for x 1 and exclude it from the rest of the equations of the system (although x 1 is already absent in the second equation).

We hope you get the gist.

Let's describe Gauss method algorithm.

Let us need to solve a system of n linear algebraic equations with n unknown variables of the form , and let the determinant of its main matrix be nonzero.

We will assume that , since we can always achieve this by rearranging the equations of the system. We exclude the unknown variable x 1 from all equations of the system, starting from the second one. To do this, add the first equation multiplied by to the second equation of the system, add the first multiplied by to the third equation, and so on, add the first multiplied by to the nth equation. The system of equations after such transformations will take the form

where , a .

We would come to the same result if we expressed x 1 in terms of other unknown variables in the first equation of the system and substituted the resulting expression into all other equations. Thus, the variable x 1 is excluded from all equations, starting from the second.

Next, we act similarly, but only with a part of the resulting system, which is marked in the figure

To do this, add the second equation multiplied by to the third equation of the system, add the second multiplied by to the fourth equation, and so on, add the second multiplied by to the nth equation. The system of equations after such transformations will take the form

where , a . Thus, the variable x 2 is excluded from all equations, starting from the third.

Next, we proceed to the elimination of the unknown x 3, while acting similarly with the part of the system marked in the figure

So we continue the direct course of the Gauss method until the system takes the form

From this moment, we begin the reverse course of the Gauss method: we calculate x n from the last equation as , using the obtained value of x n we find x n-1 from the penultimate equation, and so on, we find x 1 from the first equation.

Let's analyze the algorithm with an example.

Example.

Gaussian method.

Decision.

The coefficient a 11 is different from zero, so let's proceed to the direct course of the Gauss method, that is, to the elimination of the unknown variable x 1 from all equations of the system, except for the first one. To do this, to the left and right parts of the second, third and fourth equations, add the left and right parts of the first equation, multiplied by , respectively, and :

The unknown variable x 1 has been eliminated, let's move on to the exclusion x 2 . To the left and right parts of the third and fourth equations of the system, we add the left and right parts of the second equation, multiplied by and :

To complete the forward course of the Gauss method, we need to exclude the unknown variable x 3 from the last equation of the system. Add to the left and right sides of the fourth equation, respectively, the left and right sides of the third equation, multiplied by :

You can start the reverse course of the Gauss method.

From the last equation we have ,
from the third equation we get ,
from the second
from the first.

To check, you can substitute the obtained values ​​of unknown variables into the original system of equations. All equations turn into identities, which means that the solution by the Gauss method was found correctly.

Answer:

And now we will give the solution of the same example by the Gauss method in matrix form.

Example.

Find a solution to the system of equations Gaussian method.

Decision.

The extended matrix of the system has the form . Above each column, unknown variables are written, which correspond to the elements of the matrix.

The direct course of the Gauss method here involves bringing the extended matrix of the system to a trapezoidal form using elementary transformations. This process is similar to the exclusion of unknown variables that we did with the system in coordinate form. Now you will be convinced of it.

Let's transform the matrix so that all elements in the first column, starting from the second, become zero. To do this, to the elements of the second, third and fourth rows, add the corresponding elements of the first row multiplied by , and on respectively:

Next, we transform the resulting matrix so that in the second column, all elements, starting from the third, become zero. This would correspond to excluding the unknown variable x 2 . To do this, add to the elements of the third and fourth rows the corresponding elements of the first row of the matrix, multiplied by and :

It remains to exclude the unknown variable x 3 from the last equation of the system. To do this, to the elements of the last row of the resulting matrix, we add the corresponding elements of the penultimate row, multiplied by :

It should be noted that this matrix corresponds to the system of linear equations

which was obtained earlier after the direct move.

It's time to turn back. In the matrix form of the notation, the reverse course of the Gauss method involves such a transformation of the resulting matrix so that the matrix marked in the figure

became diagonal, that is, took the form

where are some numbers.

These transformations are similar to those of the Gauss method, but are performed not from the first line to the last, but from the last to the first.

Add to the elements of the third, second and first rows the corresponding elements of the last row, multiplied by , on and on respectively:

Now let's add to the elements of the second and first rows the corresponding elements of the third row, multiplied by and by, respectively:

At the last step of the reverse motion of the Gaussian method, we add the corresponding elements of the second row, multiplied by , to the elements of the first row:

The resulting matrix corresponds to the system of equations , from which we find the unknown variables.

Answer:

NOTE.

When using the Gauss method to solve systems of linear algebraic equations, approximate calculations should be avoided, as this can lead to absolutely incorrect results. We recommend that you do not round decimals. It is better to move from decimal fractions to ordinary fractions.

Example.

Solve System of Three Equations by Gaussian Method .

Decision.

Note that in this example, the unknown variables have a different designation (not x 1 , x 2 , x 3 , but x, y, z ). Let's move on to ordinary fractions:

Eliminate the unknown x from the second and third equations of the system:

In the resulting system, there is no unknown variable y in the second equation, and y is present in the third equation, therefore, we swap the second and third equations:

At this point, the direct course of the Gauss method is over (you do not need to exclude y from the third equation, since this unknown variable no longer exists).

Let's go back.

From the last equation we find ,
from penultimate


from the first equation we have

Answer:

X=10, y=5, z=-20.

The solution of systems of linear algebraic equations, in which the number of equations does not coincide with the number of unknowns, or the main matrix of the system is degenerate, by the Gauss method.

Systems of equations whose main matrix is ​​rectangular or square degenerate may have no solutions, may have a single solution, or may have an infinite number of solutions.

Now we will understand how the Gauss method allows you to establish the compatibility or inconsistency of a system of linear equations, and in the case of its compatibility, determine all solutions (or one single solution).

In principle, the process of eliminating unknown variables in the case of such SLAEs remains the same. However, it is worth dwelling in detail on some situations that may arise.

Let's move on to the most important step.

So, let us assume that the system of linear algebraic equations after the completion of the forward run of the Gauss method takes the form and none of the equations reduced to (in this case, we would conclude that the system is inconsistent). A logical question arises: "What to do next"?

We write out the unknown variables that are in the first place of all the equations of the resulting system:

In our example, these are x 1 , x 4 and x 5 . In the left parts of the equations of the system, we leave only those terms that contain the written out unknown variables x 1, x 4 and x 5, we transfer the remaining terms to the right side of the equations with the opposite sign:

Let us assign arbitrary values ​​to the unknown variables that are on the right-hand sides of the equations, where - arbitrary numbers:

After that, the numbers are found in the right parts of all the equations of our SLAE and we can proceed to the reverse course of the Gauss method.

From the last equation of the system we have , from the penultimate equation we find , from the first equation we get

The solution of the system of equations is the set of values ​​of unknown variables

Giving numbers different values, we will get different solutions to the system of equations. That is, our system of equations has infinitely many solutions.

Answer:

where - arbitrary numbers.

To consolidate the material, we will analyze in detail the solutions of several more examples.

Example.

Solve Homogeneous System of Linear Algebraic Equations Gaussian method.

Decision.

Let us exclude the unknown variable x from the second and third equations of the system. To do this, add the left and right parts of the first equation, respectively, to the left and right parts of the second equation, multiplied by , and to the left and right parts of the third equation, the left and right parts of the first equation, multiplied by :

Now we exclude y from the third equation of the resulting system of equations:

The resulting SLAE is equivalent to the system .

We leave only the terms containing the unknown variables x and y on the left side of the equations of the system, and transfer the terms with the unknown variable z to the right side:

We continue to consider systems of linear equations. This lesson is the third on the topic. If you have a vague idea of ​​what a system of linear equations is in general, you feel like a teapot, then I recommend starting with the basics on the Next page, it is useful to study the lesson.

Gauss method is easy! Why? The famous German mathematician Johann Carl Friedrich Gauss, during his lifetime, received recognition as the greatest mathematician of all time, a genius, and even the nickname "King of Mathematics". And everything ingenious, as you know, is simple! By the way, not only suckers, but also geniuses fall into the money - the portrait of Gauss was flaunted on a bill of 10 Deutschmarks (before the introduction of the euro), and Gauss still mysteriously smiles at the Germans from ordinary postage stamps.

The Gauss method is simple in that it IS ENOUGH THE KNOWLEDGE OF A FIFTH-GRADE STUDENT to master it. Must be able to add and multiply! It is no coincidence that the method of successive elimination of unknowns is often considered by teachers at school mathematical electives. It is a paradox, but the Gauss method causes the greatest difficulties for students. Nothing surprising - it's all about the methodology, and I will try to tell in an accessible form about the algorithm of the method.

First, we systematize the knowledge about systems of linear equations a little. A system of linear equations can:

1) Have a unique solution. 2) Have infinitely many solutions. 3) Have no solutions (be incompatible).

The Gauss method is the most powerful and versatile tool for finding a solution any systems of linear equations. As we remember Cramer's rule and matrix method are unsuitable in cases where the system has infinitely many solutions or is inconsistent. A method of successive elimination of unknowns anyway lead us to the answer! In this lesson, we will again consider the Gauss method for case No. 1 (the only solution to the system), an article is reserved for the situations of points No. 2-3. I note that the method algorithm itself works in the same way in all three cases.

Let's return to the simplest system from the lesson How to solve a system of linear equations? and solve it using the Gaussian method.

The first step is to write extended matrix system: . By what principle the coefficients are recorded, I think everyone can see. The vertical line inside the matrix does not carry any mathematical meaning - it's just a strikethrough for ease of design.

Reference : I recommend to remember terms linear algebra. System Matrix is a matrix composed only of coefficients for unknowns, in this example, the matrix of the system: . Extended System Matrix is the same matrix of the system plus a column of free members, in this case: . Any of the matrices can be called simply a matrix for brevity.

After the extended matrix of the system is written, it is necessary to perform some actions with it, which are also called elementary transformations.

There are the following elementary transformations:

1) Strings matrices can rearrange places. For example, in the matrix under consideration, you can safely rearrange the first and second rows:

2) If there are (or appeared) proportional (as a special case - identical) rows in the matrix, then it follows delete from the matrix, all these rows except one. Consider, for example, the matrix . In this matrix, the last three rows are proportional, so it is enough to leave only one of them: .

3) If a zero row appeared in the matrix during the transformations, then it also follows delete. I will not draw, of course, the zero line is the line in which only zeros.

4) The row of the matrix can be multiply (divide) for any number non-zero. Consider, for example, the matrix . Here it is advisable to divide the first line by -3, and multiply the second line by 2: . This action is very useful, as it simplifies further transformations of the matrix.

5) This transformation causes the most difficulties, but in fact there is nothing complicated either. To the row of the matrix, you can add another string multiplied by a number, different from zero. Consider our matrix from a practical example: . First, I will describe the transformation in great detail. Multiply the first row by -2: , and to the second line we add the first line multiplied by -2: . Now the first line can be divided "back" by -2: . As you can see, the line that is ADDED LIhasn't changed. Always the line is changed, TO WHICH ADDED UT.

In practice, of course, they don’t paint in such detail, but write shorter: Once again: to the second line added the first row multiplied by -2. The line is usually multiplied orally or on a draft, while the mental course of calculations is something like this:

“I rewrite the matrix and rewrite the first row: »

First column first. Below I need to get zero. Therefore, I multiply the unit above by -2:, and add the first to the second line: 2 + (-2) = 0. I write the result in the second line: »

“Now the second column. Above -1 times -2: . I add the first to the second line: 1 + 2 = 3. I write the result to the second line: »

“And the third column. Above -5 times -2: . I add the first line to the second line: -7 + 10 = 3. I write the result in the second line: »

Please think carefully about this example and understand the sequential calculation algorithm, if you understand this, then the Gauss method is practically "in your pocket". But, of course, we are still working on this transformation.

Elementary transformations do not change the solution of the system of equations

! ATTENTION: considered manipulations can not use, if you are offered a task where the matrices are given "by themselves". For example, with "classic" matrices in no case should you rearrange something inside the matrices! Let's return to our system. She's practically broken into pieces.

Let us write the augmented matrix of the system and, using elementary transformations, reduce it to stepped view:

(1) The first row was added to the second row, multiplied by -2. And again: why do we multiply the first row by -2? In order to get zero at the bottom, which means getting rid of one variable in the second line.

(2) Divide the second row by 3.

The purpose of elementary transformations convert the matrix to step form: . In the design of the task, they directly draw out the “ladder” with a simple pencil, and also circle the numbers that are located on the “steps”. The term "stepped view" itself is not entirely theoretical; in the scientific and educational literature, it is often called trapezoidal view or triangular view.

As a result of elementary transformations, we have obtained equivalent original system of equations:

Now the system needs to be "untwisted" in the opposite direction - from the bottom up, this process is called reverse Gauss method.

In the lower equation, we already have the finished result: .

Consider the first equation of the system and substitute the already known value of “y” into it:

Let us consider the most common situation, when the Gaussian method is required to solve a system of three linear equations with three unknowns.

Example 1

Solve the system of equations using the Gauss method:

Let's write the augmented matrix of the system:

Now I will immediately draw the result that we will come to in the course of the solution: And I repeat, our goal is to bring the matrix to a stepped form using elementary transformations. Where to start taking action?

First, look at the top left number: Should almost always be here unit. Generally speaking, -1 (and sometimes other numbers) will also suit, but somehow it has traditionally happened that a unit is usually placed there. How to organize a unit? We look at the first column - we have a finished unit! Transformation one: swap the first and third lines:

Now the first line will remain unchanged until the end of the solution. Now fine.

The unit in the top left is organized. Now you need to get zeros in these places:

Zeros are obtained just with the help of a "difficult" transformation. First, we deal with the second line (2, -1, 3, 13). What needs to be done to get zero in the first position? Need to the second line add the first line multiplied by -2. Mentally or on a draft, we multiply the first line by -2: (-2, -4, 2, -18). And we consistently carry out (again mentally or on a draft) addition, to the second line we add the first line, already multiplied by -2:

The result is written in the second line:

Similarly, we deal with the third line (3, 2, -5, -1). To get zero in the first position, you need to the third line add the first line multiplied by -3. Mentally or on a draft, we multiply the first line by -3: (-3, -6, 3, -27). And to the third line we add the first line multiplied by -3:

The result is written in the third line:

In practice, these actions are usually performed verbally and written down in one step:

No need to count everything at once and at the same time. The order of calculations and "insertion" of results consistent and usually like this: first we rewrite the first line, and puff ourselves quietly - CONSISTENTLY and ATTENTIVELY:
And I have already considered the mental course of the calculations themselves above.

In this example, this is easy to do, we divide the second line by -5 (since all numbers there are divisible by 5 without a remainder). At the same time, we divide the third line by -2, because the smaller the number, the simpler the solution:

At the final stage of elementary transformations, one more zero must be obtained here:

For this to the third line we add the second line, multiplied by -2:
Try to parse this action yourself - mentally multiply the second line by -2 and carry out the addition.

The last action performed is the hairstyle of the result, divide the third line by 3.

As a result of elementary transformations, an equivalent initial system of linear equations was obtained: Cool.

Now the reverse course of the Gaussian method comes into play. The equations "unwind" from the bottom up.

In the third equation, we already have the finished result:

Let's look at the second equation: . The meaning of "z" is already known, thus:

And finally, the first equation: . "Y" and "Z" are known, the matter is small:

Answer:

As has been repeatedly noted, for any system of equations, it is possible and necessary to check the found solution, fortunately, this is not difficult and fast.

Example 2

This is an example for self-solving, a sample of finishing and an answer at the end of the lesson.

It should be noted that your course of action may not coincide with my course of action, and this is a feature of the Gauss method. But the answers must be the same!

Example 3

Solve a system of linear equations using the Gauss method

We look at the upper left "step". There we should have a unit. The problem is that there are no ones in the first column at all, so nothing can be solved by rearranging the rows. In such cases, the unit must be organized using an elementary transformation. This can usually be done in several ways. I did this: (1) To the first line we add the second line, multiplied by -1. That is, we mentally multiplied the second line by -1 and performed the addition of the first and second lines, while the second line did not change.

Now at the top left "minus one", which suits us perfectly. Who wants to get +1 can perform an additional gesture: multiply the first line by -1 (change its sign).

(2) The first row multiplied by 5 was added to the second row. The first row multiplied by 3 was added to the third row.

(3) The first line was multiplied by -1, in principle, this is for beauty. The sign of the third line was also changed and moved to the second place, thus, on the second “step, we had the desired unit.

(4) The second line multiplied by 2 was added to the third line.

(5) The third row was divided by 3.

A bad sign that indicates a calculation error (less often a typo) is a “bad” bottom line. That is, if we got something like below, and, accordingly, , then with a high degree of probability it can be argued that an error was made in the course of elementary transformations.

We charge the reverse move, in the design of examples, the system itself is often not rewritten, and the equations are “taken directly from the given matrix”. The reverse move, I remind you, works from the bottom up. Yes, here is a gift:

Answer: .

Example 4

Solve a system of linear equations using the Gauss method

This is an example for an independent solution, it is somewhat more complicated. It's okay if someone gets confused. Full solution and design sample at the end of the lesson. Your solution may differ from mine.

In the last part, we consider some features of the Gauss algorithm. The first feature is that sometimes some variables are missing in the equations of the system, for example: How to correctly write the augmented matrix of the system? I already talked about this moment in the lesson. Cramer's rule. Matrix method. In the expanded matrix of the system, we put zeros in place of the missing variables: By the way, this is a fairly easy example, since there is already one zero in the first column, and there are fewer elementary transformations to perform.

The second feature is this. In all the examples considered, we placed either –1 or +1 on the “steps”. Could there be other numbers? In some cases they can. Consider the system: .

Here on the upper left "step" we have a deuce. But we notice the fact that all the numbers in the first column are divisible by 2 without a remainder - and another two and six. And the deuce at the top left will suit us! At the first step, you need to perform the following transformations: add the first line multiplied by -1 to the second line; to the third line add the first line multiplied by -3. Thus, we will get the desired zeros in the first column.

Or another hypothetical example: . Here, the triple on the second “rung” also suits us, since 12 (the place where we need to get zero) is divisible by 3 without a remainder. It is necessary to carry out the following transformation: to the third line, add the second line, multiplied by -4, as a result of which the zero we need will be obtained.

The Gauss method is universal, but there is one peculiarity. You can confidently learn how to solve systems by other methods (Cramer's method, matrix method) literally from the first time - there is a very rigid algorithm. But in order to feel confident in the Gauss method, you should “fill your hand” and solve at least 5-10 ten systems. Therefore, at first there may be confusion, errors in calculations, and there is nothing unusual or tragic in this.

Rainy autumn weather outside the window .... Therefore, for everyone, a more complex example for an independent solution:

Example 5

Solve a system of 4 linear equations with four unknowns using the Gauss method.

Such a task in practice is not so rare. I think that even a teapot who has studied this page in detail understands the algorithm for solving such a system intuitively. Basically the same - just more action.

The cases when the system has no solutions (inconsistent) or has infinitely many solutions are considered in the lesson. Incompatible systems and systems with a common solution. There you can fix the considered algorithm of the Gauss method.

Wish you luck!

Solutions and answers:

Example 2: Decision : Let us write down the extended matrix of the system and, using elementary transformations, bring it to a stepped form.
Performed elementary transformations: (1) The first row was added to the second row, multiplied by -2. The first line was added to the third line, multiplied by -1. Attention! Here it may be tempting to subtract the first from the third line, I strongly do not recommend subtracting - the risk of error greatly increases. We just fold! (2) The sign of the second line was changed (multiplied by -1). The second and third lines have been swapped. note that on the “steps” we are satisfied not only with one, but also with -1, which is even more convenient. (3) To the third line, add the second line, multiplied by 5. (4) The sign of the second line was changed (multiplied by -1). The third line was divided by 14.

Reverse move:

Answer : .

Example 4: Decision : We write the extended matrix of the system and, using elementary transformations, bring it to a step form:

Conversions performed: (1) The second line was added to the first line. Thus, the desired unit is organized on the upper left “step”. (2) The first row multiplied by 7 was added to the second row. The first row multiplied by 6 was added to the third row.

With the second "step" everything is worse , the "candidates" for it are the numbers 17 and 23, and we need either one or -1. Transformations (3) and (4) will be aimed at obtaining the desired unit (3) The second line was added to the third line, multiplied by -1. (4) The third line, multiplied by -3, was added to the second line. The necessary thing on the second step is received . (5) To the third line added the second, multiplied by 6. (6) The second row was multiplied by -1, the third row was divided by -83.

Reverse move:

Answer :

Example 5: Decision : Let us write down the matrix of the system and, using elementary transformations, bring it to a stepwise form:

Conversions performed: (1) The first and second lines have been swapped. (2) The first row was added to the second row, multiplied by -2. The first line was added to the third line, multiplied by -2. The first line was added to the fourth line, multiplied by -3. (3) The second line multiplied by 4 was added to the third line. The second line multiplied by -1 was added to the fourth line. (4) The sign of the second line has been changed. The fourth line was divided by 3 and placed instead of the third line. (5) The third line was added to the fourth line, multiplied by -5.

Reverse move:

Answer :

Let a system of linear algebraic equations be given, which must be solved (find such values ​​of the unknowns хi that turn each equation of the system into an equality).

We know that a system of linear algebraic equations can:

1) Have no solutions (be incompatible).
2) Have infinitely many solutions.
3) Have a unique solution.

As we remember, Cramer's rule and the matrix method are unsuitable in cases where the system has infinitely many solutions or is inconsistent. Gauss methodthe most powerful and versatile tool for finding solutions to any system of linear equations, which in every case lead us to the answer! The algorithm of the method in all three cases works the same way. If the Cramer and matrix methods require knowledge of determinants, then the application of the Gauss method requires knowledge of only arithmetic operations, which makes it accessible even to primary school students.

Extended matrix transformations ( this is the matrix of the system - a matrix composed only of the coefficients of the unknowns, plus a column of free terms) systems of linear algebraic equations in the Gauss method:

1) with troky matrices can rearrange places.

2) if there are (or are) proportional (as a special case - identical) rows in the matrix, then it follows delete from the matrix, all these rows except one.

3) if a zero row appeared in the matrix during the transformations, then it also follows delete.

4) the row of the matrix can multiply (divide) to any number other than zero.

5) to the row of the matrix, you can add another string multiplied by a number, different from zero.

In the Gauss method, elementary transformations do not change the solution of the system of equations.

The Gauss method consists of two stages:

  1. "Direct move" - ​​using elementary transformations, bring the extended matrix of the system of linear algebraic equations to a "triangular" stepped form: the elements of the extended matrix located below the main diagonal are equal to zero (top-down move). For example, to this kind:

To do this, perform the following steps:

1) Let us consider the first equation of a system of linear algebraic equations and the coefficient at x 1 is equal to K. The second, third, etc. we transform the equations as follows: we divide each equation (coefficients for unknowns, including free terms) by the coefficient for unknown x 1, which is in each equation, and multiply by K. After that, subtract the first from the second equation (coefficients for unknowns and free terms). We get at x 1 in the second equation the coefficient 0. From the third transformed equation we subtract the first equation, so until all equations except the first, with unknown x 1, will not have a coefficient 0.

2) Move on to the next equation. Let this be the second equation and the coefficient at x 2 is equal to M. With all the "subordinate" equations, we proceed as described above. Thus, "under" the unknown x 2 in all equations will be zeros.

3) We pass to the next equation and so on until one last unknown and transformed free term remains.

  1. The "reverse move" of the Gauss method is to obtain a solution to a system of linear algebraic equations (the "bottom-up" move). From the last "lower" equation we get one first solution - the unknown x n. To do this, we solve the elementary equation A * x n \u003d B. In the example above, x 3 \u003d 4. We substitute the found value in the “upper” next equation and solve it with respect to the next unknown. For example, x 2 - 4 \u003d 1, i.e. x 2 \u003d 5. And so on until we find all the unknowns.

Example.

We solve the system of linear equations using the Gauss method, as some authors advise:

We write the extended matrix of the system and, using elementary transformations, bring it to a step form:

We look at the upper left "step". There we should have a unit. The problem is that there are no ones in the first column at all, so nothing can be solved by rearranging the rows. In such cases, the unit must be organized using an elementary transformation. This can usually be done in several ways. Let's do it like this:
1 step . To the first line we add the second line, multiplied by -1. That is, we mentally multiplied the second line by -1 and performed the addition of the first and second lines, while the second line did not change.

Now at the top left "minus one", which suits us perfectly. Whoever wants to get +1 can perform an additional action: multiply the first line by -1 (change its sign).

2 step . The first line multiplied by 5 was added to the second line. The first line multiplied by 3 was added to the third line.

3 step . The first line was multiplied by -1, in principle, this is for beauty. The sign of the third line was also changed and moved to the second place, thus, on the second “step, we had the desired unit.

4 step . To the third line, add the second line, multiplied by 2.

5 step . The third line is divided by 3.

A sign that indicates an error in calculations (less often a typo) is a “bad” bottom line. That is, if we got something like (0 0 11 | 23) below, and, accordingly, 11x 3 = 23, x 3 = 23/11, then with a high degree of probability we can say that a mistake was made during elementary transformations.

We perform a reverse move, in the design of examples, the system itself is often not rewritten, and the equations are “taken directly from the given matrix”. The reverse move, I remind you, works "from the bottom up." In this example, the gift turned out:

x 3 = 1
x 2 = 3
x 1 + x 2 - x 3 \u003d 1, therefore x 1 + 3 - 1 \u003d 1, x 1 \u003d -1

Answer:x 1 \u003d -1, x 2 \u003d 3, x 3 \u003d 1.

Let's solve the same system using the proposed algorithm. We get

4 2 –1 1
5 3 –2 2
3 2 –3 0

Divide the second equation by 5 and the third by 3. We get:

4 2 –1 1
1 0.6 –0.4 0.4
1 0.66 –1 0

Multiply the second and third equations by 4, we get:

4 2 –1 1
4 2,4 –1.6 1.6
4 2.64 –4 0

Subtract the first equation from the second and third equations, we have:

4 2 –1 1
0 0.4 –0.6 0.6
0 0.64 –3 –1

Divide the third equation by 0.64:

4 2 –1 1
0 0.4 –0.6 0.6
0 1 –4.6875 –1.5625

Multiply the third equation by 0.4

4 2 –1 1
0 0.4 –0.6 0.6
0 0.4 –1.875 –0.625

Subtract the second equation from the third equation, we get the “stepped” augmented matrix:

4 2 –1 1
0 0.4 –0.6 0.6
0 0 –1.275 –1.225

Thus, since an error accumulated in the process of calculations, we get x 3 \u003d 0.96, or approximately 1.

x 2 \u003d 3 and x 1 \u003d -1.

Solving in this way, you will never get confused in the calculations and, despite the calculation errors, you will get the result.

This method of solving a system of linear algebraic equations is easily programmable and does not take into account the specific features of the coefficients for unknowns, because in practice (in economic and technical calculations) one has to deal with non-integer coefficients.

Wish you luck! See you in class! Tutor.

blog.site, with full or partial copying of the material, a link to the source is required.

Ever since the beginning of the 16th-18th centuries, mathematicians began to intensively study the functions, thanks to which so much has changed in our lives. Computer technology without this knowledge simply would not exist. To solve complex problems, linear equations and functions, various concepts, theorems and solution techniques have been created. One of such universal and rational methods and methods for solving linear equations and their systems was the Gauss method. Matrices, their rank, determinant - everything can be calculated without using complex operations.

What is SLAU

In mathematics, there is the concept of SLAE - a system of linear algebraic equations. What does she represent? This is a set of m equations with the required n unknowns, usually denoted as x, y, z, or x 1 , x 2 ... x n, or other symbols. To solve this system by the Gaussian method means to find all unknown unknowns. If a system has the same number of unknowns and equations, then it is called an n-th order system.

The most popular methods for solving SLAE

In educational institutions of secondary education, various methods of solving such systems are being studied. Most often, these are simple equations consisting of two unknowns, so any existing method for finding the answer to them will not take much time. It can be like a substitution method, when another equation is derived from one equation and substituted into the original one. Or term by term subtraction and addition. But the Gauss method is considered the easiest and most universal. It makes it possible to solve equations with any number of unknowns. Why is this technique considered rational? Everything is simple. The matrix method is good because it does not require several times to rewrite unnecessary characters in the form of unknowns, it is enough to do arithmetic operations on the coefficients - and you will get a reliable result.

Where are SLAEs used in practice?

The solution of SLAE are the points of intersection of lines on the graphs of functions. In our high-tech computer age, people who are closely involved in the development of games and other programs need to know how to solve such systems, what they represent and how to check the correctness of the resulting result. Most often, programmers develop special linear algebra calculators, this includes a system of linear equations. The Gauss method allows you to calculate all existing solutions. Other simplified formulas and techniques are also used.

SLAE compatibility criterion

Such a system can only be solved if it is compatible. For clarity, we present the SLAE in the form Ax=b. It has a solution if rang(A) equals rang(A,b). In this case, (A,b) is an extended form matrix that can be obtained from matrix A by rewriting it with free terms. It turns out that solving linear equations using the Gaussian method is quite easy.

Perhaps some notation is not entirely clear, so it is necessary to consider everything with an example. Let's say there is a system: x+y=1; 2x-3y=6. It consists of only two equations in which there are 2 unknowns. The system will have a solution only if the rank of its matrix is ​​equal to the rank of the augmented matrix. What is a rank? This is the number of independent lines of the system. In our case, the rank of the matrix is ​​2. Matrix A will consist of the coefficients located near the unknowns, and the coefficients behind the “=” sign will also fit into the expanded matrix.

Why SLAE can be represented in matrix form

Based on the compatibility criterion according to the proven Kronecker-Capelli theorem, the system of linear algebraic equations can be represented in matrix form. Using the Gaussian cascade method, you can solve the matrix and get the only reliable answer for the entire system. If the rank of an ordinary matrix is ​​equal to the rank of its extended matrix, but less than the number of unknowns, then the system has an infinite number of answers.

Matrix transformations

Before moving on to solving matrices, it is necessary to know what actions can be performed on their elements. There are several elementary transformations:

  • By rewriting the system into a matrix form and solving it, it is possible to multiply all the elements of the series by the same coefficient.
  • In order to convert a matrix to canonical form, two parallel rows can be swapped. The canonical form implies that all elements of the matrix that are located along the main diagonal become ones, and the remaining ones become zeros.
  • The corresponding elements of the parallel rows of the matrix can be added one to the other.

Jordan-Gauss method

The essence of solving systems of linear homogeneous and inhomogeneous equations by the Gauss method is to gradually eliminate the unknowns. Let's say we have a system of two equations in which there are two unknowns. To find them, you need to check the system for compatibility. The Gaussian equation is solved very simply. It is necessary to write out the coefficients located near each unknown in a matrix form. To solve the system, you need to write out the augmented matrix. If one of the equations contains a smaller number of unknowns, then "0" must be put in place of the missing element. All known transformation methods are applied to the matrix: multiplication, division by a number, adding the corresponding elements of the rows to each other, and others. It turns out that in each row it is necessary to leave one variable with the value "1", the rest should be reduced to zero. For a more accurate understanding, it is necessary to consider the Gauss method with examples.

A simple example of solving a 2x2 system

To begin with, let's take a simple system of algebraic equations, in which there will be 2 unknowns.

Let's rewrite it in an augmented matrix.

To solve this system of linear equations, only two operations are required. We need to bring the matrix to the canonical form so that there are units along the main diagonal. So, translating from the matrix form back into the system, we get the equations: 1x+0y=b1 and 0x+1y=b2, where b1 and b2 are the answers obtained in the process of solving.

  1. The first step in solving the augmented matrix will be as follows: the first row must be multiplied by -7 and the corresponding elements added to the second row, respectively, in order to get rid of one unknown in the second equation.
  2. Since the solution of equations by the Gauss method implies bringing the matrix to the canonical form, then it is necessary to do the same operations with the first equation and remove the second variable. To do this, we subtract the second line from the first and get the necessary answer - the solution of the SLAE. Or, as shown in the figure, we multiply the second row by a factor of -1 and add the elements of the second row to the first row. This is the same.

As you can see, our system is solved by the Jordan-Gauss method. We rewrite it in the required form: x=-5, y=7.

An example of solving SLAE 3x3

Suppose we have a more complex system of linear equations. The Gauss method makes it possible to calculate the answer even for the most seemingly confusing system. Therefore, in order to delve deeper into the calculation methodology, we can move on to a more complex example with three unknowns.

As in the previous example, we rewrite the system in the form of an extended matrix and begin to bring it to the canonical form.

To solve this system, you will need to perform much more actions than in the previous example.

  1. First you need to make in the first column one single element and the rest zeros. To do this, multiply the first equation by -1 and add the second equation to it. It is important to remember that we rewrite the first line in its original form, and the second - already in a modified form.
  2. Next, we remove the same first unknown from the third equation. To do this, we multiply the elements of the first row by -2 and add them to the third row. Now the first and second lines are rewritten in their original form, and the third - already with changes. As you can see from the result, we got the first one at the beginning of the main diagonal of the matrix and the rest are zeros. A few more actions, and the system of equations by the Gauss method will be reliably solved.
  3. Now you need to do operations on other elements of the rows. The third and fourth steps can be combined into one. We need to divide the second and third lines by -1 to get rid of the negative ones on the diagonal. We have already brought the third line to the required form.
  4. Next, we canonicalize the second line. To do this, we multiply the elements of the third row by -3 and add them to the second line of the matrix. It can be seen from the result that the second line is also reduced to the form we need. It remains to do a few more operations and remove the coefficients of the unknowns from the first row.
  5. In order to make 0 from the second element of the row, you need to multiply the third row by -3 and add it to the first row.
  6. The next decisive step is to add the necessary elements of the second row to the first row. So we get the canonical form of the matrix, and, accordingly, the answer.

As you can see, the solution of equations by the Gauss method is quite simple.

An example of solving a 4x4 system of equations

Some more complex systems of equations can be solved by the Gaussian method using computer programs. It is necessary to drive coefficients for unknowns into existing empty cells, and the program will calculate the required result step by step, describing each action in detail.

The step-by-step instructions for solving such an example are described below.

In the first step, free coefficients and numbers for unknowns are entered into empty cells. Thus, we get the same augmented matrix that we write by hand.

And all the necessary arithmetic operations are performed to bring the extended matrix to the canonical form. It must be understood that the answer to a system of equations is not always integers. Sometimes the solution can be from fractional numbers.

Checking the correctness of the solution

The Jordan-Gauss method provides for checking the correctness of the result. In order to find out whether the coefficients are calculated correctly, you just need to substitute the result into the original system of equations. The left side of the equation must match the right side, which is behind the equals sign. If the answers do not match, then you need to recalculate the system or try to apply another method of solving SLAE known to you, such as substitution or term-by-term subtraction and addition. After all, mathematics is a science that has a huge number of different methods of solving. But remember: the result should always be the same, no matter what solution method you used.

Gauss method: the most common errors in solving SLAE

During the solution of linear systems of equations, errors most often occur, such as incorrect transfer of coefficients to a matrix form. There are systems in which some unknowns are missing in one of the equations, then, transferring the data to the expanded matrix, they can be lost. As a result, when solving this system, the result may not correspond to the real one.

Another of the main mistakes can be incorrect writing out the final result. It must be clearly understood that the first coefficient will correspond to the first unknown from the system, the second - to the second, and so on.

The Gauss method describes in detail the solution of linear equations. Thanks to him, it is easy to perform the necessary operations and find the right result. In addition, this is a universal tool for finding a reliable answer to equations of any complexity. Maybe that is why it is so often used in solving SLAE.