Quadratic and linear equation solver with steps


Enter the coefficients and this quadratic equation solver handles ax + b = cx + d or ax² + bx + c = 0, writing every step as a teacher would. For quadratics it computes the discriminant b² − 4ac, applies the quadratic formula, simplifies radicals, gives decimal approximations, handles negative discriminants and shows the factored form.
- ✅ Free
- 🔒 No sign-up
- 📱 Works on mobile
- ⚡ Instant results
🔒 Everything runs in your browser. Your data and files never leave your device.
📌 Key facts
- A linear equation ax + b = 0 (a not zero) has exactly one solution: x = -b / a.
- For ax^2 + bx + c = 0, the discriminant is b^2 - 4ac.
- A positive discriminant gives two real roots, a zero discriminant gives one repeated root, and a negative discriminant gives no real roots.
- The quadratic formula is x = (-b +/- sqrt(b^2 - 4ac)) / (2a).
- For the roots of a quadratic, the sum equals -b / a and the product equals c / a.
How to solve a linear equation
A linear equation looks like ax + b = cx + d. To isolate x, collect the x terms on one side and the numbers on the other, changing the sign of anything that crosses the equals sign, then divide by the coefficient of x.
\[ ax + b = cx + d \iff (a - c)\,x = d - b \iff x = \dfrac{d - b}{a - c} \quad \text{si } a \neq c \]
| Situation | Conclusion | Example |
|---|---|---|
| \( a - c \neq 0 \) | exactly one solution | \( 3 x + 5 = x + 11 \) gives \( x = 3 \) |
| \( a - c = 0 \) and \( d - b = 0 \) | all real numbers (identity) | \( x + 2 = x + 2 \) |
| \( a - c = 0 \) and \( d - b \neq 0 \) | no solution | \( x + 2 = x + 3 \) |
The solver always checks the answer by substituting it into both sides.
The quadratic formula and the discriminant
For ax² + bx + c = 0 with a ≠ 0, compute the discriminant, then use the quadratic formula.
\[ \Delta = b^{2} - 4ac \qquad x = \dfrac{-b \pm \sqrt{\Delta}}{2a} \]
| Discriminant | Real solutions | Example |
|---|---|---|
| Δ > 0 | two: (−b − √Δ)/(2a) and (−b + √Δ)/(2a) | x² − 5x + 6 = 0: \( \Delta = 1 \), \( x = 2 \) or \( x = 3 \) |
| \( \Delta = 0 \) | one repeated root: −b/(2a) | x² − 6x + 9 = 0: \( \Delta = 0 \), \( x = 3 \) |
| Δ < 0 | none (two complex roots) | x² + 2x + 5 = 0: \( \Delta = - 16 \) |
When Δ is not a perfect square, the radical is simplified: \( \sqrt{72} = 6 \sqrt{2} \) because \( 72 = 36 \times 2 \). The solver finds the largest square factor of Δ, then reduces the fraction using the greatest common factor.
Sum, product and factored form of the roots
If the equation has two roots x₁ and x₂, then x₁ + x₂ = −b/a and x₁ × x₂ = c/a. Use them to check an answer: for \( x^{2} - 5 x + 6 = 0 \), the sum \( 2 + 3 = 5 = - \dfrac{- 5}{1} \) and the product \( 2 \times 3 = 6 = \dfrac{6}{1} \).
The quadratic then factors as a(x − x₁)(x − x₂): \( x^{2} - 5 x + 6 = (x - 2) (x - 3) \). If Δ < 0, the quadratic does not factor over the real numbers and keeps the sign of a for every x.
If the coefficients are decimals or fractions, the solver multiplies the equation by the least common multiple of the denominators to get whole numbers, which does not change the solutions.
Solving a quadratic equation: three possible cases
The sign of the discriminant decides how many real solutions you get. So check it first.
| Discriminant | Real roots | Example |
|---|---|---|
| Positive | Two | x^2 - 3x - 10 = 0: discriminant 49, so x = 5 or x = -2 |
| Zero | One repeated | x^2 - 4x + 4 = 0: x = 2 |
| Negative | None | x^2 + 2x + 5 = 0: discriminant -16 |
Also, a negative discriminant does not mean the equation is wrong. It means the parabola never touches the x-axis.
Linear equations: a four-step method
To solve a linear equation, use the same order every time. That way, you skip nothing.
- Expand and simplify each side.
- Collect the x terms on one side and the numbers on the other.
- Divide both sides by the coefficient of x.
- Check by plugging x back into the original equation.
For example, in 3x + 7 = 22, subtract 7 to get 3x = 15. Then divide by 3 to find x = 5. Finally, 3(5) + 7 = 22, so the answer checks out.
Quadratic equation mistakes to avoid
A few mistakes come up again and again. However, they are easy to fix with some care.
- Forgetting to flip the sign when you move a term across the equals sign.
- Dividing by x, which drops the solution x = 0.
- Applying an operation to only one side.
- Dropping the -b term in the quadratic formula.
Also, when a root contains a radical, simplify it. For example, sqrt(12) becomes 2 sqrt(3). A simplified answer is easier to compare with an answer key.
Where to go after the quadratic equation
Once you have the solution, you can reuse it. For example, an equation can model a price, a speed or a time.
To keep practicing, simplify a ratio with the fraction calculator. For roots and powers, open the scientific calculator. Finally, find a shared factor with the GCF and LCM calculator, or break a number apart with the prime factorization calculator.
Quadratic equation: checking your roots
A root is valid only if it satisfies the original quadratic equation. So plug each root back in. Then compute both sides separately. Finally, compare the results.
For example, for the quadratic equation x^2 - 5x + 6 = 0 with x = 3, you get 9 - 15 + 6 = 0. The root is correct. Also, a quadratic equation with two roots needs two checks. When a quadratic equation has a repeated root, one check is enough. The graph helps too: each root is where the parabola crosses the x-axis, and a quadratic equation with no real root never crosses it.
3 real-life examples
A linear equation: 3x + 5 = x + 11
Collect terms: \( 3 x - x = 11 - 5 \), so \( 2 x = 6 \) and \( x = \dfrac{6}{2} = \) 3. Check: \( 3 \times 3 + 5 = 14 \) and \( 3 + 11 = 14 \).
A quadratic with whole-number roots: x² − 5x + 6 = 0
\( a = 1 \), \( b = - 5 \), \( c = 6 \). \( \Delta = (- 5)^{2} - 4 \times 1 \times 6 = 25 - 24 = 1 \), so \( \sqrt{\Delta} = 1 \). The roots are \( \dfrac{5 - 1}{2} = 2 \) and \( \dfrac{5 + 1}{2} = 3 \). Solutions: \( x = 2 \) or \( x = 3 \), and \( x^{2} - 5 x + 6 = (x - 2) (x - 3) \).
Roots with a radical: 2x² − 4x − 3 = 0
\( \Delta = (- 4)^{2} - 4 \times 2 \times (- 3) = 16 + 24 = 40 = 4 \times 10 \), so \( \sqrt{\Delta} = 2 \sqrt{10} \). Then \( x = \dfrac{4 \pm 2 \sqrt{10}}{4} = \dfrac{2 \pm \sqrt{10}}{2} \), which gives \( x \approx - 0.5811 \) or \( x \approx 2.5811 \).