Biographies Characteristics Analysis

How to solve a system using Cramer's method examples. Three cases when solving systems of linear equations

Cramer's method or the so-called Cramer's rule is a method of searching for unknown quantities from systems of equations. It can only be used if the number of searched values ​​is equivalent to the number algebraic equations in the system, that is, the main matrix formed from the system must be square and not contain zero rows, and also if its determinant must not be zero.

Theorem 1

Cramer's theorem If the main determinant $D$ of the main matrix, compiled on the basis of the coefficients of the equations, is not equal to zero, then the system of equations is consistent, and it has a unique solution. The solution to such a system is calculated through the so-called Cramer formulas for solving systems linear equations: $x_i = \frac(D_i)(D)$

What is the Cramer method?

The essence of Cramer's method is as follows:

  1. To find a solution to the system using Cramer's method, first of all we calculate the main determinant of the matrix $D$. When the calculated determinant of the main matrix, when calculated by Cramer's method, turns out to be equal to zero, then the system does not have a single solution or has an infinite number of solutions. In this case, to find a general or some basic answer for the system, it is recommended to use the Gaussian method.
  2. Then you need to replace the outermost column of the main matrix with a column of free terms and calculate the determinant $D_1$.
  3. Repeat the same for all columns, obtaining determinants from $D_1$ to $D_n$, where $n$ is the number of the rightmost column.
  4. After all determinants $D_1$...$D_n$ have been found, the unknown variables can be calculated using the formula $x_i = \frac(D_i)(D)$.

Techniques for calculating the determinant of a matrix

To calculate the determinant of a matrix with a dimension greater than 2 by 2, you can use several methods:

  • The rule of triangles, or Sarrus's rule, reminiscent of the same rule. The essence of the triangle method is that when calculating the determinant, the products of all numbers connected in the figure by the red line on the right are written with a plus sign, and all numbers connected in a similar way in the figure on the left are written with a minus sign. Both rules are suitable for matrices of size 3 x 3. In the case of the Sarrus rule, the matrix itself is first rewritten, and next to it its first and second columns are rewritten again. Diagonals are drawn through the matrix and these additional columns; matrix members lying on the main diagonal or parallel to it are written with a plus sign, and elements lying on or parallel to the secondary diagonal are written with a minus sign.

Figure 1. Triangle rule for calculating the determinant for Cramer's method

  • Using a method known as the Gaussian method, this method is also sometimes called reducing the order of the determinant. In this case, the matrix is ​​transformed and reduced to triangular view, and then all the numbers on the main diagonal are multiplied. It should be remembered that when searching for a determinant in this way, you cannot multiply or divide rows or columns by numbers without taking them out as a multiplier or divisor. In the case of searching for a determinant, it is only possible to subtract and add rows and columns to each other, having previously multiplied the subtracted row by a non-zero factor. Also, whenever you rearrange the rows or columns of the matrix, you should remember the need to change the final sign of the matrix.
  • When solving a SLAE with 4 unknowns using the Cramer method, it is best to use the Gauss method to search and find determinants or determine the determinant by searching for minors.

Solving systems of equations using Cramer's method

Let's apply Cramer's method for a system of 2 equations and two required quantities:

$\begin(cases) a_1x_1 + a_2x_2 = b_1 \\ a_3x_1 + a_4x_2 = b_2 \\ \end(cases)$

Let's display it in expanded form for convenience:

$A = \begin(array)(cc|c) a_1 & a_2 & b_1 \\ a_3 & a_4 & b_1 \\ \end(array)$

Let's find the determinant of the main matrix, also called the main determinant of the system:

$D = \begin(array)(|cc|) a_1 & a_2 \\ a_3 & a_4 \\ \end(array) = a_1 \cdot a_4 – a_3 \cdot a_2$

If the main determinant is not equal to zero, then to solve the slough using Cramer’s method it is necessary to calculate a couple more determinants from two matrices with the columns of the main matrix replaced by a row of free terms:

$D_1 = \begin(array)(|cc|) b_1 & a_2 \\ b_2 & a_4 \\ \end(array) = b_1 \cdot a_4 – b_2 \cdot a_4$

