Solve using matrix method. Matrix method online


Let's consider system of linear algebraic equations(SLAU) relatively n unknown x 1 , x 2 , ..., x n :

This system in a “collapsed” form can be written as follows:

S n i=1 a ij x j = b i , i=1,2, ..., n.

In accordance with the rule of matrix multiplication, the considered system linear equations can be written in matrix form Ax=b, Where

, ,.

Matrix A, the columns of which are the coefficients for the corresponding unknowns, and the rows are the coefficients for the unknowns in the corresponding equation is called matrix of the system. Column matrix b, the elements of which are the right-hand sides of the equations of the system, is called the right-hand side matrix or simply right side of the system. Column matrix x , the elements of which are the unknown unknowns, is called system solution.

A system of linear algebraic equations written in the form Ax=b, is matrix equation.

If the system matrix non-degenerate, then she has inverse matrix and then the solution of the system Ax=b is given by the formula:

x=A -1 b.

Example Solve the system matrix method.

Solution let's find the inverse matrix for the coefficient matrix of the system

Let's calculate the determinant by expanding along the first line:

Because the Δ ≠ 0 , That A -1 exists.

The inverse matrix was found correctly.

Let's find a solution to the system

Hence, x 1 = 1, x 2 = 2, x 3 = 3 .

Examination:

7. The Kronecker-Capelli theorem on the compatibility of a system of linear algebraic equations.

System of linear equations has the form:

a 21 x 1 + a 22 x 2 +... + a 2n x n = b 2, (5.1)

a m1 x 1 + a m1 x 2 +... + a mn x n = b m.

Here a i j and b i (i = ; j = ) are given, and x j are unknown real numbers. Using the concept of product of matrices, we can rewrite system (5.1) in the form:

where A = (a i j) is a matrix consisting of coefficients for the unknowns of system (5.1), which is called matrix of the system, X = (x 1 , x 2 ,..., x n) T , B = (b 1 , b 2 ,..., b m) T are column vectors composed respectively of unknowns x j and free terms b i .

Ordered collection n real numbers (c 1 , c 2 ,..., c n) are called system solution(5.1), if as a result of substituting these numbers instead of the corresponding variables x 1, x 2,..., x n, each equation of the system turns into an arithmetic identity; in other words, if there is a vector C= (c 1 , c 2 ,..., c n) T such that AC  B.

System (5.1) is called joint, or solvable, if it has at least one solution. The system is called incompatible, or unsolvable, if it has no solutions.

,

formed by assigning a column of free terms to the right side of the matrix A is called extended matrix of the system.

The question of compatibility of system (5.1) is solved by the following theorem.

Kronecker-Capelli theorem . A system of linear equations is consistent if and only if the ranks of matrices A andA coincide, i.e. r(A) = r(A) = r.

For the set M of solutions of system (5.1) there are three possibilities:

1) M =  (in this case the system is inconsistent);

2) M consists of one element, i.e. the system has only decision(in this case the system is called certain);

3) M consists of more than one element (then the system is called uncertain). In the third case, system (5.1) has an infinite number of solutions.

The system has a unique solution only if r(A) = n. In this case, the number of equations is not less than the number of unknowns (mn); if m>n, then m-n equations are consequences of the others. If 0

To solve an arbitrary system of linear equations, you need to be able to solve systems in which the number of equations is equal to the number of unknowns - the so-called Cramer type systems:

a 11 x 1 + a 12 x 2 +... + a 1n x n = b 1,

a 21 x 1 + a 22 x 2 +... + a 2n x n = b 2, (5.3)

... ... ... ... ... ...

a n1 x 1 + a n1 x 2 +... + a nn x n = b n .

Systems (5.3) are solved in one of the following ways: 1) the Gauss method, or the method of eliminating unknowns; 2) according to Cramer's formulas; 3) matrix method.

Example 2.12. Explore the system of equations and solve it if it is consistent:

5x 1 - x 2 + 2x 3 + x 4 = 7,

2x 1 + x 2 + 4x 3 - 2x 4 = 1,

x 1 - 3x 2 - 6x 3 + 5x 4 = 0.

Solution. We write out the extended matrix of the system:

.

Let's calculate the rank of the main matrix of the system. It is obvious that, for example, the second-order minor in the upper left corner = 7  0; the third-order minors containing it are equal to zero:

Therefore, the rank of the main matrix of the system is 2, i.e. r(A) = 2. To calculate the rank of the extended matrix A, consider the bordering minor

this means that the rank of the extended matrix r(A) = 3. Since r(A)  r(A), the system is inconsistent.

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:

Determination of the inverse matrix based on the main matrix:

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

Suppose we are given a SLAE of the following form:

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

