حل نظام من 3 معادلات بـ 3 مجاهيل: طريقة المصفوفات وقاعدة كرامر
دليل حل معادلات خطية ذات 3 متغيرات باستخدام معكوس المصفوفة (AX=B) وقاعدة كرامر وحذف غاوس بخطوات واضحة.
Direct Answer / AI Overview: A system of 3 equations with 3 unknowns ($x, y, z$) is expressed in matrix notation as $AX = B$, where $A$ is the $3 \times 3$ coefficient matrix, $X = \begin{bmatrix} x \ y \ z \end{bmatrix}$ is the column vector of variables, and $B = \begin{bmatrix} b_1 \ b_2 \ b_3 \end{bmatrix}$ is the constants vector. If the coefficient determinant $\det(A) \neq 0$, the system has a unique solution given by either the Matrix Inverse Method ($X = A^{-1}B$) or Cramer’s Rule ($x = \frac{\det(A_x)}{\det(A)}, y = \frac{\det(A_y)}{\det(A)}, z = \frac{\det(A_z)}{\det(A)}$). If $\det(A) = 0$, the system has either infinitely many solutions or no solution.
Formulating a 3-Variable Linear System into Matrix Form
Consider the general system of three linear equations:
$$\begin{aligned} a_1 x + b_1 y + c_1 z &= d_1 \ a_2 x + b_2 y + c_2 z &= d_2 \ a_3 x + b_3 y + c_3 z &= d_3 \end{aligned}$$
In compact matrix form, this is written as:
$$\begin{bmatrix} a_1 & b_1 & c_1 \ a_2 & b_2 & c_2 \ a_3 & b_3 & c_3 \end{bmatrix} \begin{bmatrix} x \ y \ z \end{bmatrix} = \begin{bmatrix} d_1 \ d_2 \ d_3 \end{bmatrix} \iff AX = B$$
Method 1: The Matrix Inversion Method ($X = A^{-1}B$)
When $\det(A) \neq 0$, matrix $A$ is non-singular and has a unique multiplicative inverse $A^{-1}$. Multiplying both sides by $A^{-1}$ yields:
$$A^{-1}(AX) = A^{-1}B \implies IX = A^{-1}B \implies X = A^{-1}B$$
Recall that the inverse of a matrix is found using the adjugate and determinant:
$$A^{-1} = \frac{1}{\det(A)} \text{adj}(A)$$
For full details on constructing cofactor matrices and adjugates, see our guide on the Matrix Inverse Adjugate Method.
Method 2: Cramer’s Rule (Determinant Ratios)
Cramer’s Rule evaluates each unknown variable directly by taking the ratio of two $3 \times 3$ determinants:
$$x = \frac{\det(A_x)}{\det(A)}, \quad y = \frac{\det(A_y)}{\det(A)}, \quad z = \frac{\det(A_z)}{\det(A)}$$
Where:
- $\det(A)$ is the determinant of the original coefficient matrix.
- $A_x$ is formed by replacing Column 1 (the $x$-coefficients) with vector $B$.
- $A_y$ is formed by replacing Column 2 (the $y$-coefficients) with vector $B$.
- $A_z$ is formed by replacing Column 3 (the $z$-coefficients) with vector $B$.
You can compute all four $3 \times 3$ determinants effortlessly using our 3x3 Determinant Calculator or Determinant Calculator with Steps.
Worked Example: Step-by-Step 3x3 Solution
Let us solve the system:
$$\begin{aligned} x + 2y - z &= 3 \ 2x + 5y - z &= 8 \ 3x + 8y - 2z &= 13 \end{aligned}$$
Step 1: Set up Matrix $A$ and Vector $B$
$$A = \begin{bmatrix} 1 & 2 & -1 \ 2 & 5 & -1 \ 3 & 8 & -2 \end{bmatrix}, \quad B = \begin{bmatrix} 3 \ 8 \ 13 \end{bmatrix}$$
Step 2: Compute Main Determinant $\det(A)$
Using row cofactor expansion or Sarrus’ Rule:
$$\det(A) = 1(5 \cdot (-2) - (-1) \cdot 8) - 2(2 \cdot (-2) - (-1) \cdot 3) + (-1)(2 \cdot 8 - 5 \cdot 3)$$ $$\det(A) = 1(-10 + 8) - 2(-4 + 3) - 1(16 - 15)$$ $$\det(A) = 1(-2) - 2(-1) - 1(1) = -2 + 2 - 1 = -1$$
Since $\det(A) = -1 \neq 0$, the system has a unique solution.
Step 3: Compute Variable Determinants
-
Replace Column 1 with $B$: $$A_x = \begin{bmatrix} 3 & 2 & -1 \ 8 & 5 & -1 \ 13 & 8 & -2 \end{bmatrix} \implies \det(A_x) = -1$$ $$x = \frac{\det(A_x)}{\det(A)} = \frac{-1}{-1} = 1$$
-
Replace Column 2 with $B$: $$A_y = \begin{bmatrix} 1 & 3 & -1 \ 2 & 8 & -1 \ 3 & 13 & -2 \end{bmatrix} \implies \det(A_y) = -2$$ $$y = \frac{\det(A_y)}{\det(A)} = \frac{-2}{-1} = 2$$
-
Replace Column 3 with $B$: $$A_z = \begin{bmatrix} 1 & 2 & 3 \ 2 & 5 & 8 \ 3 & 8 & 13 \end{bmatrix} \implies \det(A_z) = -2$$ $$z = \frac{\det(A_z)}{\det(A)} = \frac{-2}{-1} = 2$$
Solution Check:
Substituting $(x=1, y=2, z=2)$ into the first equation: $$1 + 2(2) - (2) = 1 + 4 - 2 = 3 \quad \checkmark$$
Comparison: Matrix Methods vs. Substitution & Elimination
| Method | Best Used For | Computational Complexity | Determinant Requirement |
|---|---|---|---|
| Matrix Inverse ($X=A^{-1}B$) | Systems solved repeatedly with varying constant vectors $B$ | $O(n^3)$ | Requires $\det(A) \neq 0$ |
| Cramer’s Rule | Symbolic equations or finding just one variable without solving the full system | $O((n+1)!)$ or $O(n^4)$ with LU | Requires $\det(A) \neq 0$ |
| Gauss-Jordan (RREF) | Large numerical systems ($n \geq 4$) and detecting infinite/no solutions | $O(n^3)$ (Most efficient) | Works even if $\det(A) = 0$ |
| Algebraic Substitution | Simple $2 \times 2$ systems with integer coefficients | High manual error rate for $n \geq 3$ | Not applicable |
Learn how to execute Gauss-Jordan row operations in our guide on Reduced Row Echelon Form (RREF).
What If $\det(A) = 0$?
If the coefficient determinant is zero, Cramer’s Rule cannot be used because division by zero is undefined.
To determine the nature of the system when $\det(A) = 0$:
- Form the augmented matrix $[A \mid B]$ and reduce it to echelon form.
- If row reduction produces an inconsistent row like $[0 \quad 0 \quad 0 \mid k]$ where $k \neq 0$, the system has no solution (parallel or disjoint planes in 3D).
- If row reduction produces rows of all zeros $[0 \quad 0 \quad 0 \mid 0]$, the system has infinitely many solutions (planes intersect along a line or coincide).
Need additional tools?
Explore our complete collection of SEO software, AI tools, calculators and converters.
Related Mathematical Resources
Essential matrix guides, determinant theorems, and computational tutorials
- • Reduced Row Echelon Form (RREF) – Master Gauss-Jordan row reduction, leading pivot rules, and understand why full rank RREF matrices guarantee non-zero determinants. reduced row echelon form RREF guide .
- • Matrix Multiplication & Determinants – Learn row-by-column multiplication algorithms and prove the fundamental product determinant theorem det(AB) = det(A)det(B). matrix multiplication determinant rule .
- • Solving 3 Equations 3 Unknowns – Solve 3-variable linear systems comparing matrix inversion AX=B, Cramer's rule determinant ratios, and Gaussian elimination. solving 3 equations 3 unknowns matrix method .
- • Which Matrix is Invertible? – Test if a matrix is invertible, identify singular matrices with determinant zero, and solve exam problems finding parameter k. singular matrix invertibility test .
- • LU Decomposition Method – Learn how partial pivoting and triangular factorization compute matrix determinants in O(n³) polynomial time with high numerical stability. LU decomposition determinant calculation .
- • Sarrus' Rule Shortcut – Master the visual diagonal method for rapid manual 3x3 matrix determinant evaluations without expansion errors. Sarrus rule for 3x3 determinants .
- • Cramer's Rule Guide – Step-by-step guide to solving simultaneous linear equations using coefficient matrix determinant ratios. Cramer's rule linear systems .
- • Step-by-Step Methods – Compare Laplace cofactor expansion, Gaussian row reduction, and triangular methods with complete worked proofs. determinant calculator with steps .
- • Matrix Inverses & Adjugates – Understand the relationship between non-zero determinants, invertible matrix theorems, and cofactor adjugates. matrix inverse adjugate method .