In the first part we looked a little theoretical material, the substitution method, as well as the method of term-by-term addition of system equations. I recommend everyone who accessed the site through this page to read the first part. Perhaps some visitors will find the material too simple, but as we solve the systems linear equations I made a number of very important comments and conclusions regarding the solution of mathematical problems in general.

Now we will analyze Cramer’s rule, as well as solving a system of linear equations using inverse matrix(matrix method). All materials are presented simply, in detail and clearly; almost all readers will be able to learn how to solve systems using the above methods.

First, we will take a closer look at Cramer's rule for a system of two linear equations in two unknowns. For what? – After all, the simplest system can be solved using the school method, the method of term-by-term addition!

The fact is that, albeit sometimes, such a task occurs - to solve a system of two linear equations with two unknowns using Cramer's formulas. Secondly, a simpler example will help you understand how to use Cramer's rule to more complex case– systems of three equations with three unknowns.

In addition, there are systems of linear equations with two variables, which are advisable to solve using Cramer’s rule!

Consider the system of equations

At the first step, we calculate the determinant, it is called main determinant of the system.

Gauss method.

If , then the system has a unique solution, and to find the roots we must calculate two more determinants:
And

In practice, the above qualifiers can also be denoted by a Latin letter.

We find the roots of the equation using the formulas:
,

Example 7

Solve a system of linear equations

Solution: We see that the coefficients of the equation are quite large, on the right side there are decimals with a comma. The comma is a rather rare guest in practical tasks in mathematics; I took this system from an econometric problem.

How to solve such a system? You can try to express one variable in terms of another, but in this case you will probably end up with terrible fancy fractions that are extremely inconvenient to work with, and the design of the solution will look simply terrible. You can multiply the second equation by 6 and subtract term by term, but the same fractions will arise here too.

What to do? In such cases, Cramer's formulas come to the rescue.

;

;

Answer: ,

Both roots have infinite tails and are found approximately, which is quite acceptable (and even commonplace) for econometrics problems.

Comments are not needed here, since the task is solved using ready-made formulas, however, there is one caveat. When to use this method, compulsory A fragment of the task design is the following fragment: “This means that the system has a unique solution”. Otherwise, the reviewer may punish you for disrespect for Cramer's theorem.

It would not be superfluous to check, which is convenient to carry out on a calculator: we substitute approximate values ​​in left side each equation of the system. As a result, with a small error, you should get numbers that are on the right sides.

Example 8

Present the answer in ordinary improper fractions. Do a check.

This is an example for you to solve on your own (an example of the final design and the answer at the end of the lesson).

Let's move on to consider Cramer's rule for a system of three equations with three unknowns:

We find the main determinant of the system:

If , then the system has infinitely many solutions or is inconsistent (has no solutions). In this case, Cramer's rule will not help; you need to use the Gauss method.

If , then the system has a unique solution and to find the roots we must calculate three more determinants:
, ,

And finally, the answer is calculated using the formulas:

As you can see, the “three by three” case is fundamentally no different from the “two by two” case; the column of free terms sequentially “walks” from left to right along the columns of the main determinant.

Example 9

Solve the system using Cramer's formulas.

Solution: Let's solve the system using Cramer's formulas.

, which means the system has a unique solution.

Answer: .

Actually, here again there is nothing special to comment on, due to the fact that the solution follows ready-made formulas. But there are a couple of comments.

It happens that as a result of calculations, “bad” irreducible fractions are obtained, for example: .
I recommend the following “treatment” algorithm. If you don’t have a computer at hand, do this:

1) There may be an error in the calculations. As soon as you encounter a “bad” fraction, you immediately need to check Is the condition rewritten correctly?. If the condition is rewritten without errors, then you need to recalculate the determinants using expansion in another row (column).

2) If no errors are identified as a result of checking, then most likely there was a typo in the task conditions. In this case, calmly and CAREFULLY work through the task to the end, and then be sure to check and we draw it up on a clean sheet after the decision. Of course, checking a fractional answer is an unpleasant task, but it will be a disarming argument for the teacher, who really likes to give a minus for any bullshit like . How to handle fractions is described in detail in the answer to Example 8.

