A system of linear equations is given, the Gaussian method. Solving systems of linear equations by the Gaussian method

One of the universal and effective methods for solving linear algebraic systems is gauss method , consisting in the successive elimination of unknowns.

Recall that two systems are called equivalent (equivalent) if the sets of their solutions coincide. In other words, systems are equivalent if each solution to one of them is a solution to the other and vice versa. Equivalent systems are obtained when elementary transformations equations of the system:

    multiplying both sides of the equation by a nonzero number;

    adding to some equation the corresponding parts of another equation, multiplied by a number other than zero;

    permutation of two equations.

Let a system of equations be given

The process of solving this system using the Gauss method consists of two stages. At the first stage (direct run), the system is reduced by elementary transformations to stepwise , or triangular mind, and at the second stage (reverse) there is a sequential, starting from the last variable by the number of the variable, the determination of unknowns from the resulting step system.

Suppose that the coefficient of this system
, otherwise in the system the first row can be swapped with any other row so that the coefficient at was nonzero.

We transform the system by eliminating the unknown in all equations except the first. To do this, multiply both sides of the first equation by and add it term by term with the second equation of the system. Then we multiply both sides of the first equation by and add it to the third equation of the system. Continuing this process, we obtain an equivalent system

Here
- new values \u200b\u200bof coefficients and free terms, which are obtained after the first step.

Similarly, considering the main element
, exclude the unknown from all equations of the system, except for the first and second. We will continue this process as long as possible, as a result we will get a step system

,

where ,
,…,- the main elements of the system
.

If, in the process of reducing the system to a stepwise form, equations appear, i.e., equalities of the form
, they are discarded, since they are satisfied by any sets of numbers
... If at
an equation of the form that has no solutions appears, this indicates the inconsistency of the system.

In the reverse motion, the first unknown is expressed from the last equation of the transformed step system through all the other unknowns
who call free . Then the variable expression from the last equation of the system is substituted into the penultimate equation and the variable is expressed from it
... The variables are defined in a similar way
... Variables
expressed in terms of free variables are called basic (addicted). The result is a general solution to a system of linear equations.

To find private solution system, free unknown
in the general solution arbitrary values \u200b\u200bare assigned and the values \u200b\u200bof the variables are calculated
.

It is technically more convenient to subject not the equations of the system themselves to elementary transformations, but the extended matrix of the system

.

Gauss's method is a universal method that allows solving not only square, but also rectangular systems in which the number of unknowns
not equal to the number of equations
.

The advantage of this method also lies in the fact that in the process of solving we simultaneously investigate the system for compatibility, since, by giving the extended matrix
stepwise, it is easy to determine the ranks of the matrix and extended matrix
and apply the Kronecker - Capelli theorem .

Example 2.1Using the Gauss method, solve the system

Decision... Number of equations
and the number of unknowns
.

Let us compose the extended matrix of the system by assigning to the right of the matrix of coefficients free member column .

Let's give a matrix to a triangular view; for this, we will get "0" below the elements on the main diagonal using elementary transformations.

To get "0" at the second position of the first column, multiply the first row by (-1) and add to the second row.

We write this transformation as a number (-1) against the first line and denote it by an arrow going from the first line to the second line.

To get "0" in the third position of the first column, multiply the first row by (-3) and add to the third row; show this action with an arrow going from the first line to the third.




.

In the resulting matrix, written as the second in the chain of matrices, we get "0" in the second column in the third position. To do this, multiply the second line by (-4) and add to the third. In the resulting matrix, we multiply the second row by (-1), and divide the third by (-8). All elements of this matrix lying below the diagonal elements are zeros.

Because , the system is collaborative and specific.

The system of equations corresponding to the last matrix has a triangular form:

From the last (third) equation
... Substitute in the second equation and get
.

Substitute
and
into the first equation, we find


.

