Linear Equation Solver with Steps

Solve any one-variable linear equation of the form ax + b = cx + d. Every balance move is shown, the answer is given as an exact fraction and a decimal, and the solution is checked by substituting it back.

Grades 6–9FreeNo sign-up

x + = x +
Try:

The boxes are a, b, c and d in ax + b = cx + d. Use 0 for a missing term (for 3x + 5 = 20 enter 3, 5, 0, 20) and a minus sign for subtraction (x − 7 means b = −7).

How to use the linear equation solver

  1. Match your equation to the pattern ax + b = cx + d. The numbers multiplying x are a (left) and c (right); the plain numbers are b (left) and d (right).
  2. Type the four numbers. Decimals and negatives are allowed, and a missing term is 0. For example, 2x − 7 = 5x + 8 is a = 2, b = −7, c = 5, d = 8.
  3. Press Solve to see the answer, the numbered steps and a check.

The idea: an equation is a balance

Think of the equals sign as the centre of a set of scales. The left side and the right side weigh the same. If you add, subtract, multiply or divide both sides by the same amount, the scales stay level. Solving an equation means using these balanced moves to get x alone on one side.

For ax + b = cx + d there are three moves:

  1. Collect the x-terms. Subtract cx from both sides, leaving (a − c)x + b = d.
  2. Collect the numbers. Subtract b from both sides, leaving (a − c)x = d − b.
  3. Divide by the coefficient of x. x = (d − b) ÷ (a − c).

Worked example

Solve 5x − 7 = 2x + 8.

Subtract 2x from both sides: 3x − 7 = 8.
Add 7 to both sides: 3x = 15.
Divide both sides by 3: x = 5.

Check: left side 5·5 − 7 = 18, right side 2·5 + 8 = 18. Both sides match, so x = 5 is correct.

A fraction answer: 7x + 2 = 4x + 4. Subtract 4x: 3x + 2 = 4. Subtract 2: 3x = 2. Divide by 3: x = 2/3 ≈ 0.666667. Leaving the answer as a fraction is exact; the decimal is rounded. You can practise fraction arithmetic with the fraction calculator.

No solution and infinitely many solutions

Most linear equations have exactly one solution, but two special cases appear when the x-terms cancel out (that is, when a = c):

What is leftMeaningExample
A false statement, such as 1 = 9No solution (a contradiction)4x + 1 = 4x + 9
A true statement, such as 6 = 6Infinitely many solutions (an identity)2x + 6 = 2x + 6

On a graph, each side of the equation is a straight line. One solution means the lines cross once, no solution means they are parallel, and infinitely many solutions means they are the same line. You can explore this picture with the system of equations solver or find a line's steepness with the slope calculator.

Always check your answer

Substitute your value of x into the original equation and work out each side separately. If the two sides give the same number, the solution is right. If not, look back for an arithmetic slip — the most common ones are below.

Equations that need tidying first

If your equation has brackets or several like terms, simplify each side first. For 2(x + 3) = x − 4, expand the bracket to get 2x + 6 = x − 4, then enter a = 2, b = 6, c = 1, d = −4. If it contains x², it is not linear — use the quadratic equation solver instead.

Frequently asked questions

How do you solve an equation with variables on both sides?

Subtract the smaller x-term from both sides so x appears on one side only, then subtract the constant from both sides, and finally divide by the coefficient of x. For 5x − 7 = 2x + 8 this gives 3x = 15, so x = 5.

What does it mean when an equation has no solution?

When the x-terms cancel and you are left with a false statement such as 1 = 9, no value of x makes the equation true. This happens when both sides have the same coefficient of x but different constants.

When does a linear equation have infinitely many solutions?

When both sides are identical after simplifying, for example 2x + 6 = 2x + 6. The x-terms cancel and leave a true statement such as 6 = 6, so every number is a solution.

How do I check my answer to a linear equation?

Substitute the value of x into the original equation and evaluate the left and right sides separately. If both sides give the same number, the solution is correct.

Can the answer be a fraction or a decimal?

Yes. Many equations have fraction answers, such as x = 2/3. The solver shows the exact simplified fraction and its decimal value.

How do I enter an equation like 3x + 5 = 20?

There is no x on the right, so its coefficient is 0. Enter a = 3, b = 5, c = 0 and d = 20.