If you have a computer at hand, then use an automated program to check, which can be downloaded for free at the very beginning of the lesson. By the way, it is most profitable to use the program right away (even before starting the solution); you will immediately see the intermediate step where you made a mistake! The same calculator automatically calculates the solution to the system matrix method.

Second remark. From time to time there are systems in the equations of which some variables are missing, for example:

Here in the first equation there is no variable , in the second there is no variable . In such cases, it is very important to correctly and CAREFULLY write down the main determinant:
– zeros are placed in place of missing variables.
By the way, it is rational to open determinants with zeros according to the row (column) in which the zero is located, since there are noticeably fewer calculations.

Example 10

Solve the system using Cramer's formulas.

This is an example for an independent solution (a sample of the final design and the answer at the end of the lesson).

For the case of a system of 4 equations with 4 unknowns, Cramer’s formulas are written according to similar principles. You can see a live example in the lesson Properties of Determinants. Reducing the order of the determinant - five 4th order determinants are quite solvable. Although the task is already very reminiscent of a professor’s shoe on the chest of a lucky student.

Solving the system using an inverse matrix

The inverse matrix method is essentially special case matrix equation(See Example No. 3 of the specified lesson).

To study this section, you must be able to expand determinants, find the inverse of a matrix, and perform matrix multiplication. Relevant links will be provided as the explanations progress.

Example 11

Solve the system using the matrix method

Solution: Let's write the system in matrix form:
, Where

Please look at the system of equations and matrices. I think everyone understands the principle by which we write elements into matrices. The only comment: if some variables were missing from the equations, then zeros would have to be placed in the corresponding places in the matrix.

We find the inverse matrix using the formula:
, where is the transposed matrix algebraic additions corresponding matrix elements.

First, let's look at the determinant:

Here the determinant is expanded on the first line.

Attention! If , then the inverse matrix does not exist, and it is impossible to solve the system using the matrix method. In this case, the system is solved by the method of eliminating unknowns (Gauss method).

Now we need to calculate 9 minors and write them into the minors matrix

Reference: It is useful to know the meaning of double subscripts in linear algebra. The first digit is the number of the line in which the element is located. The second digit is the number of the column in which the element is located:

That is, a double subscript indicates that the element is in the first row, third column, and, for example, the element is in 3 row, 2 column

Let there be a square matrix of nth order

Matrix A -1 is called inverse matrix in relation to matrix A, if A*A -1 = E, where E is the identity matrix of the nth order.

Identity matrix- such a square matrix in which all the elements along the main diagonal, passing from the upper left corner to the lower right corner, are ones, and the rest are zeros, for example:

inverse matrix may exist only for square matrices those. for those matrices in which the number of rows and columns coincide.

Theorem for the existence condition of an inverse matrix

In order for a matrix to have an inverse matrix, it is necessary and sufficient that it be non-singular.

The matrix A = (A1, A2,...A n) is called non-degenerate, if the column vectors are linearly independent. The number of linearly independent column vectors of a matrix is ​​called the rank of the matrix. Therefore, we can say that in order for an inverse matrix to exist, it is necessary and sufficient that the rank of the matrix is ​​equal to its dimension, i.e. r = n.

Algorithm for finding the inverse matrix

  1. Write matrix A into the table for solving systems of equations using the Gaussian method and assign matrix E to it on the right (in place of the right-hand sides of the equations).
  2. Using Jordan transformations, reduce matrix A to a matrix consisting of unit columns; in this case, it is necessary to simultaneously transform the matrix E.
  3. If necessary, rearrange the rows (equations) of the last table so that under the matrix A of the original table you get the identity matrix E.
  4. Write down the inverse matrix A -1, which is located in the last table under the matrix E of the original table.
Example 1

For matrix A, find the inverse matrix A -1

