Algebra & Equations

System of Equations Calculator

Solve a system of 2 to 4 linear equations, such as 2x+3y=72x + 3y = 7 and x−y=1x - y = 1, with every step shown.

Try
Enter the system as

Put each equation on its own line, or separate them with semicolons. Use 2 to 4 unknowns such as x, y, z, w; fractions and decimals are fine.

Result

Solution: x = 2, y = 1

Solution

x=2,y=1x = 2, \quad y = 1

Type of system
Consistent and independent: one solution
Solution (x, y)
(2, 1)
RankEqual to the number of unknowns
rank(A) = 2, rank([A | b]) = 2
Determinant of ANonzero: exactly one solution
−5-5
Equations and unknowns
2 equations, 2 unknowns (x, y)

The system has exactly one solution, x = 2, y = 1. Graphically, the two lines cross at this single point.

Open these lines in the graphing calculator to zoom, trace and find the intersection yourself.

The lines meet at the solution
−2024−2−10123456xyEquation 1Equation 2Solution
Reduced row echelon form of [A | b]
xyConstant
102
011
Step-by-step working (8 steps)
  1. Write each equation in standard form

    Collect the unknowns on the left and the constants on the right, in the same order in every equation.

    {2x+3y=7x−y=1\begin{cases} 2x + 3y = 7 \\ x - y = 1 \end{cases}
  2. Write the augmented matrix

    Each row is one equation; the bar separates the coefficients from the constants.

    [23|71−1|1]\begin{bmatrix} 2 & 3 & | & 7 \\ 1 & -1 & | & 1 \end{bmatrix}
  3. Swap rows 1 and 2

    Row 2 has a simpler x-coefficient, so it becomes the pivot row for x.

    R1↔R2[1−1|123|7]R_{1} \leftrightarrow R_{2} \quad \begin{bmatrix} 1 & -1 & | & 1 \\ 2 & 3 & | & 7 \end{bmatrix}
  4. Eliminate x from the other rows

    Subtract multiples of row 1 so every other entry in the x-column becomes 0: R2 → R2 − 2R1.

    R2→R2−2R1[1−1|105|5]R_{2} \to R_{2} - 2R_{1} \quad \begin{bmatrix} 1 & -1 & | & 1 \\ 0 & 5 & | & 5 \end{bmatrix}
  5. Make the y-pivot equal to 1

    Divide row 2 by 5.

    R2→15R2[1−1|101|1]R_{2} \to \frac{1}{5}R_{2} \quad \begin{bmatrix} 1 & -1 & | & 1 \\ 0 & 1 & | & 1 \end{bmatrix}
  6. Eliminate y from the other rows

    Subtract multiples of row 2 so every other entry in the y-column becomes 0: R1 → R1 + R2.

    R1→R1+R2[10|201|1]R_{1} \to R_{1} + R_{2} \quad \begin{bmatrix} 1 & 0 & | & 2 \\ 0 & 1 & | & 1 \end{bmatrix}
  7. Read off the solution

    The coefficient part is now the identity matrix, so each row states the value of one unknown.

    x=2,y=1x = 2, \quad y = 1
  8. Check by substitution

    Substitute the solution into every original equation. 2x + 3y = 7: 2(2) + 3(1) = 7 ✓; x − y = 1: (2) − (1) = 1 ✓.

This systems of equations solver row-reduces the augmented matrix [A∣b][A \mid b] by Gaussian (Gauss–Jordan) elimination in exact fractions, says whether there is one solution, none or infinitely many, graphs the lines for two unknowns and checks the answer by substitution.

By Hira Noor, mathematicianLast reviewed Free, no sign-up, runs in your browserReport a problem

How to use this calculator

  1. Choose Equations to type the system, or Augmented matrix to enter the coefficients in a grid.
  2. Type one equation per line or separate them with semicolons: 2x + 3y - z = 5; x - y + 2z = 5; 3x + y + z = 8. Terms may be on either side, as in 2x = 7 - 3y.
  3. Use single letters for the unknowns (x, y, z, w or any others). Coefficients can be whole numbers, decimals or fractions such as x/2 or 3/4.
  4. In matrix mode, each row holds the coefficients of x, y, z, w in order followed by the constant on the right side of the equation.
  5. Read the solution at the top, then follow the row operations and the final check in the steps. With two unknowns, the graph shows where the lines meet.

Formulas

Augmented matrix

{a11x+a12y=b1a21x+a22y=b2⇔[a11a12|b1a21a22|b2]\begin{cases} a_{11}x + a_{12}y = b_1 \\ a_{21}x + a_{22}y = b_2 \end{cases} \;\Leftrightarrow\; \begin{bmatrix} a_{11} & a_{12} & | & b_1 \\ a_{21} & a_{22} & | & b_2 \end{bmatrix}

Plain-text formula: {a_11x + a_12y = b_1; a_21x + a_22y = b_2 ⇔ [a_11, a_12, |, b_1; a_21, a_22, |, b_2]

A linear system is stored as the coefficient matrix A with the constants b attached as an extra column. Row operations on this matrix are the same as combining equations.

Elementary row operations

Ri↔Rj,Ri→kRi(k≠0),Ri→Ri−kRjR_i \leftrightarrow R_j, \qquad R_i \to kR_i \;(k \ne 0), \qquad R_i \to R_i - kR_j

Plain-text formula: R_i ↔ R_j, R_i → kR_i (k ≠ 0), R_i → R_i − kR_j

Swapping rows, scaling a row by a nonzero number and subtracting a multiple of one row from another never change the solution set. Gauss–Jordan elimination uses them to reach reduced row echelon form.

Classification by rank

rank(A)=rank[A∣b]=n⇒one solution\operatorname{rank}(A) = \operatorname{rank}[A \mid b] = n \Rightarrow \text{one solution}

Plain-text formula: rank(A) = rank[A∣b] = n ⇒ one solution

If the two ranks differ, a row reduces to 0 = c with c ≠ 0 and there is no solution. If they are equal but smaller than the number of unknowns n, there are free variables and infinitely many solutions.

Cramer’s rule for two unknowns

x=det⁡Axdet⁡A,y=det⁡Aydet⁡A,det⁡A≠0x = \frac{\det A_x}{\det A}, \qquad y = \frac{\det A_y}{\det A}, \qquad \det A \ne 0

Plain-text formula: x = (det A_x)/(det A), y = (det A_y)/(det A), det A ≠ 0

AxA_x
A with its x-column replaced by the constants b
AyA_y
A with its y-column replaced by the constants b

Each unknown is a ratio of two determinants. It applies only when det A is not zero, which is exactly when the system has one solution.

Reading the result

A unique solution (a consistent, independent system) gives one value for every unknown: the single point where all the lines or planes meet. No solution (an inconsistent system) means the equations contradict each other, and elimination ends in a row such as 0 = 3. Infinitely many solutions (a consistent, dependent system) means at least one equation is redundant; the answer is written with parameters such as t, and every value of t gives a valid solution.

The reduced row echelon form in the table summarizes everything: each leading 1 marks a pivot unknown, a column without a pivot is a free variable, and a row of zeros with a nonzero constant signals an inconsistent system. To row-reduce any matrix, not only a system, use the RREF calculator.

Because all arithmetic uses exact fractions, answers such as x=73x = \frac{7}{3} are exact, not rounded decimals.

How to solve a system of equations

There are four standard methods, and they all give the same answer. The table applies each one to 2x+3y=72x + 3y = 7 and x−y=1x - y = 1.

Substitution and elimination are quickest by hand for two equations. With three or four unknowns, elimination organized as row operations on the matrix is the method that stays manageable, which is why this calculator uses it. Gaussian elimination clears the entries below each pivot to reach row echelon form and then back-substitutes; Gauss–Jordan elimination, shown in the steps above, also clears the entries above each pivot so the answer can be read straight off the matrix. The guide to two-variable systems and the guide to three-variable systems work through more examples by hand.

Cramer’s rule is a fifth route for square systems. Here det⁡A=2(−1)−3(1)=−5\det A = 2(-1) - 3(1) = -5, so x=−10−5=2x = \frac{-10}{-5} = 2 and y=−5−5=1y = \frac{-5}{-5} = 1. It needs one determinant per unknown and fails when det⁡A=0\det A = 0, exactly the cases with no solution or infinitely many. The determinant calculator works out each one. When det⁡A≠0\det A \ne 0 the solution is also x=A−1bx = A^{-1}b, and the inverse matrix calculator finds A−1A^{-1}.

Four ways to solve 2x + 3y = 7 and x − y = 1
MethodWhat you doOn this system
GraphingDraw both lines and read where they crossThe lines meet at (2, 1)
SubstitutionSolve one equation for a variable and put it into the otherx = 1 + y, so 2(1 + y) + 3y = 7, 5y = 5, y = 1 and x = 2
EliminationAdd multiples of the equations to cancel a variableAdd 3 × (x − y = 1) to the first equation: 5x = 10, so x = 2 and y = 1
Matrices (Gaussian elimination)Row-reduce the augmented matrix until each row gives one unknown[2 3 | 7; 1 −1 | 1] reduces to [1 0 | 2; 0 1 | 1]

Common mistakes when solving systems

Most wrong answers by hand come from a few slips. A substitution check at the end catches every one of them, which is why the calculator always finishes with one.

Frequent errors and how to avoid them
MistakeWhat goes wrongHow to avoid it
Dropping a sign when subtracting rowsR2 − 2R1 must double and subtract every entry of row 1, negatives includedWrite the multiplied row out in full before subtracting
Forgetting the right-hand sideChanging the coefficients but not the constant gives a different systemTreat the constant as one more column of the row
Misaligned variablesTerms in a different order, or a missing unknown, end up in the wrong columnWrite each equation as ax + by + cz = d, with 0 for a missing unknown
Reading 0 = 0 as no solutionA row of zeros with a zero constant only means one equation repeats anotherOnly 0 = c with c ≠ 0 means there is no solution
Giving one answer for a dependent systemA free variable means infinitely many solutions, not oneWrite the answer with a parameter, such as x = 2 − t, y = t

Setting up a word problem as a system

A boat travels 36 miles downstream in 2 hours and the same 36 miles back upstream in 3 hours. How fast is the boat in still water, and how fast is the current?

Let b be the speed of the boat and c the speed of the current, both in miles per hour. Downstream the current adds to the boat’s speed, so b + c = 36 ÷ 2 = 18. Upstream it subtracts, so b − c = 36 ÷ 3 = 12.

Enter b + c = 18; b - c = 12. Adding the equations gives 2b = 30, so the boat moves at 15 mph and the current at 3 mph. Check: 2 × (15 + 3) = 36 and 3 × (15 − 3) = 36.

Mixture, ticket and investment problems follow the same pattern: name one unknown per quantity you need, write one equation per fact you are given, then solve.

Worked example

Solve 2x + 3y − z = 5, x − y + 2z = 5, 3x + y + z = 8

Find x, y and z.

  1. Augmented matrix: rows (2, 3, −1 | 5), (1, −1, 2 | 5) and (3, 1, 1 | 8). Swap rows 1 and 2 so the first pivot is 1.
  2. Eliminate x: R2 → R2 − 2R1 gives (0, 5, −5 | −5) and R3 → R3 − 3R1 gives (0, 4, −5 | −7).
  3. Divide row 2 by 5 to get (0, 1, −1 | −1), then eliminate y: R1 → R1 + R2 and R3 → R3 − 4R2 gives (0, 0, −1 | −3).
  4. Divide row 3 by −1 to get z = 3, then eliminate z from rows 1 and 2.
  5. Check: 2(1) + 3(2) − 3 = 5, 1 − 2 + 2(3) = 5 and 3(1) + 2 + 3 = 8.

Answer: The unique solution is x = 1, y = 2, z = 3. The determinant of the coefficient matrix is 5, which is nonzero, confirming there is exactly one solution.

Frequently asked questions

How do I know if a system has no solution?

During elimination a row turns into zeros on the left with a nonzero number on the right, such as 0 = 3. That is a contradiction, so no values satisfy every equation. For two unknowns it means the lines are parallel.

What does "infinitely many solutions" look like?

At least one unknown has no pivot and becomes a free parameter. For example, x + y = 2 and 2x + 2y = 4 describe the same line, so the solution is x = 2 − t, y = t for any number t.

Can it solve systems with 3 or 4 variables?

Yes. It handles 2, 3 or 4 unknowns and up to 6 typed equations, so 3 × 3 and 4 × 4 systems both work, as do systems with more equations than unknowns. Extra equations either agree with the others (and reduce to 0 = 0) or contradict them, in which case there is no solution.

Does it graph the system?

Yes, for two unknowns. The result draws each line and marks the point where they cross; parallel lines mean no solution, and a single shared line means infinitely many. With three or more unknowns the equations describe planes, so the row operations and the reduced matrix tell the story instead. For other curves, use the graphing calculator.

Why does the calculator reject my equation as not linear?

A linear equation only adds numbers times unknowns. Products of unknowns (xy), powers (x2x^2), unknowns in a denominator (1/x) and functions such as sin x make it non-linear. Use the equation solver for a single non-linear equation.

Is the answer exact?

Yes. Every coefficient is converted to an exact fraction and every row operation is done with fractions, so a solution such as x = 7/3 is exact. Decimal values are listed separately for convenience.

What is the determinant telling me?

For a square system, a nonzero determinant of the coefficient matrix means exactly one solution. A zero determinant means either no solution or infinitely many, and elimination tells you which. The determinant calculator shows how it is computed.

RREF Calculator

Reduced row echelon form or REF with each row operation, rank, nullity and linear system solutions.

Linear Algebra

Determinant Calculator

Exact determinants of 2x2 to 6x6 matrices by row reduction or cofactor expansion, with every step.

Linear Algebra

Inverse Matrix Calculator

Exact inverses of 2x2 to 6x6 matrices by Gauss–Jordan elimination, with every row operation and a check.

Linear Algebra

Equation Solver

Solve any equation in x: exact steps for linear and quadratic equations, numerical roots for the rest.

Algebra & Equations

Graphing Calculator

Plot functions, equations, inequalities, parametric and polar curves; find roots and intersections.

Tools

Step-by-Step Math Solver

Free worked solutions for equations, systems, inequalities, factoring, derivatives, integrals, limits and matrices.

Tools

Sources and further reading

  1. Systems of Linear Equations and Matrices (Chapter 7, College Algebra 2e) (opens in a new tab), OpenStax, Rice University
  2. Augmented Matrices (opens in a new tab), Paul's Online Notes, Lamar University
  3. Introduction to Linear Algebra, 6th edition (G. Strang), Chapter 2: Solving Linear Equations, Wellesley-Cambridge Press

Results are calculated in your browser with methods checked by automated tests, and are intended for learning and general use. For engineering, medical, financial, legal or safety-critical decisions, verify important values independently and follow the rounding rules your work requires. How accurate are these results?