Linear Equation Calculator with Steps
Enter coefficients a and b to see how the constant is moved, the reduced fraction, and the decimal form.
The calculator above solves the linear equation ax + b = 0 and explains each step, including the special cases where a = 0.
Formulas used
- a ≠ 0: exactly one solution, x = −b/a.
- a = 0 and b = 0: every real number is a solution.
- a = 0 and b ≠ 0: no solution.
Worked example
Solve 3x − 12 = 0. Move the constant and divide by 3:
Enter the same values in the calculator above to see every step of the solution.
How to use the calculator
- Enter the coefficients a and b.
- Press the calculate button. The result appears instantly.
- Read the step-by-step solution, rendered with KaTeX, to check your own work.
🎯 Practice quiz: linear equations ax + b = 0
Ten multiple-choice questions with four options each, built on the sections above: recognizing a linear equation, identifying a and b, moving the constant term, finding the solution, a fractional solution, decimal coefficients, the case a = 0, reducing an equation to ax + b = 0, an equation with a parameter m and a word problem. Pick an answer: the correct option turns green, a wrong one turns red, and the worked solution appears right below with a ⚠️ Traps box explaining why the wrong options are tempting. You can enter the coefficients from any question into the calculator above to check every step.
1️⃣ Recognizing a linear equation Question 1. Which of the following is a linear equation in one variable:
Correct answer: B. 3 − 2x = 0
A linear equation in one variable has the form ax + b = 0 with a ≠ 0. Rewrite equation B with the x term first:
The order of the terms does not matter; x only needs to appear to the first power with a nonzero coefficient. Enter a = −2, b = 3 in the calculator above to get x = 3/2 = 1.5.
⚠️ Traps
- A: x is squared, so this is a quadratic equation.
- C: the coefficient of x is 0, so the equation no longer contains the variable and is not linear. It can still be classified with the a = 0 rules: no solution.
- D: x sits in the denominator of 1/x, which requires x ≠ 0, and the equation is not of the form ax + b = 0.
2️⃣ Identifying a and b Question 2. In the equation 5 − 3x = 0, the coefficients a and b are:
Correct answer: A. a = −3, b = 5
Bring the equation to the form ax + b = 0 by writing the x term first:
a is the coefficient of x, including the minus sign in front of it, so a = −3; b is the constant term, so b = 5. The solution is x = −5/(−3) = 5/3. Enter a = −3, b = 5 in the calculator above to see each step.
⚠️ Traps
- B: takes the numbers in the order they appear rather than by their role; 5 is not attached to x.
- C: drops the minus sign in front of 3x. A term that follows a minus sign has a negative coefficient.
- D: changes the sign of b as if it had already been moved; b changes sign only when it moves to the right-hand side.
3️⃣ Moving the constant term Question 3. Solve 4x − 7 = 0. After moving the constant term to the right-hand side, you get:
Correct answer: A. 4x = 7
Move −7 to the right-hand side and change its sign to +7. This is the same as adding 7 to both sides:
Dividing both sides by 4 gives x = 7/4 = 1.75. Check: 4·1.75 − 7 = 0.
⚠️ Traps
- B: forgets to change the sign when moving the term across.
- C: also changes the sign of 4x, which stays on the left; −4x = 7 gives x = −7/4, the wrong sign.
- D: “moves” the coefficient 4 by subtracting it. The 4 multiplies x, so you must divide both sides by 4.
4️⃣ Finding the solution Question 4. The solution of the equation 2x + 6 = 0 is:
Correct answer: A. x = −3
Here a = 2 and b = 6. Move the constant, then divide by a:
You can also apply the formula directly: x = −b/a = −3. Check: 2·(−3) + 6 = 0.
⚠️ Traps
- B: forgets to change the sign of 6, writing 2x = 6.
- C: multiplies instead of dividing: −6·2 = −12.
- D: divides the wrong way, using −a/b = −2/6 instead of −b/a.
5️⃣ A fractional solution Question 5. The exact solution of the equation 6x − 4 = 0 is:
Correct answer: A. x = 2/3
Reduce 4/6 by dividing the numerator and denominator by gcd(4, 6) = 2. Because 2/3 = 0.666… is a repeating decimal, the decimal form is only an approximation; the exact answer is the fraction 2/3. The calculator above shows x = 4/6 = 2/3 ≈ 0.6667. You can check the reduction with the fraction calculator.
⚠️ Traps
- B: divides the wrong way, 6/4 instead of 4/6.
- C: forgets to change the sign of −4 when moving it.
- D: 0.67 is a rounded value: 6·0.67 − 4 = 0.02 ≠ 0. Keep the reduced fraction until the conclusion.
6️⃣ Decimal coefficients Question 6. The solution of the equation 0.5x − 1.25 = 0 is:
Correct answer: A. x = 2.5
Tip: multiply both sides by 4 to clear the decimals, which gives 2x − 5 = 0, so x = 5/2 = 2.5. Click Example 3 in the calculator above to see the decimal coefficients turned into fractions and solved.
⚠️ Traps
- B: multiplies 1.25·0.5 instead of dividing 1.25 by 0.5.
- C: forgets to change the sign of −1.25 when moving it.
- D: divides the wrong way: 0.5 ÷ 1.25 = 0.4.
7️⃣ The case a = 0, b ≠ 0 Question 7. The equation 0x + 5 = 0:
Correct answer: A. has no solution
Here a = 0 and b = 5 ≠ 0. For every x the left-hand side equals 0·x + 5 = 5, so the equation becomes a false statement:
Geometrically, the line y = 0x + 5 is horizontal and parallel to the x-axis, so it never meets the x-axis, like the middle panel of the figure above. Click Example 4 in the calculator to see the solution.
⚠️ Traps
- B: infinitely many solutions happen only when both a and b are 0.
- C: substituting x = 0 gives 5 = 0, which is false.
- D: ignores 0x and “moves” the 5. Check: 0·(−5) + 5 = 5 ≠ 0. When a = 0 you cannot use the formula −b/a.
8️⃣ Reducing to ax + b = 0 Question 8. The solution set of the equation 2(x − 3) + 6 = 2x is:
Correct answer: A. S = ℝ
Expand the brackets and move everything to the left-hand side:
The equation has a = 0 and b = 0, so it holds for every real x and the solution set is S = ℝ. Try a few values: x = 0 gives −6 + 6 = 0 = 2·0, and x = 5 gives 4 + 6 = 10 = 2·5. The line y = 0x + 0 lies on the x-axis, as in the right-hand panel of the figure. You can check the expansion with the algebraic expression simplifier.
⚠️ Traps
- B: sees x “disappear” and concludes there is no solution; that is only the case when the remaining constant is nonzero.
- C: checks that x = 0 works and stops, missing infinitely many other solutions.
- D: takes x = 3 from the bracket (x − 3), as if solving x − 3 = 0.
9️⃣ Equation with a parameter m Question 9. For which value of m does the equation (m − 2)x + 4 = 0 have no solution:
Correct answer: A. m = 2
The coefficients are a = m − 2 and b = 4. The equation has no solution when a = 0 and b ≠ 0. Since b = 4 is never 0, you only need:
With m = 2 the equation becomes 0x + 4 = 0, that is 4 = 0, so there is no solution. For m ≠ 2 there is exactly one solution, x = −4/(m − 2). The same case analysis appears with determinants in the system of equations calculator.
⚠️ Traps
- B: m ≠ 2 gives a ≠ 0, which is the condition for exactly one solution.
- C: solves m − 2 = 0 with the wrong sign. With m = −2 the equation is −4x + 4 = 0, which has the solution x = 1.
- D: assumes a = 0 always means infinitely many solutions; you must also check b, and b = 4 ≠ 0.
🔟 Word problem Question 10. A taxi company charges a $3 pick-up fee plus $2 per mile. Ann paid $23 for one ride. How far did she travel:
Correct answer: A. 10 miles
Let x be the distance in miles, x > 0:
Check: 2·10 + 3 = $23. Enter a = 2, b = −20 in the calculator above to see the step-by-step solution.
⚠️ Traps
- B (11.5 miles): computes 23 ÷ 2 and forgets to subtract the pick-up fee.
- C (13 miles): computes (23 + 3) ÷ 2, adding the fee instead of subtracting it (a sign error when moving the term).
- D (7 miles): computes (23 − 2) ÷ 3, swapping the pick-up fee and the price per mile.