Solution: We write matrix A and assign the identity matrix E to the right. Using Jordan transformations, we reduce matrix A to the identity matrix E. The calculations are given in Table 31.1.

Let's check the correctness of the calculations by multiplying the original matrix A and the inverse matrix A -1.

As a result of matrix multiplication, the identity matrix was obtained. Therefore, the calculations were performed correctly.

Answer:

Solving matrix equations

Matrix equations can look like:

AX = B, HA = B, AXB = C,

where A, B, C are the specified matrices, X is the desired matrix.

Matrix equations are solved by multiplying the equation by inverse matrices.

For example, to find the matrix from the equation, you need to multiply this equation by on the left.

Therefore, to find a solution to the equation, you need to find the inverse matrix and multiply it by the matrix on the right side of the equation.

Other equations are solved similarly.

Example 2

Solve the equation AX = B if

Solution: Since the inverse matrix is ​​equal to (see example 1)

Matrix method in economic analysis

Along with others, they are also used matrix methods. These methods are based on linear and vector-matrix algebra. Such methods are used for the purposes of analyzing complex and multidimensional economic phenomena. Most often, these methods are used when it is necessary to make a comparative assessment of the functioning of organizations and their structural divisions.

In the process of applying matrix analysis methods, several stages can be distinguished.

At the first stage a system of economic indicators is being formed and on its basis a matrix of initial data is compiled, which is a table in which system numbers are shown in its individual rows (i = 1,2,....,n), and in vertical columns - numbers of indicators (j = 1,2,....,m).

At the second stage For each vertical column, the largest of the available indicator values ​​is identified, which is taken as one.

After this, all amounts reflected in this column are divided by highest value and a matrix of standardized coefficients is formed.

At the third stage all components of the matrix are squared. If they have different significance, then each matrix indicator is assigned a certain weight coefficient k. The value of the latter is determined by expert opinion.

On the last one, fourth stage found rating values R j are grouped in order of their increase or decrease.

The matrix methods outlined should be used, for example, in a comparative analysis of various investment projects, as well as in assessing other economic indicators of the activities of organizations.

Topic 2. SYSTEMS OF LINEAR ALGEBRAIC EQUATIONS.

Basic concepts.

Definition 1. System m linear equations with n unknowns is a system of the form:

where and are numbers.

Definition 2. A solution to system (I) is a set of unknowns in which each equation of this system becomes an identity.

Definition 3. System (I) is called joint, if it has at least one solution and non-joint, if it has no solutions. The joint system is called certain, if it has a unique solution, and uncertain otherwise.

Definition 4. Equation of the form

called zero, and the equation is of the form

called incompatible. Obviously, a system of equations containing an incompatible equation is inconsistent.

Definition 5. Two systems of linear equations are called equivalent, if every solution of one system serves as a solution to another and, conversely, every solution of the second system is a solution to the first.

Matrix representation of a system of linear equations.

Let us consider system (I) (see §1).

Let's denote:

Coefficient matrix for unknowns

Matrix - column of free terms

Matrix – column of unknowns

.

Definition 1. The matrix is ​​called main matrix of the system(I), and the matrix is ​​the extended matrix of system (I).

By the definition of equality of matrices, system (I) corresponds to the matrix equality:

.

The right side of this equality by definition of the product of matrices ( see definition 3 § 5 chapter 1) can be factorized:

, i.e.

Equality (2) called matrix notation of system (I).

Solving a system of linear equations using Cramer's method.

Let in system (I) (see §1) m=n, i.e. the number of equations is equal to the number of unknowns, and the main matrix of the system is non-singular, i.e. . Then system (I) from §1 has a unique solution

where Δ = det A called main determinant of the system(I), Δ i is obtained from the determinant Δ by replacing i th column to a column of free members of the system (I).

Example: Solve the system using Cramer's method:

.

By formulas (3) .

We calculate the determinants of the system:

,

,

.