One of the simplest ways to solve a system of linear equations is a technique based on calculating determinants ( cramer's rule). Its advantage is that it allows you to immediately record the solution, it is especially convenient in cases where the coefficients of the system are not numbers, but some kind of parameters. Its disadvantage is the cumbersomeness of calculations in the case of a large number of equations; moreover, Cramer's rule is not directly applicable to systems in which the number of equations does not coincide with the number of unknowns. In such cases, usually apply gauss method.

Systems of linear equations that have the same set of solutions are called equivalent... Obviously, the set of solutions to a linear system will not change if some equations are interchanged, or one of the equations is multiplied by some nonzero number, or if one equation is added to another.

Gauss method (method of successive elimination of unknowns) lies in the fact that with the help of elementary transformations the system is reduced to an equivalent system of a step type. First, using the 1st equation, the x 1 of all subsequent equations of the system. Then, using the 2nd equation, x 2 of the 3rd and all subsequent equations. This process, called by the direct Gauss method, continues until only one unknown remains on the left side of the last equation x n... After that, backward Gaussian method - solving the last equation, we find x n; after that, using this value, from the penultimate equation we calculate x n –1, etc. We find the last x 1 from the first equation.

It is convenient to carry out Gaussian transformations by performing transformations not with the equations themselves, but with matrices of their coefficients. Consider the matrix:

called matrix extended system, because in it, in addition to the main matrix of the system, a column of free terms is included. Gauss's method is based on reducing the main matrix of the system to a triangular form (or trapezoidal form in the case of non-square systems) using elementary transformations of the rows (!) Of the extended matrix of the system.

Example 5.1. Solve the system using the Gaussian method:

Decision... Let us write out the extended matrix of the system and, using the first row, after that we will zero out the remaining elements:

we get zeros in the 2nd, 3rd and 4th rows of the first column:


Now you need all the elements in the second column below the 2nd row to be equal to zero. To do this, you can multiply the second line by –4/7 and add to the 3rd line. However, in order not to deal with fractions, we will create a unit in the 2nd row of the second column and only

Now, to get a triangular matrix, you need to zero out the element of the fourth row of the 3rd column, for this you can multiply the third row by 8/54 and add it to the fourth. However, in order not to deal with fractions, we will swap the positions of the 3rd and 4th rows and the 3rd and 4th columns, and only after that we will zero out the specified element. Note that when the columns are rearranged, the corresponding variables are swapped and you need to remember this; other elementary transformations with columns (addition and multiplication by a number) cannot be performed!


The last simplified matrix corresponds to a system of equations equivalent to the original one:

Hence, using the reverse course of the Gauss method, we find from the fourth equation x 3 \u003d –1; from the third x 4 \u003d –2, from the second x 2 \u003d 2 and from the first equation x 1 \u003d 1. In matrix form, the answer is written as

We considered the case when the system is definite, i.e. when there is only one solution. Let's see what happens if the system is inconsistent or uncertain.

Example 5.2. Investigate the system using the Gaussian method:

Decision... Write out and transform the extended system matrix

We write down a simplified system of equations:

Here, in the last equation, it turned out that 0 \u003d 4, i.e. contradiction. Consequently, the system has no solution, i.e. she inconsistent. à

Example 5.3. Investigate and solve the system using the Gaussian method:

Decision... We write out and transform the extended matrix of the system:

As a result of the transformations, the last line contains only zeros. This means that the number of equations has decreased by one:

Thus, after simplifications, there are two equations, and there are four unknowns, i.e. two unknown "extra". Let it be "superfluous", or, as they say, free variableswill be x 3 and x 4 . Then

Assuming x 3 = 2a and x 4 = b, we get x 2 = 1–a and x 1 = 2ba; or in matrix form

A solution written in this way is called common, since by giving the parameters a and b different values, all possible solutions of the system can be described. a

This online calculator solves a system of linear equations (SLE) using the Gaussian method. A detailed solution is given. Select the number of variables and the number of equations to calculate. Then enter the data into the cells and click on the "Calculate."

x 1

+x 2

+x 3

x 1

+x 2

+x 3

x 1

+x 2

+x 3

=

=

=

Representation of numbers:

Whole numbers and / or Common fractions
Whole numbers and / or Decimal fractions

Number of digits after decimal point

×

Warning

Clear all cells?

Close Clear

Data entry instructions. Numbers are entered as whole numbers (examples: 487, 5, -7623, etc.), decimal numbers (eg 67., 102.54, etc.) or fractions. The fraction must be typed in the form a / b, where a and b (b\u003e 0) are integers or decimal numbers. Examples 45/5, 6.6 / 76.4, -7 / 6.7, etc.

Gauss method

Gauss's method is a method of transition from the original system of linear equations (using equivalent transformations) to a system that is easier to solve than the original system.

Equivalent transformations of the system of linear equations are:

  • swapping two equations in the system,
  • multiplication of any equation in the system by a nonzero real number,
  • adding to one equation another equation multiplied by an arbitrary number.

Consider a system of linear equations:

(1)

Let us write system (1) in matrix form:

Ax \u003d b (2)
(3)

A- the matrix of the coefficients of the system is called, b - the right side of the restrictions, xIs the vector of variables to be found. Let rang ( A)=p.

Equivalent transformations do not change the rank of the coefficient matrix and the rank of the extended matrix of the system. Also, the set of solutions of the system does not change under equivalent transformations. The essence of the Gauss method is to reduce the coefficient matrix A to diagonal or stepped.

Let's construct the extended matrix of the system:

In the next step, we zero out all the elements in column 2, below the element. If the given element is zero, then we swap this line with the line lying below this line and having a nonzero element in the second column. Next, zero out all the elements in column 2 below the pivot a 22. To do this, add lines 3, ... m with line 2 multiplied by - a 32 /a 22 , ..., −a m2 / a 22, respectively. Continuing the procedure, we get a diagonal or stepped matrix. Let the resulting expanded matrix have the form:

(7)

Because rangA \u003d rang(A | b), then the set of solutions (7) is ( n − p) Is a variety. Consequently n − p unknowns can be chosen arbitrarily. The rest of the unknowns from system (7) are calculated as follows. From the last equation we express x p through the rest of the variables and insert into the previous expressions. Further, from the penultimate equation, we express x p − 1 through the rest of the variables and insert into the previous expressions, etc. Let's consider the Gauss method with specific examples.

Examples of solving a system of linear equations by the Gauss method

Example 1. Find the general solution of a system of linear equations by the Gauss method:

Let us denote by a ij elements i-th line and jth column.

a eleven . To do this, add rows 2,3 with row 1 multiplied by -2 / 3, -1 / 2, respectively:

Matrix type of record: Ax \u003d bwhere

Let us denote by a ij elements i-th line and jth column.

Eliminate the elements of the 1st column of the matrix below the element a eleven . To do this, add rows 2,3 with row 1 multiplied by -1 / 5, -6 / 5, respectively:

Divide each row of the matrix by the corresponding pivot (if a pivot exists):

where x 3 , x

Substituting the upper expressions into the lower ones, we get the solution.

Then the vector solution can be represented as follows:

where x 3 , x 4 - arbitrary real numbers.

Since the beginning of the XVI-XVIII centuries, mathematicians began to intensively study the functions, thanks to which so much has changed in our life. Computer technology would simply not exist without this knowledge. 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 techniques for solving linear equations and their systems was the Gauss method. Matrices, their rank, determinants - everything can be calculated without using complex operations.

What is SLAE

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

The most popular methods for solving SLAEs

In educational institutions of secondary education, they study various methods of solving such systems. Most often these are simple equations consisting of two unknowns, so any existing method for finding an answer to them will not take much time. It can be like a substitution method, when another is derived from one equation and substituted into the original. Or the method of term-by-term subtraction and addition. But the Gauss method is considered the easiest and most versatile. It makes it possible to solve equations with any number of unknowns. Why is this particular technique considered rational? It's simple. The good thing about the matrix method is that there is no need to rewrite unnecessary symbols in the form of unknowns several times, 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 the SLAE is the intersection points of the lines on the graphs of the functions. In our high-tech computer age, people who are closely associated with 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 result. Most often programmers develop special programs for calculating linear algebra, this includes a system of linear equations. Gauss's 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 represent the SLAE as Ax \u003d b. It has a solution if rang (A) equals rang (A, b). In this case (A, b) is a matrix of extended form, which can be obtained from matrix A by rewriting it with free terms. It turns out that solving linear equations by the Gauss method is quite easy.

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

Why SLAE can be represented in matrix form

Based on the compatibility criterion according to the proved Kronecker-Capelli theorem, the system of linear algebraic equations can be represented in matrix form. Applying the cascade Gaussian method, you can solve the matrix and get a single reliable answer for the entire system. If the rank of an ordinary matrix is \u200b\u200bequal 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, you need to know what actions can be performed on their elements. There are several elementary transformations:

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

Jordan-Gauss method

The essence of solving systems of linear homogeneous and inhomogeneous equations by the Gauss method is to gradually exclude unknowns. Let's say we have a system of two equations in which two unknowns. To find them, you need to check the system for compatibility. The Gaussian equation is very simple to solve. It is necessary to write down the coefficients located near each unknown in a matrix form. To solve the system, you need to write out an extended matrix. If one of the equations contains fewer 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 series 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 brought to zero form. For a more accurate understanding, it is necessary to consider the Gauss method by examples.

A simple example of a 2x2 system solution

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

Let's rewrite it into an extended 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 on the main diagonal. So, transferring from the matrix form back to the system, we get the equations: 1x + 0y \u003d b1 and 0x + 1y \u003d b2, where b1 and b2 are the answers obtained during the solution process.

  1. The first step in solving the extended matrix will be as follows: the first row must be multiplied by -7 and the corresponding elements must be 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, subtract the second row from the first and get the required answer - the solution of the SLAE. Or, as shown in the figure, multiply the second row by a factor of -1 and add the elements of the second row to the first row. It is the same.

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

An example of solving a SLAE 3x3

Suppose we have a more complex system of linear equations. Gauss's 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, one can proceed 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 one unit element in the first column and the remaining 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 in the changed one.
  2. Then we remove the same first unknown from the third equation. To do this, 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 - 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 remaining zeros. A few more steps, and the system of equations by the Gauss method will be reliably solved.
  3. Now it is necessary to perform operations on other elements of the rows. The third and fourth actions can be combined into one. You need to divide the second and third lines by -1 to get rid of the minus 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. The result shows 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. 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 will be adding 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 the 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 the coefficients for unknowns into the existing empty cells, and the program itself will step by step calculate the required result, describing in detail each action.

Below is a step-by-step instruction for solving such an example.

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

And all the necessary arithmetic operations are performed to bring the expanded matrix to the canonical form. It must be understood that the answer to a system of equations is not always whole numbers. Sometimes the solution can be 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 if 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 behind the equal sign. If the answers do not coincide, then you need to recalculate the system or try to apply to it another method known to you for solving SLAE, such as substitution or term-by-term subtraction and addition. After all, mathematics is a science that has a huge number of different solution methods. But remember: the result should always be the same, no matter which solution method you used.

Gauss method: the most common mistakes when solving SLAEs

During the solution of linear systems of equations, such errors as incorrect transfer of coefficients into matrix form most often occur. There are systems in which some unknowns are absent in one of the equations, then, transferring data to an 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 of the final result. It is necessary to clearly understand that the first coefficient will correspond to the first unknown from the system, the second to the second, and so on.

Gauss's method describes in detail the solution of linear equations. Thanks to him, it is easy to perform the necessary operations and find the correct result. In addition, it is a universal tool for finding a reliable answer to equations of any complexity. Perhaps that is why it is so often used when solving SLAEs.


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

  • firstly, there is no need to first investigate the system of equations for compatibility;
  • second, the Gauss method can 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 non-degenerate, 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 \u200b\u200bzero;
  • thirdly, the Gauss method leads to a result with a relatively small number of computational operations.

Brief overview of the article.

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

Next, we describe the Gauss method algorithm 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 Gauss method is also called the method of successive elimination of unknowns. Let's show detailed solutions of several examples.

In conclusion, let us consider the solution by the Gauss method of systems of linear algebraic equations, the main matrix of which is either rectangular or degenerate. The solution of such systems has some features, which we will analyze in detail with 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), and are free members.

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