Let's start solving this equation by 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. The free online solver will allow you to solve online equations of any complexity in a matter of 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.

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's 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 is ​​less than the number of unknowns ().

Hence the following theorem holds.

Theorem. A system of linear equations is either inconsistent, has a unique solution, or has an infinite number of solutions.

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).

Equations in general, linear algebraic equations and their systems, as well as methods for solving them, occupy a special place in mathematics, both theoretical and applied.

This is due to the fact that the vast majority of physical, economic, technical and even pedagogical problems can be described and solved using a variety of equations and their systems. Recently, mathematical modeling has gained particular popularity among researchers, scientists and practitioners in almost all subject areas, which is explained by its obvious advantages over other well-known and proven methods for studying objects of various natures, in particular, the so-called complex systems. There is a great variety of different definitions of a mathematical model given by scientists at different times, but in our opinion, the most successful is the following statement. A mathematical model is an idea expressed by an equation. Thus, the ability to compose and solve equations and their systems is an integral characteristic of a modern specialist.

To solve systems of linear algebraic equations, the most commonly used methods are Cramer, Jordan-Gauss and the matrix method.

Matrix solution method is a method for solving systems of linear algebraic equations with a nonzero determinant using an inverse matrix.

If we write out the coefficients for the unknown quantities xi in matrix A, collect the unknown quantities in the vector column X, and the free terms in the vector column B, then the system of linear algebraic equations can be written in the form of the following matrix equation A · X = B, which has a unique solution only when the determinant of matrix A is not equal to zero. In this case, the solution to the system of equations can be found in the following way X = A-1 · B, Where A-1 is the inverse matrix.

The matrix solution method is as follows.

Let us be given a system of linear equations with n unknown:

It can be rewritten in matrix form: AX = B, Where A- the main matrix of the system, B And X- columns of free members and solutions of the system, respectively:

Let's multiply this matrix equation from the left by A-1 - matrix inverse of matrix A: A -1 (AX) = A -1 B

Because A -1 A = E, we get X= A -1 B. The right side of this equation will give the solution column of the original system. The condition for the applicability of this method (as well as the general existence of a solution to an inhomogeneous system of linear equations with the number of equations equal to the number of unknowns) is the nondegeneracy of the matrix A. A necessary and sufficient condition for this is that the determinant of the matrix is ​​not equal to zero A:det A≠ 0.

For a homogeneous system of linear equations, that is, when the vector B = 0 , indeed the opposite rule: the system AX = 0 has a non-trivial (that is, non-zero) solution only if det A= 0. Such a connection between solutions of homogeneous and inhomogeneous systems of linear equations is called the Fredholm alternative.

Example solutions to an inhomogeneous system of linear algebraic equations.

Let us make sure that the determinant of the matrix, composed of the coefficients of the unknowns of the system of linear algebraic equations, is not equal to zero.

The next step is to calculate the algebraic complements for the elements of the matrix consisting of the coefficients of the unknowns. They will be needed to find the inverse matrix.

(sometimes this method is also called the matrix method or the inverse matrix method) requires preliminary familiarization with such a concept as the matrix form of notation of SLAE. The inverse matrix method is intended for solving those systems of linear algebraic equations in which the determinant of the system matrix is ​​different from zero. Naturally, this assumes that the matrix of the system is square (the concept of a determinant exists only for square matrices). The essence of the inverse matrix method can be expressed in three points:

  1. Write down three matrices: the system matrix $A$, the matrix of unknowns $X$, the matrix of free terms $B$.
  2. Find the inverse matrix $A^(-1)$.
  3. Using the equality $X=A^(-1)\cdot B$, obtain a solution to the given SLAE.

Any SLAE can be written in matrix form as $A\cdot X=B$, where $A$ is the matrix of the system, $B$ is the matrix of free terms, $X$ is the matrix of unknowns. Let the matrix $A^(-1)$ exist. Let's multiply both sides of the equality $A\cdot X=B$ by the matrix $A^(-1)$ on the left:

$$A^(-1)\cdot A\cdot X=A^(-1)\cdot B.$$

Since $A^(-1)\cdot A=E$ ($E$ is the identity matrix), the above equality becomes:

$$E\cdot X=A^(-1)\cdot B.$$

Since $E\cdot X=X$, then:

$$X=A^(-1)\cdot B.$$

Example No. 1

