System of Equations Calculator
2x + 3y = 7 and 4x − y = 5 have exactly one solution: x = 11/7, y = 9/7 (x ≈ 1.5714, y ≈ 1.2857), the point where the two lines cross. To solve a system by hand, row-reduce the augmented matrix [2 3 | 7; 4 −1 | 5] until the left side is the identity matrix (Gaussian elimination), or use Cramer’s rule: here D = −14, x = Dx / D = −22 / −14 = 11/7; y = Dy / D = −18 / −14 = 9/7. If D = 0 there is no single solution: x + y = 2 and 2x + 2y = 5 are parallel lines with no solution, while x + y = 2 and 2x + 2y = 4 are the same line, so x = 2 − t, y = t. Three equations in three unknowns work the same way: 2x + y − z = 8, −3x − y + 2z = −11, −2x + y + 2z = −3 gives x = 2, y = 3, z = −1. This calculator keeps every answer as an exact fraction, shows each row operation, and graphs the two lines.
Updated Runs in your browser: nothing you enter is uploadedHow this tool works
2x + 3y = 7 · 4x − y = 5
x = 11/7, y = 9/7
Exactly one pair (x, y) satisfies both equations.
- Solution as decimals
- x ≈ 1.5714, y ≈ 1.2857
- Determinant D = det(A)
- −14
- Dx (x column replaced by the constants)
- −22
- Dy (y column replaced by the constants)
- −18
- Cramer’s rule
- x = Dx / D = −22 / −14 = 11/7; y = Dy / D = −18 / −14 = 9/7
- Rank of A
- 2
- Rank of [A | d]
- 2
- Geometric reading
- The two lines cross at exactly one point, (11/7, 9/7).
Graph of the two lines
The row reduction, step by step
- Write the system as an augmented matrix [A | d]: one row per equation, the coefficients of x, y first and the constant after the divider.
Column 1 Column 2 Constant Equation 1 2 3 7 Equation 2 4 −1 5 - R1 ← R1 ÷ 2, to make the pivot 1.
Column 1 Column 2 Constant Equation 1 1 3/2 7/2 Equation 2 4 −1 5 - R2 ← R2 − 4·R1, to clear the pivot column.
Column 1 Column 2 Constant Equation 1 1 3/2 7/2 Equation 2 0 −7 −9 - R2 ← R2 ÷ (−7), to make the pivot 1.
Column 1 Column 2 Constant Equation 1 1 3/2 7/2 Equation 2 0 1 9/7 - R1 ← R1 − (3/2)·R2, to clear the pivot column.
Column 1 Column 2 Constant Equation 1 1 0 11/7 Equation 2 0 1 9/7 - The left side is now the identity matrix, so the right column is the solution: x = 11/7, y = 9/7.
- Check by putting the solution back into each equation. Equation 1: 2·(11/7) + 3·(9/7) = 7, as required. Equation 2: 4·(11/7) + (−1)·(9/7) = 5, as required.
- Cramer’s rule uses the determinant D = ad − bc = 2·(−1) − 3·4 = −14.
- Replacing one column at a time by the constants gives Dx = −22, Dy = −18, so x = Dx / D = 11/7, y = Dy / D = 9/7: the same answer.
Worked examples: one, none or infinitely many solutions
| System | What it shows | Outcome | D = det(A) | Solution |
|---|---|---|---|---|
| 2x + 3y = 7; 4x − y = 5 | Two lines that cross | One solution | −14 | x = 11/7, y = 9/7 |
| 2y = 4; x + y = 3 | Needs a row swap (a zero in the first pivot) | One solution | −2 | x = 1, y = 2 |
| (1/2)x + (1/4)y = 3; x − y = 0 | Decimal coefficients (typed as 0.5 and 0.25) | One solution | −3/4 | x = 4, y = 4 |
| (1/2)x + (1/3)y = 1; x − y = −1/2 | Fraction coefficients (typed as 1/2 and 1/3) | One solution | −5/6 | x = 1, y = 3/2 |
| x + y = 2; 2x + 2y = 5 | Parallel lines | No solution | 0 | None |
| x + y = 2; 2x + 2y = 4 | The same line twice | Infinitely many solutions | 0 | x = 2 − t, y = t |
| 2x + y − z = 8; −3x − y + 2z = −11; −2x + y + 2z = −3 | Three equations, one point | One solution | −1 | x = 2, y = 3, z = −1 |
| x + y + z = 1; x + y + z = 2; x − y = 0 | Three equations that contradict | No solution | 0 | None |
| x + y + z = 3; 2x − y + z = 0; 3x + 2z = 3 | Three equations, a line of solutions | Infinitely many solutions | 0 | x = 1 − (2/3)t, y = 2 − (1/3)t, z = t |
| x + 2y + 3z = 6; 2x + 4y + 6z = 12; 3x + 6y + 9z = 18 | Three equations, a plane of solutions | Infinitely many solutions | 0 | x = 6 − 2s − 3t, y = s, z = t |
What the determinant and the ranks tell you
| Outcome | Determinant | Ranks | Two equations | Three equations | Examples |
|---|---|---|---|---|---|
| One solution | D is not 0 | rank A = rank [A | d] = number of unknowns | The lines cross at one point | The planes meet at one point | 2 × 2: 2x + 3y = 7; 4x − y = 5 gives x = 11/7, y = 9/7 (rank of A 2, rank of [A | d] 2). 3 × 3: 2x + y − z = 8; −3x − y + 2z = −11; −2x + y + 2z = −3 gives x = 2, y = 3, z = −1 (rank of A 3, rank of [A | d] 3). |
| Infinitely many solutions | D is 0 | rank A = rank [A | d], less than the number of unknowns | The two equations are the same line | The planes share a whole line, or are all the same plane | 2 × 2: x + y = 2; 2x + 2y = 4 gives x = 2 − t, y = t (rank of A 1, rank of [A | d] 1). 3 × 3: x + y + z = 3; 2x − y + z = 0; 3x + 2z = 3 gives x = 1 − (2/3)t, y = 2 − (1/3)t, z = t (rank of A 2, rank of [A | d] 2). |
| No solution | D is 0 | rank A is less than rank [A | d] | The lines are parallel | No point lies on all three planes | 2 × 2: x + y = 2; 2x + 2y = 5 gives no solution (rank of A 1, rank of [A | d] 2). 3 × 3: x + y + z = 1; x + y + z = 2; x − y = 0 gives no solution (rank of A 2, rank of [A | d] 3). |
How many unknowns stay free
| Size | Rank of A | Free variables | Solutions form | Example | Result |
|---|---|---|---|---|---|
| 2 × 2 | 2 | 0 | A single point | 2x + 3y = 7; 4x − y = 5 | x = 11/7, y = 9/7 |
| 2 × 2 | 1 | 1 | A line | x + y = 2; 2x + 2y = 4 | x = 2 − t, y = t |
| 2 × 2 | 0 | 2 | The whole plane | 0 = 0; 0 = 0 | x = s, y = t |
| 3 × 3 | 3 | 0 | A single point | 2x + y − z = 8; −3x − y + 2z = −11; −2x + y + 2z = −3 | x = 2, y = 3, z = −1 |
| 3 × 3 | 2 | 1 | A line in space | x + y + z = 3; 2x − y + z = 0; 3x + 2z = 3 | x = 1 − (2/3)t, y = 2 − (1/3)t, z = t |
| 3 × 3 | 1 | 2 | A plane in space | x + 2y + 3z = 6; 2x + 4y + 6z = 12; 3x + 6y + 9z = 18 | x = 6 − 2s − 3t, y = s, z = t |
| 3 × 3 | 0 | 3 | All of space | 0 = 0; 0 = 0; 0 = 0 | x = r, y = s, z = t |
How to solve a system of linear equations by row reduction
- Write every equation as ax + by = d. Move the variables to the left and the constant to the right, and put 0 for a missing variable. The example is 2x + 3y = 7 and 4x − y = 5; 2y = 4 and x + y = 3 has no x in its first equation, so that coefficient is 0.
- Build the augmented matrix [A | d]. Each row holds one equation: the coefficients, then the constant. The example becomes [2 3 | 7; 4 −1 | 5].
- Row-reduce to the identity matrix. Swap rows if a pivot is 0, divide a row to make its pivot 1, then subtract multiples of it from the other rows to clear its column. The first moves for the example are: R1 ← R1 ÷ 2, to make the pivot 1. R2 ← R2 − 4·R1, to clear the pivot column.
- Read the answer from the right-hand column. When the left side is the identity, the right column is the solution: x = 11/7, y = 9/7. A row that reads 0 = 1 means no solution, as for x + y = 2 and 2x + 2y = 5; a row of zeros leaves a free variable and infinitely many solutions, as for x + y = 2 and 2x + 2y = 4, where x = 2 − t, y = t.
- Check the solution in every equation. Check by putting the solution back into each equation. Equation 1: 2·(11/7) + 3·(9/7) = 7, as required. Equation 2: 4·(11/7) + (−1)·(9/7) = 5, as required.
Frequently asked questions
- How do you solve a system of two equations with two unknowns?
- Eliminate one unknown by adding a multiple of one equation to the other, solve for the other unknown, then substitute back. For 2x + 3y = 7 and 4x − y = 5 the calculator’s first two row operations are “R1 ← R1 ÷ 2” and “R2 ← R2 − 4·R1”, and the reduction ends with x = 11/7, y = 9/7. Substitution, elimination and row reduction always agree; the row-reduction form is the one that extends to three or more unknowns.
- How do you solve three equations with three unknowns?
- Use the same row reduction on a 3 × 3 system, clearing one column at a time. Choose “3 equations, 3 unknowns” and enter all twelve numbers. 2x + y − z = 8, −3x − y + 2z = −11, −2x + y + 2z = −3 reduces to x = 2, y = 3, z = −1, and the calculator confirms it by putting the values back into all three equations. The determinant of this system is −1, which is not 0, so the solution is unique.
- What is Cramer’s rule, and when does it fail?
- Cramer’s rule writes each unknown as a ratio of determinants: x = Dx / D, where D is the determinant of the coefficients and Dx is D with the x column replaced by the constants. For 2x + 3y = 7 and 4x − y = 5, x = Dx / D = −22 / −14 = 11/7; y = Dy / D = −18 / −14 = 9/7. It needs D ≠ 0. When D = 0 (as for x + y = 2; 2x + 2y = 5, where D = 0), dividing is impossible, and you have to find out by row reduction whether the system has no solution or infinitely many. It is also slow by hand for anything beyond 3 × 3.
- How can I tell if a system has no solution or infinitely many?
- Row-reduce and look at the rows with all-zero coefficients. A row that reads 0 = 1 contradicts itself: x + y = 2 and 2x + 2y = 5 gives no solution (rank of A 1, rank of [A | d] 2). A row that reads 0 = 0 only repeats information: x + y = 2 and 2x + 2y = 4 gives infinitely many solutions (rank of A 1, rank of [A | d] 1). In general, the system is consistent exactly when the rank of A equals the rank of [A | d] (the Rouché–Capelli theorem); then there is one solution if that rank equals the number of unknowns and infinitely many otherwise.
- What does the determinant of the coefficient matrix tell me?
- A non-zero determinant means the equations are independent, so there is exactly one solution (D = −14 for the example). A zero determinant means the rows are dependent: for two equations the lines are parallel or identical (D = 0 for x + y = 2; 2x + 2y = 5 and D = 0 for x + y = 2; 2x + 2y = 4); for three, the planes do not meet at a single point (D = 0 for x + y + z = 1; x + y + z = 2; x − y = 0). The determinant alone cannot say which of the two zero cases you are in; compare the ranks for that.
- What does “infinitely many solutions” look like as an answer?
- The answer is a recipe with a free parameter. For x + y + z = 3, 2x − y + z = 0, 3x + 2z = 3, row reduction leaves two independent equations for three unknowns, so z is free: call it t and the solution is x = 1 − (2/3)t, y = 2 − (1/3)t, z = t. Every t gives a point on a line in space, for example t = 0 gives (1, 2, 0); t = 1 gives (1/3, 5/3, 1). With only one independent equation, as in x + 2y + 3z = 6, 2x + 4y + 6z = 12, 3x + 6y + 9z = 18, two variables are free: x = 6 − 2s − 3t, y = s, z = t, and the solutions fill a plane.
- Can I enter fractions and decimals?
- Yes. Type an integer (3), a decimal (0.75) or a fraction (3/4) in any box; each is converted to an exact fraction, so nothing is rounded along the way. Typing 0.5 and 0.25 is the same as typing 1/2 and 1/4: (1/2)x + (1/4)y = 3 and x − y = 0 gives x = 4, y = 4. Fractions work the same way: (1/2)x + (1/3)y = 1 and x − y = −1/2 gives x = 1, y = 3/2. Percent signs, currency symbols and thousands commas are refused rather than guessed at.
- What if a variable is missing from an equation?
- Enter 0 for its coefficient. In 2y = 4 and x + y = 3 the first equation has no x term, so its x box holds 0; the solver swaps the rows to put a non-zero pivot on top and finds x = 1, y = 2. The same trick handles fewer equations than unknowns: pad the system with a row of zeros. Entering x + y + z = 6, x − y = 0, 0 = 0 gives infinitely many solutions, x = 3 − (1/2)t, y = 3 − (1/2)t, z = t.
- Which method is best: substitution, elimination, graphing or matrices?
- All of them give the same answer when one exists. Substitution is quick when one equation already isolates a variable. Elimination, written as row reduction, is the method that scales to three or more unknowns and reveals no-solution and infinite-solution cases cleanly. Graphing gives a picture for two unknowns but only approximate readings by eye. Cramer’s rule gives a closed formula for each unknown but needs a non-zero determinant. This calculator solves by row reduction, then shows Cramer’s rule, and for two unknowns the graph, as cross-checks.
- What does the graph and the geometric reading show?
- For two equations, each is a straight line. If the lines cross, the crossing point is the solution: for the example the calculator says “The two lines cross at exactly one point, (11/7, 9/7).” If they are parallel there is no common point: “The two lines are parallel (the same slope, different positions), so they never meet.” If they coincide, every point on the line is a solution: “Both equations describe the same line, so every point on that line is a solution.” For three equations each one is a plane in space, so there is no flat picture: the calculator reports the outcome and the working instead. The graph is drawn with equal scales on both axes, so slopes look like slopes, and line 2 is dashed so the two can be told apart without colour.
- Why are the answers fractions instead of decimals?
- Solving linear equations with whole-number coefficients produces ratios, and a fraction is the exact value: x = 11/7, y = 9/7 is exact, while x ≈ 1.5714, y ≈ 1.2857 is a rounding. The calculator shows the exact fraction first and the decimals underneath, marked ≈ when they are rounded. Using exact fractions also avoids the small errors that floating-point arithmetic can add when a system is nearly singular.
How it works
Each typed number is read as an exact fraction of two whole numbers (up to 12 digits on each side), so no rounding happens during the solution. The equations are written as an augmented matrix [A | d] and reduced by Gauss–Jordan elimination, which is Gaussian elimination carried on until every pivot is 1 and every other entry in its column is 0. For each column in turn the first row at or below the current one with a non-zero entry becomes the pivot row (swapped up if necessary), is divided by its pivot, and is subtracted, suitably multiplied, from every other row; each row operation is listed with the matrix it produces. After the reduction the rank of A is the number of pivots. A row with all-zero coefficients and a non-zero constant means no solution; otherwise, if the rank equals the number of unknowns the right-hand column is the unique solution, and if it is smaller the unknowns without a pivot are free: each is named by a parameter (t, or s and t) and the pivot unknowns are expressed in terms of them. The determinant of A is found by cofactor expansion along the first row, and Cramer’s determinants replace one column of A at a time by the constants; the answer from x = Dx / D is shown next to the row-reduction answer as a cross-check. For two equations the lines ax + by = d are drawn in a square window chosen from the exact crossing point or intercepts; the drawing uses ordinary floating point because a picture is approximate, while every number in the text is exact. The decimals line is rounded to at most 4 decimal places when the value does not end sooner, and is marked ≈ when it is rounded. Only systems with as many equations as unknowns (2 × 2 and 3 × 3) are accepted; for larger systems or for matrix operations see the matrix calculator.
Sources
- System of linear equations, Wikipedia
- Gaussian elimination, Wikipedia
- Cramer’s rule, Wikipedia
- Rouché–Capelli theorem, Wikipedia
- Strang, Introduction to Linear Algebra, Wellesley-Cambridge Press
More free tools
- Matrix CalculatorAdd, subtract and multiply matrices up to 6×6, then find the determinant, inverse, rank, transpose and RREF in exact fractions, with the row steps shown.
- Arithmetic and Geometric Sequence CalculatorFind the nth term, the sum of the first n terms, the formulas and the infinite sum of an arithmetic, geometric or Fibonacci-like sequence, step by step.
- Ratio CalculatorSimplify a ratio like 12:18 to 2:3, scale it up or down, compare two ratios, turn it into fractions and percentages, or split a total such as 500 in 3:2.
- Ratio & Proportion CalculatorSolve a/b = c/d for x by cross-multiplication with the steps shown, simplify a ratio like 6:9:15, or split a total in a ratio such as 120 in 2:3:5.
- Half-Life CalculatorSolve for the remaining amount, initial amount, elapsed time or half-life, with decay constant and mean lifetime. Switch to doubling time for growth.
- Scientific Notation ConverterConvert any number to scientific, E and engineering notation or back to standard form, round to significant figures, and count the sig figs you typed.
More: Algebra and number theoryAll math & numbersAll toolsHome & DIY calculators