System of Equations Calculator (2 or 3 Variables)

  • Free
  • No sign-up
  • Works on phones
  • Shows the working
Vectors & Matrices#62

System of Equations Solver

Two or three linear equations, one per line: solved with Cramer's rule, with no-solution and infinitely-many cases.

This system of equations calculator solves two linear equations in x and y, or three in x, y and z. Type the equations as you would write them. It shows the system in matrix form, every determinant used by Cramer’s rule, and the solution, and it checks the answer in each equation. If the system has no solution or infinitely many, it says which and why.

It’s free and needs no sign-up.

System of Equations Calculator (2 or 3 Variables): The two equations are two lines; they cross at the single point (1, 2)…
The two equations are two lines; they cross at the single point (1, 2), which is the solution x = 1, y = 2.

How to use it

  1. Type the equations one per line, or on one line separated by semicolons: 2x + 3y = 8; x - y = -1.
  2. Use x and y for two equations, and x, y and z for three. Terms can be on either side: 3x = 2y + 1 works.
  3. Press Solve.

Cramer’s rule

Write the system as ( Amathbf{x} = mathbf{b} ). Let ( D = det A ). Replace the column of A that belongs to one variable by ( mathbf{b} ) and take the determinant: ( D_x ), ( D_y ), ( D_z ). Then, provided ( D neq 0 ),

$$x = frac{D_x}{D}, qquad y = frac{D_y}{D}, qquad z = frac{D_z}{D}$$

If ( D = 0 ), the system has either no solution or infinitely many.

Worked example: two equations and a system of equations calculator

Solve ( 2x + 3y = 8 ) and ( x – y = -1 ) (as loaded above).

A young woman studying outdoors with a laptop and notebook.

$$D = begin{vmatrix} 2 & 3 \ 1 & -1 end{vmatrix} = -2 - 3 = -5$$

$$D_x = begin{vmatrix} 8 & 3 \ -1 & -1 end{vmatrix} = -8 + 3 = -5, qquad D_y = begin{vmatrix} 2 & 8 \ 1 & -1 end{vmatrix} = -2 - 8 = -10$$

So ( x = frac{-5}{-5} = 1 ) and ( y = frac{-10}{-5} = 2 ). Check: ( 2(1) + 3(2) = 8 ) ✔ and ( 1 – 2 = -1 ) ✔.

By elimination: from the second equation ( x = y – 1 ). Substituting, ( 2(y – 1) + 3y = 8 ), so ( 5y = 10 ), ( y = 2 ), ( x = 1 ). Same answer.

Worked example: three equations

Solve

$$x + y + z = 6, qquad 2x - y + z = 3, qquad x + 2y - z = 2$$

The determinant of the coefficients is ( D = 7 ), and ( D_x = 7 ), ( D_y = 14 ), ( D_z = 21 ). So ( x = 1 ), ( y = 2 ), ( z = 3 ). Check the first equation: ( 1 + 2 + 3 = 6 ) ✔.

Worked example: no solution

( x + y = 2 ) and ( 2x + 2y = 5 ). Doubling the first gives ( 2x + 2y = 4 ), which contradicts the second. Here ( D = 0 ) and the equations are inconsistent: as lines, they are parallel and never meet.

A broken pencil, symbolizing frustration or a problem with no solution.

If instead the second equation were ( 2x + 2y = 4 ), it would be the same line twice, and every point on it is a solution: infinitely many solutions.

The geometry

  • Two equations in x and y are two lines. One solution: they cross. None: parallel. Infinitely many: the same line.
  • Three equations in x, y, z are three planes. They can meet in a single point, along a line, or not at all.

The slope formula guide shows how to tell parallel lines apart from crossing ones at a glance.

Other methods

Substitution and elimination are quicker by hand for small systems; Gaussian elimination (row reduction) scales best to large ones, and the inverse-matrix method uses ( mathbf{x} = A^{-1}mathbf{b} ) (try the matrix calculator). All methods give the same solution when one exists.

Common mistakes

  • Sign errors moving terms across the equals sign. The calculator accepts terms on either side to avoid this.
  • Replacing the wrong column in Cramer’s rule. ( D_x ) replaces the x-column (the first).
  • Using Cramer’s rule when D = 0. It only applies when D is non-zero.

Step-by-step: elimination

  1. Line up the equations with x, y (and z) in the same order.
  2. Multiply one or both equations so that one variable has opposite coefficients.
  3. Add the equations to eliminate that variable.
  4. Solve the resulting equation, then substitute back to find the other variable.
  5. Check the solution in every original equation.

For three variables, eliminate the same variable from two different pairs of equations to get a 2×2 system, solve that, then substitute back.

Students collaborating on a project with pens and paper.

Worked example: a word problem

A school sold 20 tickets for ( $200 ): adult tickets cost ( $12 ) and child tickets ( $8 ). How many of each?

Let a be adult and c child tickets: ( a + c = 20 ) and ( 12a + 8c = 200 ). From the first, ( c = 20 – a ), so ( 12a + 8(20 – a) = 200 ), which gives ( 4a = 40 ): 10 adult and 10 child tickets. Enter a + c = 20; 12a + 8c = 200 as x + y = 20; 12x + 8y = 200 to check.

Worked example: the inverse-matrix method

For ( 2x + 3y = 8, x – y = -1 ), write ( A = begin{bmatrix} 2 & 3 \ 1 & -1 end{bmatrix} ). Its inverse is

Green binary code forming a tunnel or vortex on a black background.

$$A^{-1} = frac{1}{-5}begin{bmatrix} -1 & -3 \ -1 & 2 end{bmatrix} = begin{bmatrix} frac15 & frac35 \ frac15 & -frac25 end{bmatrix}$$

and ( A^{-1}begin{bmatrix} 8 \ -1 end{bmatrix} = begin{bmatrix} frac85 – frac35 \ frac85 + frac25 end{bmatrix} = begin{bmatrix} 1 \ 2 end{bmatrix} ), the same answer as Cramer’s rule.

Which method should I use?

MethodBest for
Substitutionone equation already gives a variable alone
Eliminationsmall systems by hand
Cramer’s rule2×2 and 3×3 systems with a formula answer
Matrices / row reductionlarge systems, computers
Graphingseeing whether lines cross, are parallel or coincide

Practice problems

  1. ( x + y = 10, x – y = 2 ).
  2. ( 3x + 2y = 12, x – y = -1 ).
  3. ( x + y + z = 3, x – y = 0, y – z = 0 ).

Answers: 1. Adding gives ( 2x = 12 ): ( x = 6, y = 4 ). 2. From the second, ( x = y – 1 ); then ( 5y – 3 = 12 ): ( x = 2, y = 3 ). 3. ( x = y = z ), so ( 3x = 3 ): ( x = y = z = 1 ).

Using the Calculator Step-by-Step

First, identify the number of variables in your system. This calculator handles either two or three unknowns. Then, make sure each equation is linear; that means no powers or products of variables. For instance, '2x + 3y = 7' is linear, but '2xy + 3y = 7' is not.

Next, prepare your equations for entry. You can type them exactly as written. Variables can be on either side of the equals sign. Use 'x' and 'y' for two-variable systems. For three-variable systems, use 'x', 'y', and 'z'.

Finally, input your equations into the calculator's text box. Enter each equation on a new line, or separate them with a semicolon. After typing, click the 'Solve' button. The calculator will then display the solution, if one exists.

Understanding the Calculator's Output

After clicking 'Solve', the system of equations calculator shows several key pieces of information. It first presents your system in a standard matrix form. This helps visualize the coefficients and constants clearly. Then, it calculates the main determinant (D) and the determinants for each variable (Dx, Dy, Dz).

If D is not zero, a unique solution exists. The calculator will provide the specific values for x, y, and z. It also performs a crucial check: it substitutes these values back into each original equation. A green checkmark confirms the solution satisfies every equation. This verification step helps you trust the result.

If D is zero, the system either has no solution or infinitely many. The calculator clearly states which case applies. It explains why, usually by showing inconsistent equations or indicating that they are dependent. This output helps you understand the nature of the system.

Practical Tips for Success

Always double-check your input before solving. A small typo can lead to a completely wrong answer. Ensure you have correctly transcribed all coefficients and constant terms. Also, verify that negative signs are accurately placed.

Use 'x', 'y', and 'z' consistently for your variables. If your problem uses other letters, mentally substitute them with x, y, z for the calculator. Then, translate the calculator's answer back to your original variables. For example, if your problem has 'a' and 'b', enter them as 'x' and 'y'.

Consider the context of your problem. If you expect whole number solutions from a word problem, but the calculator gives fractions, review your setup. Perhaps an equation was formed incorrectly. The calculator is a tool; understanding the problem helps interpret its results.

Related guides

Further reading

FAQ

How do you solve a system of equations?

By substitution, elimination, Cramer’s rule or matrices. All of them give the same answer; the calculator uses Cramer’s rule and shows each determinant.

How do I know if a system has no solution?

If the determinant of the coefficients is 0 and the equations contradict each other (like ( x + y = 2 ) and ( x + y = 2.5 )), there is no solution.

What does infinitely many solutions mean?

The equations describe the same line or plane (or planes sharing a common line), so every point on it satisfies all of them.

Can it solve non-linear systems?

No. Every equation must be linear: no products like xy, no powers and no functions of the variables.

How do I enter variables other than x, y and z?

Rename them: use x for the first unknown, y for the second and z for the third, then translate the answer back.

What does it mean if D = 0?

The coefficient matrix is singular: the system has either no solution or infinitely many, and the calculator tells you which.

Embed this calculator on your website

Teachers, tutors and bloggers are welcome to use this calculator for free. Copy the code below and paste it into any page (in WordPress, use a "Custom HTML" block). The small script makes the calculator grow to fit its answer; if your site removes scripts, it still works at a fixed height. Please keep the credit link.

More calculators

See all calculators