The set of values \u200b\u200bof unknown variables for which all equations of the system turn into identities is called sLAE decision.

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

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

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

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

If to matrix A we add 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 expanded matrix is \u200b\u200bdenoted 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 degenerateif its determinant is zero. If, then the matrix A is called non-degenerate.

The next point should be discussed.

If you perform the following actions with a system of linear algebraic equations

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

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

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

  • permutation of two lines in places,
  • multiplication of all elements of any row of matrix T by a nonzero 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 you can proceed to the description of the Gauss method.

The solution of 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 non-degenerate, by the Gauss method.

What would we do at school if we received the task to find a solution to the system of equations .

Some would do that.

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

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

If we multiply both sides 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:

Substitute the resulting value x 2 \u003d 2 into the third equation and find the remaining unknown variable x 3:

Others would have done otherwise.

Let us solve the first equation of the system with respect to the unknown variable x 1 and substitute the obtained 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 in the third equation to exclude the unknown variable x 2 from it:

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

Familiar solutions, isn't it?

The most interesting thing here is that the second solution is essentially the method of successive elimination of unknowns, that is, the Gauss method. When we expressed unknown variables (first x 1, at the next stage x 2) and substituted them into the rest of the equations of the system, we thereby excluded them. We carried out the elimination until the moment when there was only one unknown variable left in the last equation. The process of successive elimination of unknowns is called by the direct Gauss method... After completing the direct move, we have the opportunity to calculate the unknown variable found in the last equation. With its help, from the penultimate equation we find the next unknown variable and so on. The process of sequentially finding unknown variables as we move from the last equation to the first is called backward Gaussian method.

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