$D_2 = \begin(array)(|cc|) a_1 & b_1 \\ a_3 & b_2 \\ \end(array) = a_1 \cdot b_2 – a_3 \cdot b_1$

Now let's find the unknowns $x_1$ and $x_2$:

$x_1 = \frac (D_1)(D)$

$x_2 = \frac (D_2)(D)$

Example 1

Cramer's method for solving SLAEs with a main matrix of 3rd order (3 x 3) and three required ones.

Solve the system of equations:

$\begin(cases) 3x_1 – 2x_2 + 4x_3 = 21 \\ 3x_1 +4x_2 + 2x_3 = 9\\ 2x_1 – x_2 - x_3 = 10 \\ \end(cases)$

Let's calculate the main determinant of the matrix using the rule stated above under point number 1:

$D = \begin(array)(|ccc|) 3 & -2 & 4 \\3 & 4 & -2 \\ 2 & -1 & 1 \\ \end(array) = 3 \cdot 4 \cdot ( -1) + 2 \cdot (-2) \cdot 2 + 4 \cdot 3 \cdot (-1) – 4 \cdot 4 \cdot 2 – 3 \cdot (-2) \cdot (-1) - (- 1) \cdot 2 \cdot 3 = - 12 – 8 -12 -32 – 6 + 6 = - 64$

And now three other determinants:

$D_1 = \begin(array)(|ccc|) 21 & 2 & 4 \\ 9 & 4 & 2 \\ 10 & 1 & 1 \\ \end(array) = 21 \cdot 4 \cdot 1 + (- 2) \cdot 2 \cdot 10 + 9 \cdot (-1) \cdot 4 – 4 \cdot 4 \cdot 10 – 9 \cdot (-2) \cdot (-1) - (-1) \cdot 2 \ cdot 21 = - 84 – 40 – 36 – 160 – 18 + 42 = - $296

$D_2 = \begin(array)(|ccc|) 3 & 21 & 4 \\3 & 9 & 2 \\ 2 & 10 & 1 \\ \end(array) = 3 \cdot 9 \cdot (- 1) + 3 \cdot 10 \cdot 4 + 21 \cdot 2 \cdot 2 – 4 \cdot 9 \cdot 2 – 21 \cdot 3 \cdot (-1) – 2 \cdot 10 \cdot 3 = - 27 + 120 + 84 – 72 + 63 – 60 = $108

$D_3 = \begin(array)(|ccc|) 3 & -2 & 21 \\ 3 & 4 & 9 \\ 2 & 1 & 10 \\ \end(array) = 3 \cdot 4 \cdot 10 + 3 \cdot (-1) \cdot 21 + (-2) \cdot 9 \cdot 2 – 21 \cdot 4 \cdot 2 - (-2) \cdot 3 \cdot 10 - (-1) \cdot 9 \cdot 3 = 120 – 63 – 36 – 168 + 60 + 27 = - $60

Let's find the required quantities:

$x_1 = \frac(D_1) (D) = \frac(- 296)(-64) = 4 \frac(5)(8)$

$x_2 = \frac(D_1) (D) = \frac(108) (-64) = - 1 \frac (11) (16)$

$x_3 = \frac(D_1) (D) = \frac(-60) (-64) = \frac (15) (16)$

Methods Kramer And Gauss- one of the most popular solution methods SLAU. In addition, in some cases it is advisable to use specific methods. The session is close, and now is the time to repeat or master them from scratch. Today we’ll look at the solution using Cramer’s method. After all, solving a system of linear equations using the Cramer method is a very useful skill.

Systems of linear algebraic equations

A system of linear algebraic equations is a system of equations of the form:

Value set x , in which the equations of the system turn into identities, is called a solution of the system, a And b are real coefficients. A simple system consisting of two equations with two unknowns can be solved in your head or by expressing one variable in terms of the other. But there can be much more than two variables (xes) in a SLAE, and here simple school manipulations are not enough. What to do? For example, solve SLAEs using Cramer's method!

So, let the system consist of n equations with n unknown.

Such a system can be rewritten as matrix form

Here A – the main matrix of the system, X And B , respectively, column matrices of unknown variables and free terms.

Solving SLAEs using Cramer's method

If the determinant of the main matrix is ​​not equal to zero (the matrix is ​​non-singular), the system can be solved using Cramer's method.

According to Cramer's method, the solution is found using the formulas:

Here delta is the determinant of the main matrix, and delta x nth – determinant obtained from the determinant of the main matrix by replacing the nth column with a column of free terms.

This is the whole essence of the Cramer method. Substituting the values ​​found using the above formulas x into the desired system, we are convinced of the correctness (or vice versa) of our solution. To help you get the gist of it faster, let’s give an example below. detailed solution SLAE by Cramer method:

Even if you don't succeed the first time, don't be discouraged! With a little practice, you will start cracking SLAUs like nuts. Moreover, now it is absolutely not necessary to pore over a notebook, solving cumbersome calculations and writing up the core. You can easily solve SLAEs using Cramer's method online, just by substituting the coefficients into the finished form. Try it online calculator Solutions using Cramer's method can be found, for example, on this website.

And if the system turns out to be stubborn and does not give up, you can always turn to our authors for help, for example, to. If there are at least 100 unknowns in the system, we will definitely solve it correctly and on time!

Let the system of linear equations contain as many equations as the number of independent variables, i.e. looks like

Such systems of linear equations are called quadratic. A determinant composed of coefficients for independent system variables(1.5) is called the main determinant of the system. We will denote it by the Greek letter D. Thus,

. (1.6)

If the main determinant contains an arbitrary ( j th) column, replace with a column of free terms of system (1.5), then you can get n auxiliary qualifiers:

(j = 1, 2, …, n). (1.7)

Cramer's rule solving quadratic systems of linear equations is as follows. If the main determinant D of system (1.5) is different from zero, then the system has a unique solution, which can be found using the formulas:

(1.8)

Example 1.5. Solve the system of equations using Cramer's method

.

Let us calculate the main determinant of the system:

Since D¹0, the system has a unique solution, which can be found using formulas (1.8):

Thus,

Actions on matrices

1. Multiplying a matrix by a number. The operation of multiplying a matrix by a number is defined as follows.

2. In order to multiply a matrix by a number, you need to multiply all its elements by this number. That is

. (1.9)

Example 1.6. .

Matrix addition.

This operation is introduced only for matrices of the same order.

In order to add two matrices, it is necessary to add the corresponding elements of another matrix to the elements of one matrix:

(1.10)
The operation of matrix addition has the properties of associativity and commutativity.

Example 1.7. .

Matrix multiplication.

If the number of matrix columns A coincides with the number of matrix rows IN, then for such matrices the multiplication operation is introduced:

2

Thus, when multiplying a matrix A dimensions m´ n to the matrix IN dimensions n´ k we get a matrix WITH dimensions m´ k. In this case, the matrix elements WITH are calculated using the following formulas:

Problem 1.8. Find, if possible, the product of matrices AB And B.A.:

Solution. 1) In order to find a work AB, you need matrix rows A multiply by matrix columns B:

2) Work B.A. does not exist, because the number of matrix columns B does not match the number of matrix rows A.

Inverse matrix. Solving systems of linear equations using the matrix method

Matrix A- 1 is called the inverse of a square matrix A, if the equality is satisfied:

where through I denoted by identity matrix same order as the matrix A:

.

In order to square matrix had an inverse, it is necessary and sufficient that its determinant be different from zero. The inverse matrix is ​​found using the formula:


, (1.13)

Where A ij - algebraic additions to elements a ij matrices A(note that algebraic additions to matrix rows A are located in the inverse matrix in the form of corresponding columns).

Example 1.9. Find the inverse matrix A- 1 to matrix

.

We find the inverse matrix using formula (1.13), which for the case n= 3 has the form:

.

Let's find det A = | A| = 1 × 3 × 8 + 2 × 5 × 3 + 2 × 4 × 3 - 3 × 3 × 3 - 1 × 5 × 4 - 2 × 2 × 8 = 24 + 30 + 24 - 27 - 20 - 32 = - 1. Since the determinant of the original matrix is ​​nonzero, the inverse matrix exists.

1) Find algebraic complements A ij:

For ease of location inverse matrix, we placed the algebraic additions to the rows of the original matrix in the corresponding columns.

From the obtained algebraic additions we compose a new matrix and divide it by the determinant det A. Thus, we get the inverse matrix:

Quadratic systems of linear equations with a nonzero principal determinant can be solved using the inverse matrix. To do this, system (1.5) is written in matrix form:

Where

Multiplying both sides of equality (1.14) from the left by A- 1, we get the solution to the system:

, where

Thus, in order to find a solution square system, you need to find the inverse matrix to the main matrix of the system and multiply it on the right by the column matrix of free terms.

Problem 1.10. Solve a system of linear equations

using the inverse matrix.

Solution. Let us write the system in matrix form: ,

Where - the main matrix of the system, - the column of unknowns and - the column of free terms. Since the main determinant of the system , then the main matrix of the system A has an inverse matrix A-1 . To find the inverse matrix A-1 , we calculate the algebraic complements to all elements of the matrix A:

From the obtained numbers we will compose a matrix (and algebraic additions to the rows of the matrix A write it in the appropriate columns) and divide it by the determinant D. Thus, we have found the inverse matrix:

We find the solution to the system using formula (1.15):

Thus,

Solving systems of linear equations using the ordinary Jordan elimination method

Let an arbitrary (not necessarily quadratic) system of linear equations be given:

(1.16)

It is required to find a solution to the system, i.e. such a set of variables that satisfies all the equalities of system (1.16). IN general case system (1.16) can have not only one solution, but also countless decisions. It may also have no solutions at all.

When solving such problems, the well-known school course the method of eliminating unknowns, which is also called the method of ordinary Jordan elimination. The essence this method lies in the fact that in one of the equations of system (1.16) one of the variables is expressed in terms of other variables. This variable is then substituted into other equations in the system. The result is a system containing one equation and one variable less than the original system. The equation from which the variable was expressed is remembered.

This process is repeated until one last equation remains in the system. Through the process of eliminating unknowns, some equations may become true identities, e.g. Such equations are excluded from the system, since they are satisfied for any values ​​of the variables and, therefore, do not affect the solution of the system. If, in the process of eliminating unknowns, at least one equation becomes an equality that cannot be satisfied for any values ​​of the variables (for example), then we conclude that the system has no solution.

If no contradictory equations arise during the solution, then one of the remaining variables in it is found from the last equation. If there is only one variable left in the last equation, then it is expressed as a number. If other variables remain in the last equation, then they are considered parameters, and the variable expressed through them will be a function of these parameters. Then the so-called “ reverse stroke" The found variable is substituted into the last remembered equation and the second variable is found. Then the two found variables are substituted into the penultimate memorized equation and the third variable is found, and so on, up to the first memorized equation.

As a result, we obtain a solution to the system. This decision will be unique if the found variables are numbers. If the first variable found, and then all the others, depend on the parameters, then the system will have an infinite number of solutions (each set of parameters corresponds to a new solution). Formulas that allow you to find a solution to a system depending on a particular set of parameters are called the general solution of the system.

Example 1.11.

x

After memorizing the first equation and bringing similar terms in the second and third equations we arrive at the system:

Let's express y from the second equation and substitute it into the first equation:

Let us remember the second equation, and from the first we find z:

Working backwards, we consistently find y And z. To do this, we first substitute into the last remembered equation, from where we find y:

.

Then we’ll substitute it into the first memorized equation where we can find it x:

Problem 1.12. Solve a system of linear equations by eliminating unknowns:

. (1.17)

Solution. Let us express the variable from the first equation x and substitute it into the second and third equations:

.

Let's remember the first equation

In this system, the first and second equations contradict each other. Indeed, expressing y , we get that 14 = 17. This equality does not hold for any values ​​of the variables x, y, And z. Consequently, system (1.17) is inconsistent, i.e. has no solution.

We invite readers to check for themselves that the main determinant of the original system (1.17) is equal to zero.

Let us consider a system that differs from system (1.17) by only one free term.

Problem 1.13. Solve a system of linear equations by eliminating unknowns:

. (1.18)

Solution. As before, we express the variable from the first equation x and substitute it into the second and third equations:

.