To obtain the determinant, we replaced the first column in the determinant with a column of free terms; replacing the 2nd column in the determinant with a column of free terms, we get ; in a similar way, replacing the 3rd column in the determinant with a column of free terms, we get . System solution:

Solving systems of linear equations using an inverse matrix.

Let in system (I) (see §1) m=n and the main matrix of the system is non-singular. Let us write system (I) in matrix form ( see §2):

because matrix A non-singular, then it has an inverse matrix ( see Theorem 1 §6 of Chapter 1). Let's multiply both sides of the equality (2) to the matrix, then

By definition of an inverse matrix. From equality (3) we have

Solve the system using the inverse matrix

.

Let's denote

In example (§ 3) we calculated the determinant, therefore, the matrix A has an inverse matrix. Then in effect (4) , i.e.

. (5)

Let's find the matrix ( see §6 chapter 1)

, , ,

, , ,

,

.

Gauss method.

Let a system of linear equations be given:

. (I)

It is required to find all solutions of system (I) or make sure that the system is inconsistent.

Definition 1.Let us call the elementary transformation of the system(I) any of three actions:

1) crossing out the zero equation;

2) adding to both sides of the equation the corresponding parts of another equation, multiplied by the number l;

3) swapping terms in the equations of the system so that unknowns with the same numbers in all equations occupy the same places, i.e. if, for example, in the 1st equation we changed the 2nd and 3rd terms, then the same must be done in all equations of the system.

The Gauss method consists in the fact that system (I) with the help of elementary transformations is reduced to an equivalent system, the solution of which is found directly or its unsolvability is established.

As described in §2, system (I) is uniquely determined by its extended matrix and any elementary transformation of system (I) corresponds to an elementary transformation of the extended matrix:

.

Transformation 1) corresponds to deleting the zero row in the matrix, transformation 2) is equivalent to adding another row to the corresponding row of the matrix, multiplied by the number l, transformation 3) is equivalent to rearranging the columns in the matrix.

It is easy to see that, on the contrary, each elementary transformation of the matrix corresponds to an elementary transformation of the system (I). Due to the above, instead of operations with system (I), we will work with the extended matrix of this system.

In the matrix, the 1st column consists of coefficients for x 1, 2nd column - from the coefficients for x 2 etc. If the columns are rearranged, it should be taken into account that this condition is violated. For example, if we swap the 1st and 2nd columns, then now the 1st column will contain the coefficients for x 2, and in the 2nd column - the coefficients for x 1.

We will solve system (I) using the Gaussian method.

1. Cross out all zero rows in the matrix, if any (i.e., cross out all zero equations in system (I).

2. Let's check whether among the rows of the matrix there is a row in which all elements except the last one are equal to zero (let's call such a row inconsistent). Obviously, such a line corresponds to an inconsistent equation in system (I), therefore, system (I) has no solutions and this is where the process ends.

3. Let the matrix not contain inconsistent rows (system (I) does not contain inconsistent equations). If a 11 =0, then we find in the 1st row some element (except for the last one) other than zero and rearrange the columns so that in the 1st row there is no zero in the 1st place. We will now assume that (i.e., we will swap the corresponding terms in the equations of system (I)).

4. Multiply the 1st line by and add the result with the 2nd line, then multiply the 1st line by and add the result with the 3rd line, etc. Obviously, this process is equivalent to eliminating the unknown x 1 from all equations of system (I), except the 1st. In the new matrix we get zeros in the 1st column under the element a 11:

.

5. Let’s cross out all zero rows in the matrix, if there are any, and check if there is an inconsistent row (if there is one, then the system is inconsistent and the solution ends there). Let's check if there will be a 22 / =0, if yes, then we find in the 2nd row an element other than zero and rearrange the columns so that . Next, multiply the elements of the 2nd row by and add with the corresponding elements of the 3rd line, then - the elements of the 2nd line and add with the corresponding elements of the 4th line, etc., until we get zeros under a 22/

.