Indeed, such a procedure also makes it possible to eliminate 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 SLAE the first equation does not contain the unknown variable x 1 (in other words, the coefficient in front of it is equal to zero). Therefore, we cannot solve the first equation of the system for x 1 to exclude this unknown variable from the rest of the equations. The way out of this situation is to rearrange the equations of the system. Since we consider systems of linear equations, the determinants of the main matrices of which are nonzero, then there is always 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.

Suppose we 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. Eliminate the unknown variable x 1 from all equations of the system, starting with the second. To do this, to the second equation of the system we add the first, multiplied by, to the third equation we add the first, multiplied by, and so on, to the n-th equation we add the first, multiplied by. The system of equations after such transformations takes the form

where, and .

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 in all other equations. Thus, the variable x 1 is excluded from all equations, starting with the second.

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

To do this, to the third equation of the system we add the second multiplied by, to the fourth equation we add the second multiplied by, and so on, to the n-th equation we add the second multiplied by. The system of equations after such transformations takes the form

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

Next, we proceed to the elimination of the unknown x 3, while we act 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 start 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 using an example.

Example.

by the Gauss method.

Decision.

The coefficient a 11 is nonzero, so we 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, add the left and right sides of the first equation to the left and right sides of the second, third and fourth equations, multiplied by, respectively, and:

The unknown variable x 1 has been excluded, go to excluding x 2. To the left and right sides of the third and fourth equations of the system, we add the left and right sides of the second equation, multiplied respectively by and :

To complete the direct course of the Gauss method, it remains for us 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 of the Gaussian method.

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

For verification, the obtained values \u200b\u200bof the unknown variables can be substituted 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 notation.

Example.

Find the solution to the system of equations by the Gauss method.

Decision.

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

The direct course of the Gauss method here involves reducing the extended matrix of the system to a trapezoidal form using elementary transformations. This process is similar to the elimination of unknown variables, which we performed with a coordinate system. Now you will be convinced of this.

Let's transform the matrix so that all elements in the first column, starting from the second, become zero. To do this, add to the elements of the second, third and fourth lines the corresponding elements of the first line 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 will match the elimination of the unknown variable x 2. To do this, add the corresponding elements of the first row of the matrix to the elements of the third and fourth rows, multiplied by and :

It remains to eliminate 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, 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 go back. In matrix form, the inverse of the Gaussian method assumes 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 the Gaussian forward transforms, but they 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 lines the corresponding elements of the last line, 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 of the Gauss method, we add the corresponding elements of the second row, multiplied by:

The resulting matrix corresponds to the system of equations , whence we find 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 completely incorrect results. We recommend not rounding decimals. It is better to move from decimal fractions to ordinary fractions.

Example.

Solve a system of three equations using the Gaussian method .

Decision.

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

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

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

This completes the direct run of the Gauss method (it is not necessary to exclude y from the third equation, since this unknown variable no longer exists).

We proceed to the reverse.

From the last equation we find ,
from the penultimate


from the first equation we have

Answer:

X \u003d 10, y \u003d 5, z \u003d -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 basic matrix of the system is degenerate, by the Gauss method.

Systems of equations, the basic matrix of which is rectangular or square degenerate, may not have solutions, may have a unique solution, and may have an infinite set of solutions.

Now we will figure out how the Gauss method allows us to establish the compatibility or inconsistency of a system of linear equations, and in the case of its compatibility, to 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, you should dwell in detail on some situations that may arise.

We pass to the most important stage.

So, let us assume that the system of linear algebraic equations after the completion of the direct course of the Gauss method took the form and not a single equation can be reduced to (in this case, we would conclude that the system is incompatible). A logical question arises: "What to do next?"

Let us write out the unknown variables, which are in the first place of all equations of the resulting system:

In our example, these are x 1, x 4 and x 5. In the left-hand sides 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, the remaining terms are transferred to the right-hand side of the equations with the opposite sign:

Let us assign arbitrary values \u200b\u200bto the unknown variables that are in the right-hand sides of the equations, where - arbitrary numbers:

After that, numbers are found in the right-hand sides of all the equations of our SLAE, and we can go over to the reverse of the Gauss method.

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

The solution to the system of equations is a set of values \u200b\u200bof 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 a homogeneous system of linear algebraic equations by the Gauss method.

Decision.

Eliminate the unknown variable x from the second and third equations of the system. To do this, we add to the left and right sides of the second equation, respectively, the left and right sides of the first equation, multiplied by, and to the left and right sides of the third equation - the left and right sides 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 on the left side of the equations of the system only the terms containing the unknown variables x and y, and transfer the terms with the unknown variable z to the right side: