2.e Cramers Rule¶
Cramer's Rule for Solving Systems of Linear Equations¶
Cramer's Rule is a method for solving systems of linear equations using determinants. It applies to a system of n
linear equations with n
unknowns, provided that the coefficient matrix has a non-zero determinant. This rule provides a straightforward way to find the values of the unknown variables by calculating determinants of matrices derived from the coefficient matrix.
1. Cramer’s Rule Overview¶
Consider a system of linear equations:
This system can be represented in matrix form as:
Where:
- A
is the coefficient matrix,
- X
is the column matrix of unknowns,
- B
is the column matrix of constants.
Formula for Cramer’s Rule¶
Cramer’s Rule provides the solution for each variable \(x_i\) as:
Where:
- \(\text{det}(A)\) is the determinant of the coefficient matrix A
.
- \(A_i\) is the matrix obtained by replacing the \(i\)-th column of A
with the constants matrix B
.
If \(\text{det}(A)\) is non-zero, the system has a unique solution.
Example 1: Solving a 2x2 System Using Cramer’s Rule¶
Consider the following system of linear equations:
Step 1: Write the system in matrix form¶
Here, the coefficient matrix A
and the constants matrix B
are:
Step 2: Find the determinant of A¶
The determinant of matrix A
is:
Step 3: Find the determinant for each variable¶
- Determinant for \(x\) (\(\text{det}(A_x)\)): Replace the first column of
A
withB
:
The determinant of \(A_x\) is:
- Determinant for \(y\) (\(\text{det}(A_y)\)): Replace the second column of
A
withB
:
The determinant of \(A_y\) is:
Step 4: Solve for \(x\) and \(y\)¶
Using Cramer’s Rule:
Thus, the solution is \(x = 1.3\) and \(y = 0.8\).
Example 2: Solving a 3x3 System Using Cramer’s Rule¶
Consider the following system of equations:
Step 1: Write the system in matrix form¶
Here: [ A = \begin{bmatrix} 1 & 2 & 3 \ 2 & 3 & 5 \ 3 & 2 & 1 \end{bmatrix}, \quad B = \begin{bmatrix} 9 \ 19 \ 10 \end{bmatrix} ]
Step 2: Find the determinant of A¶
[ = 1 \times (3 \times 1 - 5 \times 2) - 2 \times (2 \times 1 - 5 \times 3) + 3 \times (2 \times 2 - 3 \times 3) ] [ = 1 \times (3 - 10) - 2 \times (2 - 15) + 3 \times (4 - 9) ] [ = 1 \times -7 - 2 \times -13 + 3 \times -5 = -7 + 26 - 15 = 4 ]
Step 3: Find the determinant for each variable¶
- Determinant for \(x\) (\(\text{det}(A_x)\)): Replace the first column of
A
withB
:
[ \text{det}(A_x) = 9 \times \begin{vmatrix} 3 & 5 \ 2 & 1 \end{vmatrix} - 2 \times \begin{vmatrix} 19 & 5 \ 10 & 1 \end{vmatrix} + 3 \times \begin{vmatrix} 19 & 3 \ 10 & 2 \end{vmatrix} ] [ = 9 \times (3 - 10) - 2 \times (19 - 50) + 3 \times (38 - 30) ] [ = 9 \times -7 - 2 \times -31 + 3 \times 8 = -63 + 62 + 24 = 23 ]
- Determinant for \(y\) (\(\text{det}(A_y)\)): Replace the second column of
A
withB
:
After calculating, \(\text{det}(A_y) = 2\).
- Determinant for \(z\) (\(\text{det}(A_z)\)): Replace the third column of
A
withB
:
After calculating, \(\text{det}(A_z) = 10\).
Step 4: Solve for \(x\), \(y\), and \(z\)¶
Using Cramer’s Rule:
[ x = \frac{\text{det}(A_x)}{\text{det}(A)} = \frac{23}{4} = 5.75 ] [ y = \frac{\text{det}(A_y)}{\text{det}(A)} = \frac{2}{4} = 0.5 ] [ z = \frac{\text{det}(A_z)}{\text{det}(A)} = \frac{10}{4} = 2.5 ]
Thus, the solution is \(x = 5.75\), \(y = 0.5\), and \(z = 2.5\).
Conclusion¶
Cramer's Rule is a straightforward and effective method for solving small systems of linear equations using determinants. While it becomes inefficient for large systems, it provides a clear and structured way to solve systems where the determinant of the coefficient matrix is non-zero, offering insight into the relationships between variables.