Cramer's Rule Calculator
Solve 2x2 and 3x3 systems of linear equations using Cramer's rule with step-by-step determinants Dx, Dy, Dz, and matrix solutions.
What is Cramer's Rule?
Cramer's Rule is an explicit mathematical formula used in linear algebra to solve a system of linear equations with as many equations as unknowns, provided the system has a unique solution.
Named after Swiss mathematician Gabriel Cramer (1704–1752), the method expresses each unknown variable as the ratio of two determinants:
$$x_i = \frac{\det(A_i)}{\det(A)} = \frac{D_i}{D}$$Where $D = \det(A)$ is the determinant of the coefficient matrix, and $D_i = \det(A_i)$ is the determinant formed by replacing the $i$-th column of $A$ with the column vector of constants.
Cramer's Rule for a 2x2 System
Consider a system of two linear equations in two variables $x$ and $y$:
$$\begin{cases} a_1 x + b_1 y = c_1 \\ a_2 x + b_2 y = c_2 \end{cases}$$The determinants are calculated as:
- Main Determinant $D$: $$D = \begin{vmatrix} a_1 & b_1 \\ a_2 & b_2 \end{vmatrix} = a_1 b_2 - b_1 a_2$$
- Variable Determinant $D_x$: Replace column 1 ($x$) with constants: $$D_x = \begin{vmatrix} c_1 & b_1 \\ c_2 & b_2 \end{vmatrix} = c_1 b_2 - b_1 c_2$$
- Variable Determinant $D_y$: Replace column 2 ($y$) with constants: $$D_y = \begin{vmatrix} a_1 & c_1 \\ a_2 & c_2 \end{vmatrix} = a_1 c_2 - c_1 a_2$$
If $D \neq 0$, the unique solution is given by:
$$x = \frac{D_x}{D}, \quad y = \frac{D_y}{D}$$Cramer's Rule for a 3x3 System
For three equations in three variables $x, y, z$:
$$\begin{cases} 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{cases}$$The variables are computed by substituting the constants vector into each respective column:
$$x = \frac{D_x}{D}, \quad y = \frac{D_y}{D}, \quad z = \frac{D_z}{D}$$Singular Cases and Determinant Conditions
When evaluating the main determinant $D = \det(A)$:
- $D \neq 0$ (Unique Solution): The system is independent and consistent. Exactly one point $(x, y)$ or $(x, y, z)$ satisfies all equations simultaneously.
- $D = 0$ and $D_x = D_y = D_z = 0$ (Infinitely Many Solutions): The equations are linearly dependent. Geometrically, the lines or planes coincide or intersect along a common line.
- $D = 0$ and at least one $D_i \neq 0$ (No Solution): The system is inconsistent. Geometrically, the lines or planes are parallel and never intersect.
Related Linear Algebra Tools
Explore other matrix and algebra calculators on OnlineMiniTools:
- Adjoint Matrix Calculator: Calculate adjoint, cofactor matrix, and matrix inverse.
- Condition Number Calculator: Evaluate matrix conditioning and numerical stability.
- Corner Point Calculator: Solve linear programming systems graphically.
Frequently Asked Questions
When can Cramer's rule not be used?
Cramer's rule can only be applied to square linear systems (equal number of equations and variables) where the main determinant is non-zero ($D \neq 0$). When $D = 0$, Gaussian elimination or row reduction must be used to inspect infinite or zero solution sets.
Is Cramer's rule faster than Gaussian elimination?
For small 2x2 and 3x3 systems, Cramer's rule is very fast and intuitive because determinants can be computed directly by hand or in code. For large systems (e.g., $n \ge 4$), Gaussian elimination is computationally more efficient.
What does it mean if all determinants equal zero?
If $D = 0$ and all variable determinants ($D_x, D_y, D_z$) are also 0, the system is dependent and possesses infinitely many solutions.
Can Cramer's rule handle decimal or negative coefficients?
Yes. This calculator supports any real numeric input, including positive, negative, and fractional decimal coefficients for all matrix cells and constant terms.
Related Tools
Recent Visits
Finance Calc Kit
Focused calculators on Finance Calc Kit for loans, compounding investments, contractor tax estimates, and reti...
Explore Finance Calc Kit