Let's remember the first equation and present similar terms in the second and third equations. We arrive at the system:

Expressing y from the first equation and substituting it into the second equation , we get the identity 14 = 14, which does not affect the solution of the system, and, therefore, it can be excluded from the system.

In the last remembered equality, the variable z we will consider it a parameter. We believe. Then

Let's substitute y And z into the first remembered equality and find x:

.

Thus, system (1.18) has an infinite number of solutions, and any solution can be found using formulas (1.19), choosing an arbitrary value of the parameter t:

(1.19)
So the solutions of the system, for example, are the following sets of variables (1; 2; 0), (2; 26; 14), etc. Formulas (1.19) express the general (any) solution of the system (1.18).

In the case when the original system (1.16) has sufficient a large number of equations and unknowns, the indicated method of ordinary Jordan elimination seems cumbersome. However, it is not. It is enough to derive an algorithm for recalculating the system coefficients at one step in general view and formulate the solution to the problem in the form of special Jordan tables.

Let a system of linear forms (equations) be given:

, (1.20)
Where x j- independent (sought) variables, a ij- constant odds
(i = 1, 2,…, m; j = 1, 2,…, n). Right parts of the system y i (i = 1, 2,…, m) can be either variables (dependent) or constants. It is required to find solutions to this system by eliminating the unknowns.

Let us consider the following operation, henceforth called “one step of ordinary Jordan eliminations”. From arbitrary ( r th) equality we express an arbitrary variable ( xs) and substitute into all other equalities. Of course, this is only possible if a rs¹ 0. Coefficient a rs called the resolving (sometimes guiding or main) element.

We will get the following system:

. (1.21)

From s- equality of system (1.21), we subsequently find the variable xs(after the remaining variables have been found). S The -th line is remembered and subsequently excluded from the system. The remaining system will contain one equation and one less independent variable than the original system.

Let us calculate the coefficients of the resulting system (1.21) through the coefficients of the original system (1.20). Let's start with r th equation, which after expressing the variable xs through the remaining variables it will look like this:

Thus, the new coefficients r th equations are calculated using the following formulas:

(1.23)
Let us now calculate the new coefficients b ij(i¹ r) arbitrary equation. To do this, let us substitute the variable expressed in (1.22) xs V i th equation of system (1.20):

After bringing similar terms, we get:

(1.24)
From equality (1.24) we obtain formulas by which the remaining coefficients of system (1.21) are calculated (with the exception r th equation):

(1.25)
The transformation of systems of linear equations by the method of ordinary Jordan elimination is presented in the form of tables (matrices). These tables are called “Jordan tables”.

Thus, problem (1.20) is associated with the following Jordan table:

Table 1.1

x 1 x 2 x j xs x n
y 1 = a 11 a 12 a 1j a 1s a 1n
…………………………………………………………………..
y i= a i 1 a i 2 a ij a is a in
…………………………………………………………………..
y r= a r 1 a r 2 a rj a rs arn
………………………………………………………………….
y n= a m 1 a m 2 a mj a ms a mn

Jordan table 1.1 contains a left header column in which the right parts of the system (1.20) are written and an upper header row in which independent variables are written.

The remaining elements of the table form the main matrix of coefficients of system (1.20). If you multiply the matrix A to the matrix consisting of the elements of the top title row, you get a matrix consisting of the elements of the left title column. That is, essentially, the Jordan table is a matrix form of writing a system of linear equations: . System (1.21) corresponds to the following Jordan table:

Table 1.2

x 1 x 2 x j y r x n
y 1 = b 11 b 12 b 1 j b 1 s b 1 n
…………………………………………………………………..
y i = b i 1 b i 2 b ij b is b in
…………………………………………………………………..
x s = b r 1 b r 2 b rj b rs brn
………………………………………………………………….
y n = b m 1 b m 2 b mj bms b mn

Permissive element a rs we will highlight in bold. Recall that to implement one step of Jordan elimination, the resolving element must be non-zero. The table row containing the enabling element is called the enabling row. The column containing the enable element is called the enable column. When moving from a given table to the next table, one variable ( xs) from the top header row of the table is moved to the left header column and, conversely, one of the free members of the system ( y r) moves from the left head column of the table to the top head row.

