Cramer’s Rule Calculator for 2×2 Linear Systems (Determinants D, Dx, Dy)

Compute system determinant D, Cramer’s determinants D_x and D_y, and exact coordinates (x, y).

Solution Coordinate x (Dx / D) 4 x (y = 2)
Solution Coordinate y (Dy / D) 2 y
System Determinant D -5 det(A)
Solution Euclidean Norm √(x² + y²) 4.472 ||x||₂
Inputs
Try:
a₁
Coefficient a₁ in Equation 1 (a₁x + b₁y = c₁).
b₁
Coefficient b₁ in Equation 1.
c₁
Right-hand side c₁ in Equation 1.
a₂
Coefficient a₂ in Equation 2 (a₂x + b₂y = c₂).
b₂
Coefficient b₂ in Equation 2.
c₂
Right-hand side c₂ in Equation 2.
Results & Graph
Solution Coordinate x (Dx / D)
4 x (y = 2)
Solution Coordinate y (Dy / D)
2 y
System Determinant D
-5 det(A)
Solution Euclidean Norm √(x² + y²)
4.472 ||x||₂

Solution Coordinate x (Dx / D)

Graph 1 • How the inputs feed Cramer’s Rule System Solver
Cramer’s Rule 2×2 & Diagonal-Dominant 3×3 Linear System (Ax = b) Solver Calculator • Custom Domain Schematic (Linear Algebra & Vectors) Invariants: coeffA1, coeffB1 (Cramer’s Rule System S) Coeff A1: 3 a₁ • Coeff B1: 2 b₁ SOLUTION COORDINATE X (DX 4 x (y = 2) • Solution Coordinate y : 2 y • System Determinant D: -5 det(A) Eq: D = a₁b₂ − b₁a₂; x = (c₁b₂ − b
Graph 2 • Solution Coordinate x (Dx / D) as Coeff A1 changes (40% to 160% of current)
0 x (y = 3.44 x (y = 6.88 x (y = 6.25 1.20a₁ 5.26 1.80a₁ 4.54 2.40a₁ 4 3a₁ 3.57 3.60a₁ 3.23 4.20a₁ 2.94 4.80a₁
Graph 3 • Coeff A1 and Coeff B1 together Compares Solution Coordinate x (Dx / D) when Coeff B1 is shifted +25% (solid) vs. −25% (dashed).
0 x (y = 2.90 x (y = 5.81 x (y = --- Coeff B1 @ 75% 4.57 -30% 4.16 -15% 3.82 +0% 3.53 +15% 3.28 +30%
Summary: System determinant D = -5, Cramer numerators D_x = -20 and D_y = -10, yielding unique intersection (x, y) = (4, 2).
Summary: System determinant D = -5, Cramer numerators D_x = -20 and D_y = -10, yielding unique intersection (x, y) = (4, 2).
Interactive chart & math engine powered by CalculatorGraph

Formula: Cramer’s Rule System Solver Formula

D = a₁b₂ − b₁a₂
x = (c₁b₂ − b₁c₂) / D
y = (a₁c₂ − c₁a₂) / D
D = a₁b₂ − b₁a₂; x = (c₁b₂ − b₁c₂) / D; y = (a₁c₂ − c₁a₂) / D
  • coeffA1: Coeff A1 (a₁)
  • coeffB1: Coeff B1 (b₁)
  • rhsC1: Rhs C1 (c₁)
  • coeffA2: Coeff A2 (a₂)
  • coeffB2: Coeff B2 (b₂)
  • rhsC2: Rhs C2 (c₂)

Frequently Asked Questions

How does the Cramer’s Rule 2×2 & Diagonal-Dominant 3×3 Linear System (Ax = b) Solver Calculator compute the solution?

It evaluates D = a₁b₂ − b₁a₂; x = (c₁b₂ − b₁c₂) / D; y = (a₁c₂ − c₁a₂) / D directly in your browser and updates three custom SVG visualizations in real time.

Can I solve a system of three equations on this page?

Not directly. The engine is built for the 2×2 case: six inputs, one 2×2 determinant and two numerators. Cramer's rule works the same way for three equations, but you would need nine coefficients and four 3×3 determinants. The guide above works a 3×3 example by hand using the identical rule, x_i = det(A_i) / det(A), so you can follow the pattern without the tool.

Does the order of the equations matter?

Not for the solution. Swapping the two equations flips the sign of D, D_x and D_y together, so every ratio stays the same and x and y do not change. You can check this by entering x − y = 2 as the first equation and 3x + 2y = 16 as the second: the determinant becomes 5 instead of −5, and the solution is still (4, 2).

What if I swap which unknown is called x and which is called y?

Then you must swap the coefficient columns too: what you typed as a₁ and a₂ moves to b₁ and b₂, and vice versa. If you rename the variables but leave the boxes alone, you are solving for different quantities than you think. The right-hand side values c₁ and c₂ stay where they are in either case.

Can the solution contain fractions even with whole-number inputs?

Yes. With integer coefficients the answer is always a fraction D_x / D and D_y / D, and it is a whole number only when D divides both numerators evenly. The a₁ = 1.8 preset shows a decimal result, 5.263, because −20 divided by −3.8 does not come out evenly. For an exact fraction, read the numerators from the interpretation line and divide them yourself.

How many decimal places does the solver show?

The headline coordinates are rounded to three decimals, as in x = 5.263, while the interpretation line shows four, as in 5.2632. For most homework and engineering checks that is plenty. If you need an exact value, take D, D_x and D_y from the interpretation line and keep the answer as a fraction rather than relying on the rounded decimal.

Is Cramer's rule the fastest way to solve two equations?

For two unknowns it is about as quick as substitution or elimination, and it has the advantage of being a fixed formula with no choices to make. That is why it suits a calculator. For three unknowns it is still manageable by hand. Beyond that, elimination needs far fewer multiplications, so Cramer's rule is mainly a teaching and checking tool for larger systems.

What does it mean if D is positive in one system and negative in another?

Nothing about solvability. The sign of a 2×2 determinant tells you whether the two coefficient columns are arranged clockwise or anticlockwise, which also flips if you swap the equations. Only the magnitude matters in practice: zero means no unique solution, and a value very small relative to the coefficients means the solution is sensitive to small input changes.

Can I use this to find where two straight lines on a graph cross?

Yes, that is exactly what it computes. Write each line in the form ax + by = c and enter the two sets of numbers. The default system is the crossing of 3x + 2y = 16 and x − y = 2, which meet at (4, 2). If D is zero the lines are parallel or identical and there is no single crossing point.

What does the error about D being 0 mean?

It means the two equations do not cross at a single point. The message says which case you have: parallel lines with no solution, or the same line written twice with infinitely many solutions. Check your entries first, since a mistyped coefficient can create either case by accident. If the inputs are right, the system genuinely has no unique answer and Cramer's rule cannot produce one.

Can the coefficients be zero?

Individual coefficients can be zero, and that simply means a variable is absent from an equation. Entering 2y = 6 and x = 5 with zeros in the right boxes gives x = 5 and y = 3. What cannot happen is a zero determinant if you want a unique answer, which occurs, for example, when an entire column or row of coefficients is zero.

Two equations, six inputs, one determinant

The solver takes six numbers: the coefficients and right-hand side of two equations in two unknowns. The default system is 3x + 2y = 16 and x − y = 2. Those are the inputs a₁ = 3, b₁ = 2, c₁ = 16, a₂ = 1, b₂ = −1 and c₂ = 2.

The result reads x = 4 and y = 2, with a system determinant D of −5 and a Euclidean norm of 4.472. You can confirm the answer in a few seconds by substituting it back. Three fours plus two twos is 16, and four minus two is 2. Both equations hold, so the solution is right.

That substitution step is worth doing every time. It is the cheapest check there is, and it catches the most common error on this page, which is a coefficient typed into the wrong box. If you swap b₁ and c₁, for example, the solver happily returns a different pair of numbers that solve a different system.

Working the default through Cramer's rule by hand

Cramer's rule says each unknown equals a ratio of determinants: x_i = det(A_i) / det(A). Here A is the 2×2 matrix of coefficients, and A_i is the same matrix with column i replaced by the right-hand side.

For the default, the coefficient matrix has rows (3, 2) and (1, −1). Its determinant is D = a₁b₂ − b₁a₂ = 3 × (−1) − 2 × 1 = −3 − 2 = −5.

To get D_x, replace the first column with the right-hand side (16, 2). The matrix becomes rows (16, 2) and (2, −1), and D_x = 16 × (−1) − 2 × 2 = −16 − 4 = −20. Then x = −20 / −5 = 4.

To get D_y, replace the second column instead. The rows become (3, 16) and (1, 2), so D_y = 3 × 2 − 16 × 1 = 6 − 16 = −10, and y = −10 / −5 = 2. The interpretation line under the result prints exactly these numerators, D_x = −20 and D_y = −10, so you can compare your hand working against the engine line by line.

A negative determinant is nothing to worry about. Its sign only records the orientation of the two coefficient columns. What matters for solving is whether D is zero.

What changing a₁ does, and what it cannot touch

The Lower and Higher presets vary only the first coefficient, a₁. At a₁ = 1.8, the determinant becomes −3.8 and the solution moves to x = 5.263, y = 3.263, with a norm of 6.193. At a₁ = 4.5, the determinant is −6.5 and the solution is x = 3.077, y = 1.077, with a norm of 3.26.

Look at the numerators in those runs. D_x is −20 in all three cases. That is because D_x is built from the right-hand side and the second column, and a₁ is not in either. Only D and D_y change when you change a₁. So x moves purely because its denominator moves: −20 divided by −3.8, by −5, or by −6.5.

Geometrically, each equation is a line in the plane and the solution is where they cross. Changing a₁ tilts the first line while it keeps passing through the point (0, 8), its intercept on the y axis. The second line, x − y = 2, stays put. So all three solutions lie on that second line, which you can check: 5.263 − 3.263, 4 − 2 and 3.077 − 1.077 all equal 2.

The determinant check before you trust any answer

A unique solution exists only when D is not zero. If D = 0 the two lines are parallel (no solution) or the same line (infinitely many), and Cramer's rule has nothing to divide by.

The solver checks for this before dividing. Enter 2x + 3y = 7 and 4x + 6y = 15, a pair of parallel lines, and instead of coordinates it reports that D is 0 and the lines are parallel, so the system has no solution. Enter a dependent pair such as 2x + 4y = 8 and x + 2y = 4 and it reports that both equations describe the same line, so there are infinitely many solutions and no unique answer.

You can tell the two cases apart by hand too. Check whether one equation is an exact multiple of the other, including the right-hand side. If it is, the lines coincide; if only the left sides are multiples, they are parallel. In the parallel example, doubling the first equation gives 4x + 6y = 14, which cannot also equal 15.

When the page does give coordinates, it is still worth glancing at the System Determinant D line, because a value very close to zero carries its own warning, covered next.

Near-zero determinants and sensitive solutions

A determinant that is small but not zero is its own warning. Try x + y = 2 and x + 1.001y = 2.001. The solver reports D = 0.001 and the solution (1, 1). Now change only c₂ from 2.001 to 2.002, a shift in the fourth significant figure, and the solution jumps to (0, 2).

The two lines in that system are almost parallel, so a tiny change in where one of them sits moves their crossing point a long way along both. Mathematicians call such a system ill-conditioned. Cramer's rule gives the exact answer for the numbers you typed, but if those numbers came from measurements with any rounding in them, the answer may not mean much.

A rough test is to compare D with the size of the coefficients. In the default system the coefficients are around 1 to 3 and D is −5, comfortably large. In the near-parallel example the coefficients are about 1 and D is 0.001, a thousand times smaller. When you see a ratio like that, treat the solution with suspicion and check the inputs.

Extending the same rule to a 3×3 system by hand

The rule extends to three equations without change: x = det(A_x)/det(A), y = det(A_y)/det(A), z = det(A_z)/det(A). Only the determinants get bigger. This calculator does not take nine coefficients, so a 3×3 system has to be worked by hand or split another way.

Take x + y + z = 6, 2x − y + z = 3 and x + 2y − z = 2. Expanding along the first row, det(A) = 1 × ((−1)(−1) − 1 × 2) − 1 × (2 × (−1) − 1 × 1) + 1 × (2 × 2 − (−1) × 1) = −1 + 3 + 5 = 7.

Replace the first column with (6, 3, 2) and the determinant is 7, so x = 1. Replace the second column and it is 14, so y = 2. Replace the third and it is 21, so z = 3. Substituting (1, 2, 3) into all three equations gives 6, 3 and 2, which confirms it.

That is four 3×3 determinants for one solution, each needing six products. It is fine for homework and for small systems where you want exact fractions. For anything larger, elimination methods do far less arithmetic, which is why software rarely uses Cramer's rule beyond small cases.

The Euclidean norm line, and when it is useful

The last supporting line is √(x² + y²), the length of the solution vector measured from the origin. For the default (4, 2) that is √20, which the page rounds to 4.472.

It is not part of Cramer's rule. It is an extra summary that helps when you are comparing solutions, for instance seeing that the a₁ = 1.8 system pushes the solution further from the origin (norm 6.193) than the a₁ = 4.5 system does (norm 3.26). In applied work the norm can also flag a solution that is unreasonably large, which is often the first sign of a near-singular system or an input error.

When D is zero the page shows no norm at all, since there is no single solution vector to measure. A norm that is very large compared with the inputs usually means D is small and the system is close to singular.

Entry habits that prevent wrong answers

Rearrange each equation into the form ax + by = c before typing anything. An equation such as y = 2x − 3 becomes −2x + y = −3, so a = −2, b = 1 and c = −3. Forgetting to move a term across, or moving it without changing its sign, is the usual source of a wrong solution.

If a variable is missing from an equation, its coefficient is 0, not blank. The system 2y = 6 and x = 5 is entered as a₁ = 0, b₁ = 2, c₁ = 6, a₂ = 1, b₂ = 0, c₂ = 5, and the solver gives x = 5 and y = 3 with D = −2.

Decimals are fine and so are negative numbers. Fractions need converting first, ideally with enough decimal places that rounding does not matter. If the system is close to singular, rounding a third to 0.33 can change the answer noticeably, so in that case multiply through by the denominator and enter whole numbers instead.