Algebra • Simultaneous Linear Systems (2x2)

Linear System Solver (2 Variables)

Solve two-variable simultaneous equations with exact reduced fractions, Gaussian RREF steps, Cramer’s determinants, matrix inversion, and 2D line intersection graphing.

|
Last Updated: November 2026
|
Verified Accurate: RREF, Cramer & Matrix Inverse
Examples:

System of 2 Linear Equations

Standard form: ax + by = c

Unique Solution
Equation 1
x +
y =
Equation 2
x +
y =
x Solution
1
Exact: 1
y Solution
1
Exact: 1

2D Cartesian Line Intersection

Plots both lines and marks the exact intersection or parallel/coincident relation

D = -14 | Dx = -16 | Dy = -22 rank(A) = rank([A|b])

Step-by-Step Derivation

Direct Answer & Overview
Verified Educational Guide

How 2-Variable Linear Systems Are Solved

A 2x2 linear system a₁x + b₁y = c₁ and a₂x + b₂y = c₂ has a unique solution whenever its coefficient determinant D = a₁b₂ − a₂b₁ is nonzero, giving x = (c₁b₂ − c₂b₁)/D and y = (a₁c₂ − a₂c₁)/D. When D = 0, Gaussian row reduction distinguishes between parallel lines (no solution) and coincident lines (infinitely many solutions).

Primary Mathematical Formula Cramer’s Rule & Determinant Criterion
Standard Equation
ƒ(x)
Q.E.D.
D=a1b2−a2b1≠0  ⟹  x=c1b2−c2b1D,y=a1c2−a2c1DD = a_1 b_2 - a_2 b_1 \neq 0 \implies x = \frac{c_1 b_2 - c_2 b_1}{D}, \quad y = \frac{a_1 c_2 - a_2 c_1}{D}
Classifies unique intersection, parallel inconsistent systems, and dependent coincident lines
Exact Formula
Input Parameters
Required
1
Equation 1 Coefficients — Coefficients (a₁, b₁) and right-hand constant c₁ in a₁x + b₁y = c₁
2
Equation 2 Coefficients — Coefficients (a₂, b₂) and right-hand constant c₂ in a₂x + b₂y = c₂
Expected Outputs
Calculated
Solution Pair (x, y) — Exact simplified fractions and 6-digit floating-point coordinates
Determinants & Rank — Main determinant D, Dx, Dy, and rank(A) vs rank([A|b])
Visual & Step Proof — 2D Cartesian line graph plus Gaussian RREF and Matrix Inverse logs
Worked Numerical Example
Instant Verification
Solve the 2x2 system 2x + 3y = 7 and 4x − y = 3.
→ D = (2)(-1) − (4)(3) = −14; Dx = (7)(-1) − (3)(3) = −16; Dy = (2)(3) − (4)(7) = −22.
Result: x = 8/7 (1.142857), y = 11/7 (1.571429)

Standard Form and Cartesian Geometry of Two Lines

Every linear equation in two unknowns xx and yy takes the standard algebraic form ax+by=cax + by = c, provided at least one of aa or bb is nonzero. Pairing two such equations creates a 2×22 \times 2 linear system whose solution set consists of all coordinate pairs (x,y)(x, y) lying on both lines simultaneously:

{a1x+b1y=c1a2x+b2y=c2⟺[a1b1a2b2][xy]=[c1c2]\begin{cases} a_1 x + b_1 y = c_1 \\ a_2 x + b_2 y = c_2 \end{cases} \quad \Longleftrightarrow \quad \begin{bmatrix} a_1 & b_1 \\ a_2 & b_2 \end{bmatrix} \begin{bmatrix} x \\ y \end{bmatrix} = \begin{bmatrix} c_1 \\ c_2 \end{bmatrix}

Viewing the problem geometrically transforms abstract symbol manipulation into clear spatial intuition. When b≠0b \neq 0, each equation plots as a straight line with slope m=−a/bm = -a/b and vertical intercept c/bc/b; when b=0b = 0, the graph is a vertical line x=c/ax = c/a. Finding the algebraic root of the system is identical to locating where the two lines cross on the 2D coordinate plane. If you want to compare the three classical textbook techniques side-by-side in more narrative depth, check our guide on methods for solving systems of equations.

Four Algebraic Methods: Elimination, Substitution, Cramer, and Matrix Inverse

Linear algebra offers multiple equivalent pathways to isolate (x,y)(x, y). Selecting the cleanest technique depends on coefficient structure and whether you need exact rational numbers or quick mental verification:

Gaussian Elimination (Addition Method)

Scale one or both equations so a variable’s coefficients become additive opposites, then add the rows to cancel that variable cleanly. Reducing the augmented matrix [A∣b][A \mid \mathbf{b}] to reduced row echelon form (RREF) systematically applies this strategy and directly handles larger systems via a Gaussian elimination solver or dedicated elimination method calculator.

Cramer’s Rule via Determinants

Evaluating three 2×22 \times 2 determinants yields closed-form formulas x=Dx/Dx = D_x / D and y=Dy/Dy = D_y / D directly from the raw inputs. You can explore larger determinant expansions with a standalone Cramer’s Rule calculator or check singularity first with a matrix determinant calculator.

Matrix Inverse Multiplication

Whenever D=a1b2−a2b1≠0D = a_1b_2 - a_2b_1 \neq 0, the 2×22 \times 2 coefficient matrix has an explicit closed-form inverse computable with a matrix inverse calculator:

[xy]=A−1b=1a1b2−a2b1[b2−b1−a2a1][c1c2]\begin{bmatrix} x \\ y \end{bmatrix} = A^{-1}\mathbf{b} = \frac{1}{a_1 b_2 - a_2 b_1} \begin{bmatrix} b_2 & -b_1 \\ -a_2 & a_1 \end{bmatrix} \begin{bmatrix} c_1 \\ c_2 \end{bmatrix}

Variable Substitution

Solve one equation explicitly for y=(c1−a1x)/b1y = (c_1 - a_1 x)/b_1, substitute that expression into the second equation to obtain a single-variable linear equation in xx, and back-substitute. Substitution is especially intuitive in nonlinear extensions where one relation is quadratic rather than linear.

Determinants, Matrix Rank, and Consistency Classification

By the Rouché–Capelli Theorem, a linear system Ax=bA\mathbf{x} = \mathbf{b} is consistent if and only if the rank of the coefficient matrix AA equals the rank of the augmented matrix [A∣b][A \mid \mathbf{b}]. Whenever a zero determinant signals singular geometry, comparing rank and determinant ratios distinguishes whether the lines are disjoint parallel tracks or identical overlapping lines—a test you can also run across general sizes with a system consistency checker.

System Type Determinant Condition Rank Relation 2D Geometry
Consistent & Independent D != 0 rank(A) = rank([A|b]) = 2 Two lines intersect at one point (x, y)
Inconsistent D = 0, (Dx != 0 or Dy != 0) rank(A) < rank([A|b]) Distinct parallel lines (no solution)
Consistent & Dependent D = Dx = Dy = 0 rank(A) = rank([A|b]) < 2 Coincident lines (infinite solutions)

Ill-Conditioned Systems and Nearly Parallel Lines

Even when DD is technically nonzero, two lines whose slopes differ by a tiny amount intersect at an acute shallow angle. In numerical linear algebra, such systems exhibit a high matrix condition number κ(A)\kappa(A). Tiny measurement uncertainties of 0.0010.001 in either constant c1c_1 or c2c_2 can slide the intersection point across hundreds of units along the shared direction. Using partial pivoting during Gaussian elimination and inspecting reduced fractions keeps intermediate rounding amplification under control.

Word Problems, Economics, Circuits, and Mixture Modeling

Supply, Demand & Break-Even Economics

Equating linear revenue and cost lines locates a firm’s exact break-even unit volume, while solving market supply and demand curves yields equilibrium price and quantity.

Chemical Solutions & Alloy Mixtures

Conservation of total mass and solute mass naturally forms two equations in two unknowns when blending 20% and 65% acid solutions to achieve a target volume and molarity.

Two-Loop DC Circuit Analysis

Kirchhoff’s Voltage Law applied around two independent meshes produces a symmetric 2×22 \times 2 linear system solving directly for loop currents I1I_1 and I2I_2.

Kinematics & Relative Speed

Upstream and downstream boat rates combine vehicle speed vv and current speed cc into v+cv + c and v−cv - c, yielding immediate algebraic sums.

Step-by-Step Worked Examples Across All Three Cases

Case A: Unique Fractional Intersection

Solve 3x+2y=83x + 2y = 8 and x−4y=5x - 4y = 5. Multiplying Equation 1 by 2 gives 6x+4y=166x + 4y = 16. Adding Equation 2 eliminates yy: 7x=21  ⟹  x=37x = 21 \implies x = 3. Substituting back yields 3(3)+2y=8  ⟹  2y=−1  ⟹  y=−123(3) + 2y = 8 \implies 2y = -1 \implies y = -\frac{1}{2}. Verify: 3−4(−0.5)=53 - 4(-0.5) = 5.

Case B: Parallel Inconsistent System

Solve 2x−3y=62x - 3y = 6 and 4x−6y=154x - 6y = 15. Subtracting twice Row 1 from Row 2 yields 0x+0y=30x + 0y = 3. Because 0=30 = 3 is impossible, the two parallel lines never intersect and the solution set is empty.

Case C: Coincident Dependent Lines

Solve 2x+4y=102x + 4y = 10 and x+2y=5x + 2y = 5. Row reduction cancels the second row to 0=00 = 0, leaving one constraint x=5−2t,  y=tx = 5 - 2t, \; y = t for any real parameter t∈Rt \in \mathbb{R}. You can explore parameterizations further in our parametric solution finder or scale up to three variables using the 3-variable linear system solver.

Common Algebraic Mistakes and How to Avoid Them

  • Scaling only the left-hand side of an equation: Multiplying 2x+3y=72x + 3y = 7 by 3 requires multiplying the constant 77 by 3 as well to preserve equality.
  • Forgetting negative signs during elimination: Subtracting a negative term such as −(−y)-(-y) turns into addition; adding an explicit negated equation reduces sign errors.
  • Concluding “no solution” immediately whenever D = 0: A zero determinant happens for both inconsistent parallel lines and dependent coincident lines; always compare the right-hand side constants before stating no solution.
  • Checking only one equation at the end: Any point on Line 1 automatically satisfies Equation 1; true intersection requires plugging (x,y)(x, y) into both original equations.

Solver Architecture and Verification Standards

This interactive solver executes partial-pivoting Gaussian elimination alongside explicit determinant computation (D,Dx,Dy)(D, D_x, D_y) locally in your browser. Zero-tolerance threshold checks (∣v∣<10−10)(|v| < 10^{-10}) distinguish singular equations cleanly, continued-fraction approximation displays exact simplified fractions alongside 6-digit decimals, and residual verification confirms ∣Ax−b∣≈0|Ax - b| \approx 0 before rendering the 2D Cartesian intersection plot.

Fact-Checked & Verified • Computational Accuracy Standards
Updated November 2026 • Editorial Policy
Authored By
Sanjay Samanta

Lead Developer & Founder of Basic Math Tools. Specializes in browser-native computational algorithms and applied mathematics.

Reviewed & Verified By
Academic Review Board

Mathematics & curriculum specialists. Audited against standard algebraic and arithmetic principles.

Found an error or have an improvement suggestion? Report a calculation issue

Frequently Asked Questions

What is a system of linear equations in two variables?
A 2-variable linear system consists of two simultaneous first-degree equations written in standard form as a₁x + b₁y = c₁ and a₂x + b₂y = c₂. Each equation graphs as a straight line in the Cartesian plane, and solving the system finds all ordered pairs (x, y) that satisfy both equations at the exact same time.
What are the three possible solution types for a 2x2 linear system?
Geometrically, two lines in a plane can behave in exactly three ways: (1) Intersecting lines with different slopes have a unique solution (consistent and independent, determinant D != 0); (2) Distinct parallel lines with equal slopes and different intercepts have no solution (inconsistent, rank(A) < rank([A|b])); and (3) Coincident identical lines share every point along the line, producing infinitely many solutions (consistent and dependent).
How does Cramer’s Rule solve a 2-variable system of equations?
Cramer’s Rule expresses x and y directly as ratios of 2x2 determinants: D = a₁b₂ − a₂b₁, Dx = c₁b₂ − c₂b₁, and Dy = a₁c₂ − a₂c₁. Whenever the main determinant D != 0, the unique solution is guaranteed to be x = Dx / D and y = Dy / D without performing variable back-substitution.
Which solving method is better: elimination, substitution, or matrices?
All valid algebraic methods yield the exact same solution. Substitution works fastest when one variable already has coefficient 1 or -1; elimination (linear combination) avoids early fractions when coefficients share small common multiples; and Gaussian RREF elimination generalizes reliably to larger matrices while cleanly separating parallel (no solution) and coincident (infinite solutions) cases when D = 0.
How can you tell before solving whether a 2x2 system has no solution or infinite solutions?
Compare the coefficient ratios a₁/a₂, b₁/b₂, and constant ratio c₁/c₂ (assuming nonzero denominators). If a₁/a₂ != b₁/b₂, the determinant D is nonzero and a unique intersection exists. If a₁/a₂ = b₁/b₂ != c₁/c₂, the lines are strictly parallel with no solution. If all three ratios agree (a₁/a₂ = b₁/b₂ = c₁/c₂), one equation is a scalar multiple of the other, yielding infinitely many solutions.
Why does Cramer’s Rule fail when the determinant D equals zero?
When D = a₁b₂ − a₂b₁ = 0, dividing Dx / D and Dy / D attempts division by zero. Even more subtly, D = 0 occurs in both inconsistent parallel systems and dependent infinite-solution systems. Gaussian elimination on the augmented matrix [A|b] resolves the ambiguity immediately by checking whether row reduction yields a contradiction [0 0 | k] or a zero row [0 0 | 0].
Can a 2-variable linear system include vertical or horizontal lines?
Yes. If b₁ = 0 and a₁ != 0, the equation a₁x = c₁ defines a vertical line x = c₁/a₁ whose slope is undefined. If a₁ = 0 and b₁ != 0, b₁y = c₁ represents a horizontal line y = c₁/b₁ of zero slope. Matrix RREF and Cramer’s Rule handle horizontal and vertical lines seamlessly without dividing by individual coefficients.
How should you verify that a calculated (x, y) solution is correct?
Substitute the final values back into BOTH original equations separately—not just the rearranged form used in intermediate algebra—and check that both left-hand sides evaluate strictly to c₁ and c₂ with zero residual error.