Let us describe the algorithm for recalculating the coefficients when moving from the Jordan table (1.1) to the table (1.2), which follows from formulas (1.23) and (1.25).

1. The resolving element is replaced by the inverse number:

2. The remaining elements of the resolving string are divided into the resolving element and change the sign to the opposite:

3. The remaining elements of the resolution column are divided into the resolution element:

4. Elements that are not included in the allowing row and allowing column are recalculated using the formulas:

The last formula is easy to remember if you notice that the elements that make up the fraction , are at the intersection i-oh and r th lines and j th and s th columns (resolving row, resolving column, and the row and column at the intersection of which the recalculated element is located). More precisely, when memorizing the formula you can use the following diagram:

-21 -26 -13 -37

When performing the first step of Jordan exceptions, you can select any element of Table 1.3 located in the columns as a resolving element x 1 ,…, x 5 (all specified elements are not zero). Just don't select the enabling element in the last column, because you need to find independent variables x 1 ,…, x 5 . For example, we choose the coefficient 1 with variable x 3 in the third line of Table 1.3 (the enabling element is shown in bold). When moving to table 1.4, the variable x The 3 from the top header row is swapped with the constant 0 of the left header column (third row). In this case, the variable x 3 is expressed through the remaining variables.

String x 3 (Table 1.4) can, after remembering in advance, be excluded from Table 1.4. The third column with a zero in the top title line is also excluded from Table 1.4. The point is that regardless of the coefficients of a given column b i 3 all corresponding terms of each equation 0 b i 3 systems will be equal to zero. Therefore, these coefficients need not be calculated. Eliminating one variable x 3 and remembering one of the equations, we arrive at a system corresponding to Table 1.4 (with the line crossed out x 3). Selecting in table 1.4 as a resolving element b 14 = -5, go to table 1.5. In Table 1.5, remember the first row and exclude it from the table along with the fourth column (with a zero at the top).

Table 1.5 Table 1.6

From last table 1.7 we find: x 1 = - 3 + 2x 5 .

Consistently substituting the already found variables into the remembered lines, we find the remaining variables:

Thus, the system has infinitely many solutions. Variable x 5, arbitrary values ​​can be assigned. This variable acts as a parameter x 5 = t. We proved the compatibility of the system and found it common decision:

x 1 = - 3 + 2t

x 2 = - 1 - 3t

x 3 = - 2 + 4t . (1.27)
x 4 = 4 + 5t

x 5 = t

Giving parameter t different meanings, we will obtain an infinite number of solutions to the original system. So, for example, the solution to the system is the following set of variables (- 3; - 1; - 2; 4; 0).

With the same number of equations as the number of unknowns with the main determinant of the matrix, which is not equal to zero, the coefficients of the system (for such equations there is a solution and there is only one).

Cramer's theorem.

When the determinant of the matrix of a square system is non-zero, it means that the system is consistent and it has one solution and it can be found by Cramer's formulas:

where Δ - determinant of the system matrix,

Δ i is the determinant of the system matrix, in which instead of i The th column contains the column of right sides.

When the determinant of a system is zero, it means that the system can become cooperative or incompatible.

This method is usually used for small systems with extensive calculations and if it is necessary to determine one of the unknowns. The complexity of the method is that many determinants need to be calculated.

Description of the Cramer method.

There is a system of equations:

A system of 3 equations can be solved using the Cramer method, which was discussed above for a system of 2 equations.

We compose a determinant from the coefficients of the unknowns:

It will be system determinant. When D≠0, which means the system is consistent. Now let's create 3 additional determinants:

,,

We solve the system by Cramer's formulas:

Examples of solving systems of equations using Cramer's method.

Example 1.

Given system:

Let's solve it using Cramer's method.

First you need to calculate the determinant of the system matrix:

Because Δ≠0, which means that from Cramer’s theorem the system is consistent and it has one solution. We calculate additional determinants. The determinant Δ 1 is obtained from the determinant Δ by replacing its first column with a column of free coefficients. We get:

In the same way, we obtain the determinant of Δ 2 from the determinant of the system matrix by replacing the second column with a column of free coefficients: