Skip to content
Math & Statisticsalgebra

Linear Equation Solver

A linear equation of the form ax plus b equals c, solved with the substitution shown as a check. The two degenerate cases, no solution and infinitely many, are named rather than hidden behind a division by zero.

Also called: solve for x, linear equation.

x
5

x = 5. Substituting back: 3 times 5 plus 4 gives 19, which is 19 as required.

Substituted back
19
Rearranged
x = (19 - 4) / 3
Nature of the equation
exactly one solution
Method and background

How this is calculated

Move the constant across and divide. The only interesting part is what happens when a is zero: if b also equals c the equation is true for every x, and if it does not the equation is true for none. Both are reported explicitly, because a solver that returns infinity or an error in those cases has thrown away the actual answer.

x = (c - b) / a
a
Coefficient of x
b
Constant on the left
c
Right-hand side

Worked examples

Each of these is asserted on every build. If a change to the engine ever moved one of these answers, the build would fail before the page could print it.

a standard solve

a (coefficient of x)
3
b (constant on the left)
4
c (right-hand side)
19

x5

arithmetic identity with substitution check

Open this example

x cancels and the statement holds

a (coefficient of x)
0
b (constant on the left)
5
c (right-hand side)
5

x0

boundary

Open this example

x cancels and the statement fails

a (coefficient of x)
0
b (constant on the left)
5
c (right-hand side)
7

x0

degenerate case

Open this example

Method and limits

What it assumes

  • Real coefficients.

What it deliberately does not model

  • One equation in one unknown. Simultaneous equations are a different tool.

Formula version 1.0.0 · definition 1.0.0 · India · Report a problem with this calculator

Frequently asked questions

What if a is zero?
Then x has disappeared from the equation. If the remaining statement is true, every value of x works; if it is false, none does. This says which rather than dividing by zero.