The actions taken are equivalent to eliminating the unknown x 2 from all equations of system (I), except for the 1st and 2nd. Since the number of rows is finite, therefore after a finite number of steps we get that either the system is inconsistent, or we end up with a step matrix ( see definition 2 §7 chapter 1) :

,

Let us write out the system of equations corresponding to the matrix . This system is equivalent to system (I)

.

From the last equation we express; substitute into the previous equation, find, etc., until we get .

Note 1. Thus, when solving system (I) using the Gaussian method, we arrive at one of the following cases.

1. System (I) is inconsistent.

2. System (I) has a unique solution if the number of rows in the matrix is ​​equal to the number of unknowns ().

3. System (I) has an infinite number of solutions if the number of rows in the matrix less number unknown().

Hence the following theorem holds.

Theorem. A system of linear equations is either inconsistent, or has a unique solution, or - infinite set decisions.

Examples. Solve the system of equations using the Gauss method or prove its inconsistency:

b) ;

a) Let us rewrite the given system in the form:

.

We have swapped the 1st and 2nd equations of the original system to simplify the calculations (instead of fractions, we will only operate with integers using this rearrangement).

Let's create an extended matrix:

.

There are no null lines; there are no incompatible lines, ; Let's exclude the 1st unknown from all equations of the system except the 1st. To do this, multiply the elements of the 1st row of the matrix by “-2” and add them with the corresponding elements of the 2nd row, which is equivalent to multiplying the 1st equation by “-2” and adding it with the 2nd equation. Then we multiply the elements of the 1st line by “-3” and add them with the corresponding elements of the third line, i.e. multiply the 2nd equation of the given system by “-3” and add it to the 3rd equation. We get

.

The matrix corresponds to a system of equations). - (see definition 3§7 of Chapter 1).

This is a concept that generalizes all possible operations performed with matrices. Mathematical matrix - table of elements. About a table where m lines and n columns, this matrix is ​​said to have the dimension m on n.

General view of the matrix:

For matrix solutions it is necessary to understand what a matrix is ​​and know its main parameters. Main elements of the matrix:

  • The main diagonal, consisting of elements a 11, a 22…..a mn.
  • Side diagonal consisting of elements a 1n , a 2n-1 .....a m1.

Main types of matrices:

  • Square is a matrix where the number of rows = the number of columns ( m=n).
  • Zero - where all matrix elements = 0.
  • Transposed matrix - matrix IN, which was obtained from the original matrix A by replacing rows with columns.
  • Unity - all elements of the main diagonal = 1, all others = 0.
  • An inverse matrix is ​​a matrix that, when multiplied by the original matrix, results in an identity matrix.

The matrix can be symmetrical with respect to the main and secondary diagonals. That is, if a 12 = a 21, a 13 =a 31,….a 23 =a 32…. a m-1n =a mn-1, then the matrix is ​​symmetrical about the main diagonal. Only square matrices can be symmetric.

Methods for solving matrices.

Almost all matrix solving methods consist in finding its determinant n-th order and most of them are quite cumbersome. To find the determinant of the 2nd and 3rd order there are other, more rational methods.

Finding 2nd order determinants.

To calculate the determinant of a matrix A 2nd order, it is necessary to subtract the product of the elements of the secondary diagonal from the product of the elements of the main diagonal:

Methods for finding 3rd order determinants.

Below are the rules for finding the 3rd order determinant.

Simplified rule of triangle as one of matrix solving methods, can be depicted this way:

In other words, the product of elements in the first determinant that are connected by straight lines is taken with a “+” sign; Also, for the 2nd determinant, the corresponding products are taken with the “-” sign, that is, according to the following scheme:

At solving matrices using Sarrus' rule, to the right of the determinant, add the first 2 columns and the products of the corresponding elements on the main diagonal and on the diagonals that are parallel to it are taken with a “+” sign; and the products of the corresponding elements of the secondary diagonal and the diagonals that are parallel to it, with the sign “-”:

Decomposing the determinant in a row or column when solving matrices.

The determinant is equal to the sum of the products of the elements of the row of the determinant and their algebraic complements. Usually the row/column that contains zeros is selected. The row or column along which the decomposition is carried out will be indicated by an arrow.

Reducing the determinant to triangular form when solving matrices.

At solving matrices method of reducing the determinant to a triangular form, they work like this: using simple transformations over rows or columns, the determinant becomes triangular in appearance and then its value, in accordance with the properties of the determinant, will be equal to the product of the elements that stand on the main diagonal.

Laplace's theorem for solving matrices.

When solving matrices using Laplace's theorem, you need to know the theorem itself. Laplace's theorem: Let Δ - this is a determinant n-th order. We select any k rows (or columns), provided kn - 1. In this case, the sum of the products of all minors k-th order contained in the selected k rows (columns), by their algebraic complements will be equal to the determinant.

Solving the inverse matrix.

Sequence of actions for inverse matrix solutions:

  1. Determine whether a given matrix is ​​square. If the answer is negative, it becomes clear that there cannot be an inverse matrix for it.
  2. We calculate algebraic complements.
  3. We compose a union (mutual, adjoint) matrix C.
  4. We compose the inverse matrix from algebraic additions: all elements of the adjoint matrix C divide by the determinant of the initial matrix. The final matrix will be the required inverse matrix relative to the given one.
  5. We check the work done: multiply the initial matrix and the resulting matrix, the result should be an identity matrix.

Solving matrix systems.

For solutions of matrix systems The Gaussian method is most often used.

The Gauss method is a standard method for solving systems of linear algebraic equations(SLAE) and it lies in the fact that variables are sequentially eliminated, i.e., with the help of elementary changes, the system of equations is brought to an equivalent system of triangular form and from it, sequentially, starting from the last (by number), each element of the system is found.

Gauss method is the most versatile and best tool for finding matrix solutions. If a system has an infinite number of solutions or the system is incompatible, then it cannot be solved using Cramer’s rule and the matrix method.

The Gauss method also implies direct (reducing the extended matrix to a stepwise form, i.e., obtaining zeros under the main diagonal) and reverse (obtaining zeros above the main diagonal of the extended matrix) moves. The forward move is the Gauss method, the reverse move is the Gauss-Jordan method. The Gauss-Jordan method differs from the Gauss method only in the sequence of eliminating variables.

The use of equations is widespread in our lives. They are used in many calculations, construction of structures and even sports. Man used equations in ancient times, and since then their use has only increased. The matrix method allows you to find solutions to SLAEs (systems of linear algebraic equations) of any complexity. The entire process of solving SLAEs comes down to two main actions:

Definition of an inverse matrix based on main matrix:

Multiplying the resulting inverse matrix by a column vector of solutions.

Suppose we are given an SLAE the following type:

\[\left\(\begin(matrix) 5x_1 + 2x_2 & = & 7 \\ 2x_1 + x_2 & = & 9 \end(matrix)\right.\]

Let's start the solution given equation from writing out the system matrix:

Right side matrix:

Let's define the inverse matrix. You can find a 2nd order matrix as follows: 1 - the matrix itself must be non-singular; 2 - its elements that are on the main diagonal are swapped, and for the elements of the secondary diagonal we change the sign to the opposite one, after which we divide the resulting elements by the determinant of the matrix. We get:

\[\begin(pmatrix) 7 \\ 9 \end(pmatrix)=\begin(pmatrix) -11 \\ 31 \end(pmatrix)\Rightarrow \begin(pmatrix) x_1 \\ x_2 \end(pmatrix) =\ begin(pmatrix) -11 \\ 31 \end(pmatrix) \]

2 matrices are considered equal if their corresponding elements are equal. As a result, we have the following answer for the SLAE solution:

Where can I solve a system of equations using the matrix method online?

You can solve the system of equations on our website. A free online solver will allow you to solve the equation online any complexity in seconds. All you need to do is simply enter your data into the solver. You can also find out how to solve the equation on our website. And if you still have questions, you can ask them in our VKontakte group.