Skip to content

Linear Equation Solver

Type a linear equation — brackets, fractions and decimals included — and get the solution as an exact fraction, with each algebra step written out the way a teacher would on the board, a check by substitution, and a graph of the two sides. Equations with no solution or infinitely many solutions are recognised and explained. Free, no sign-up.

One letter for the unknown. Brackets, fractions (x/3) and decimals are fine, for example 3(x − 2) + 4 = 2x + 7.

Try an example

Solution

x = 9

Answer

One solution

Type of equation

Step by step

  1. Start with the equation.

    3(x − 2) + 4 = 2x + 7

  2. Simplify each side: expand the brackets and combine like terms.

    3x − 2 = 2x + 7

  3. Subtract 2x from both sides.

    x − 2 = 7

  4. Add 2 to both sides.

    x = 9

Check the answer

Substitute x = 9 into each side:

Left side: 3 × 9 − 2 = 25

Right side: 2 × 9 + 7 = 25

Both sides equal 25, so x = 9 is correct.

Graph of each side

Graphs of y = 3x − 2 and y = 2x + 7; they cross where the equation holds05101520-200204060xy(9, 25)
  • y = 3x − 2
  • y = 2x + 7

How to Use the Linear Equation Solver

  1. 1. Type the equation. Write it as you would on paper: 3(x − 2) + 4 = 2x + 7. Use one letter for the unknown, a slash for fractions (x/3), and either a decimal point or a decimal comma.
  2. 2. Read the solution. The answer appears as an exact fraction in lowest terms, with its decimal value when the fraction does not terminate.
  3. 3. Follow the steps. Each line says what was done to both sides and shows the new equation, from expanding brackets down to dividing by the coefficient.
  4. 4. Check and graph. The answer is substituted back into both sides, and the graph shows each side as a line so you can see where they meet.

The Rule Behind Every Step: Do the Same to Both Sides

An equation is a balance. If you add, subtract, multiply or divide both sides by the same number (never by zero), the two sides stay equal and the solution does not change. Solving means choosing those operations so the variable ends up alone. The order below works for every linear equation:

What you seeWhat to doExample
BracketsExpand them by distributing3(x − 2) → 3x − 6
Like terms on one sideCombine them3x − 6 + 4 → 3x − 2
Fractions or decimalsMultiply both sides by the common denominatorx/3 + 1/2 = 5, multiply by 6
The variable on both sidesSubtract the smaller variable term from both sides3x − 2 = 2x + 7 → x − 2 = 7
A constant next to the variableAdd or subtract it on both sidesx − 2 = 7 → x = 9
A coefficient on the variableDivide both sides by it2x = 27 → x = 27/2

Worked Example: 3(x − 2) + 4 = 2x + 7

  1. Simplify. Expand 3(x − 2) to 3x − 6, then combine −6 + 4: 3x − 2 = 2x + 7.
  2. Move the variable terms. Subtract 2x from both sides: x − 2 = 7.
  3. Move the constants. Add 2 to both sides: x = 9.
  4. Check. The left side is 3 × 9 − 2 = 25 and the right side is 2 × 9 + 7 = 25. Both sides equal 25, so x = 9 is correct.

Fractions and Decimals

Fractions are easier to remove than to carry. Multiply every term by the least common multiple of the denominators and they all become whole numbers. For x/3 + 1/2 = 5 the denominators are 3 and 2, so multiply by 6:

x/3 + 1/2 = 5
2x + 3 = 30     (multiply both sides by 6)
2x = 27         (subtract 3)
x = 27/2        (divide by 2)

The answer is the exact fraction 27/2, or 13.5. Decimals are handled the same way: 0.5x + 1.2 = 3 is read as (1/2)x + 6/5 = 3, multiplied by 10 to give 5x + 12 = 30, and solved exactly as x = 18/5 = 3.6. Nothing is rounded along the way, so a result like 1/3 stays 1/3 instead of becoming 0.333333.

No Solution and Infinitely Many Solutions

Sometimes the variable cancels from both sides at once. What remains is a statement about numbers only, and it is either false or true:

EquationAfter the variable cancelsMeaning
2x + 3 = 2x + 53 = 5, which is falseNo solution. The sides are parallel lines that never meet.
2(x + 1) = 2x + 22 = 2, which is trueEvery number is a solution. Both sides are the same line.

An equation with exactly one solution is the case where the two sides have different slopes, so their graphs cross at a single point — the solution is that point's x-coordinate.

Common Mistakes

  • Distributing to only the first term. 3(x − 2) is 3x − 6, not 3x − 2.
  • Changing only one side. Whatever you do to the left, do to the right — including multiplying every term, not just the fraction you want to clear.
  • Sign errors when moving terms. Moving +2 across the equals sign means subtracting 2 from both sides, which turns it into −2.
  • Dividing by the wrong number. In −3x = 12 divide by −3, not 3; the answer is x = −4.
  • Treating a false statement as an answer. If the variable cancels and you reach 3 = 5, the equation has no solution — it does not mean x = 3 or x = 5.

Frequently Asked Questions

How do you solve a linear equation step by step?
Expand any brackets and combine like terms, clear fractions by multiplying by the common denominator, move the variable terms to one side and the constants to the other, then divide by the coefficient of the variable. The solver writes each of these steps with the equation that results.
What does it mean when the variable disappears?
The variable has cancelled from both sides, leaving only numbers. If that statement is false (3 = 5), the equation has no solution. If it is true (2 = 2), every number is a solution. Neither case means the answer is 0.
Do I flip the sign when I divide by a negative number?
Not in an equation: −3x = 12 gives x = −4 with the equals sign unchanged. Flipping happens only in inequalities, where multiplying or dividing by a negative reverses the direction of the sign. The Inequality Solver highlights that step.
How do I solve an equation with fractions?
Multiply every term on both sides by the least common multiple of the denominators. For x/3 + 1/2 = 5 that number is 6, which turns the equation into 2x + 3 = 30 with no fractions left. The solver shows this step when it is needed.
How can I check my answer?
Substitute the value for the variable in the original equation and work out both sides separately. If they are equal, the solution is correct. The solver does this for you and prints both sides.
What if the equation has x² or two different letters?
An x² term makes it a quadratic, which has up to two solutions — use the Quadratic Equation Solver. Two letters, such as x + y = 5, need a second equation; the System of Equations Solver handles two or three unknowns together.
Can I use a letter other than x?
Yes. Any single letter works as the unknown, so 4t + 1 = 13 is solved for t. Capital and small letters are different letters.

Related Tools

More in Math Calculators

See all Math Calculators