Solve the SLAE $ \left \( \begin(aligned) & -5x_1+7x_2=29;\\ & 9x_1+8x_2=-11. \end(aligned) \right.$ using the inverse matrix.

$$ A=\left(\begin(array) (cc) -5 & 7\\ 9 & 8 \end(array)\right);\; B=\left(\begin(array) (c) 29\\ -11 \end(array)\right);\; X=\left(\begin(array) (c) x_1\\ x_2 \end(array)\right). $$

Let's find the inverse matrix to the system matrix, i.e. Let's calculate $A^(-1)$. In example No. 2

$$ A^(-1)=-\frac(1)(103)\cdot\left(\begin(array)(cc) 8 & -7\\ -9 & -5\end(array)\right) . $$

Now let's substitute all three matrices ($X$, $A^(-1)$, $B$) into the equality $X=A^(-1)\cdot B$. Then we perform matrix multiplication

$$ \left(\begin(array) (c) x_1\\ x_2 \end(array)\right)= -\frac(1)(103)\cdot\left(\begin(array)(cc) 8 & -7\\ -9 & -5\end(array)\right)\cdot \left(\begin(array) (c) 29\\ -11 \end(array)\right)=\\ =-\frac (1)(103)\cdot \left(\begin(array) (c) 8\cdot 29+(-7)\cdot (-11)\\ -9\cdot 29+(-5)\cdot (- 11) \end(array)\right)= -\frac(1)(103)\cdot \left(\begin(array) (c) 309\\ -206 \end(array)\right)=\left( \begin(array) (c) -3\\ 2\end(array)\right). $$

So, we got the equality $\left(\begin(array) (c) x_1\\ x_2 \end(array)\right)=\left(\begin(array) (c) -3\\ 2\end(array )\right)$. From this equality we have: $x_1=-3$, $x_2=2$.

Answer: $x_1=-3$, $x_2=2$.

Example No. 2

Solve SLAE $ \left\(\begin(aligned) & x_1+7x_2+3x_3=-1;\\ & -4x_1+9x_2+4x_3=0;\\ & 3x_2+2x_3=6. \end(aligned)\right .$ using the inverse matrix method.

Let us write down the matrix of the system $A$, the matrix of free terms $B$ and the matrix of unknowns $X$.

$$ A=\left(\begin(array) (ccc) 1 & 7 & 3\\ -4 & 9 & 4 \\0 & 3 & 2\end(array)\right);\; B=\left(\begin(array) (c) -1\\0\\6\end(array)\right);\; X=\left(\begin(array) (c) x_1\\ x_2 \\ x_3 \end(array)\right). $$

Now it’s the turn to find the inverse matrix to the system matrix, i.e. find $A^(-1)$. In example No. 3 on the page dedicated to finding inverse matrices, the inverse matrix has already been found. Let's use the finished result and write $A^(-1)$:

$$ A^(-1)=\frac(1)(26)\cdot \left(\begin(array) (ccc) 6 & -5 & 1 \\ 8 & 2 & -16 \\ -12 & - 3 & 37\end(array)\right). $$

Now let's substitute all three matrices ($X$, $A^(-1)$, $B$) into the equality $X=A^(-1)\cdot B$, and then perform matrix multiplication on the right side of this equality.

$$ \left(\begin(array) (c) x_1\\ x_2 \\ x_3 \end(array)\right)= \frac(1)(26)\cdot \left(\begin(array) (ccc) 6 & -5 & 1 \\ 8 & 2 & -16 \\ -12 & -3 & 37\end(array) \right)\cdot \left(\begin(array) (c) -1\\0\ \6\end(array)\right)=\\ =\frac(1)(26)\cdot \left(\begin(array) (c) 6\cdot(-1)+(-5)\cdot 0 +1\cdot 6 \\ 8\cdot (-1)+2\cdot 0+(-16)\cdot 6 \\ -12\cdot (-1)+(-3)\cdot 0+37\cdot 6 \end(array)\right)=\frac(1)(26)\cdot \left(\begin(array) (c) 0\\-104\\234\end(array)\right)=\left( \begin(array) (c) 0\\-4\\9\end(array)\right) $$

So, we got the equality $\left(\begin(array) (c) x_1\\ x_2 \\ x_3 \end(array)\right)=\left(\begin(array) (c) 0\\-4\ \9\end(array)\right)$. From this equality we have: $x_1=0$, $x_2=-4$, $x_3=9$.

Editor's Choice
Your Zodiac sign makes up only 50% of your personality. The remaining 50% cannot be known by reading general horoscopes. You need to create an individual...

Description of the white mulberry plant. Composition and calorie content of berries, beneficial properties and expected harm. Delicious recipes and uses...

Like most of his colleagues, Soviet children's writers and poets, Samuil Marshak did not immediately begin writing for children. He was born in 1887...

Breathing exercises using the Strelnikova method help cope with attacks of high blood pressure. Correct execution of exercises -...
About the university Bryansk State University named after academician I.G. Petrovsky is the largest university in the region, with more than 14...
Representatives of the arachnid class are creatures that have lived next to humans for many centuries. But this time it turned out...
Girls and women almost always associate white shoes with a wedding dress, although the white color of shoes has long been no longer required. A...