Quadratic Equation Calculator
Enter the coefficients a, b and c of ax² + bx + c = 0 to get the roots, the discriminant, the vertex and the factored form, with every step of the quadratic formula written out.
Result
- Root type
- Two distinct real roots
- Discriminant (b² − 4ac)
- 1
- Vertex
- (1.5, −0.25)
- Axis of symmetry
- x = 1.5
- Parabola opens
- Upward (vertex is the minimum)
- Factored form
- (x − 2)(x − 1) = 0
- Sum of roots (−b ÷ a)
- 3
- Product of roots (c ÷ a)
- 2
Step-by-step solution
- Identify the coefficients: a = 1, b = −3, c = 2.
- Compute the discriminant: D = b² − 4ac = (−3)² − 4 × 1 × 2 = 9 − 8 = 1.
- D > 0, so the equation has two distinct real roots.
- Apply the quadratic formula: x = (−b ± √D) ÷ 2a = (3 ± √1) ÷ 2 = (3 ± 1) ÷ 2.
- x₁ = (3 + 1) ÷ 2 = 2 and x₂ = (3 − 1) ÷ 2 = 1.
- Vertex: x = −b ÷ 2a = 1.5, y = c − b² ÷ 4a = −0.25, so the vertex is (1.5, −0.25).
What is a quadratic equation?
A quadratic equation is any equation that can be written as ax² + bx + c = 0, where a, b and c are known numbers and a is not zero. The highest power of x is 2, which gives the equation its name (quadratus is Latin for square). Quadratics appear wherever one quantity depends on the square of another: the height of a thrown ball over time, braking distance against speed, the area of a garden with a fixed length of fence, or the profit of a product whose margin shrinks as volume grows. Solving the equation means finding the values of x, called the roots or solutions, that make the left-hand side equal to zero.
The quadratic formula
Every quadratic equation, including those that do not factor neatly, is solved by:
x = (−b ± √(b² − 4ac)) ÷ 2a
The ± sign produces two values, one using plus and one using minus. The expression under the square root, b² − 4ac, is called the discriminant and decides what kind of roots you get.
Example: solve x² − 3x + 2 = 0, so a = 1, b = −3 and c = 2.
- Discriminant: D = (−3)² − 4 × 1 × 2 = 9 − 8 = 1.
- Square root: √1 = 1.
- Formula: x = (3 ± 1) ÷ 2, so x₁ = 4 ÷ 2 = 2 and x₂ = 2 ÷ 2 = 1.
- Check: 2² − 3 × 2 + 2 = 4 − 6 + 2 = 0 and 1² − 3 × 1 + 2 = 0. Both work.
Because the roots are 2 and 1, the quadratic factors as (x − 2)(x − 1) = 0. The sum of the roots is 3, which equals −b ÷ a, and the product is 2, which equals c ÷ a. These two relationships (Vieta's formulas) are a quick way to check any answer.
What the discriminant tells you
| Discriminant D = b² − 4ac | Roots | Graph |
|---|---|---|
| D > 0 | Two distinct real roots | Parabola crosses the x-axis twice |
| D = 0 | One repeated real root, x = −b ÷ 2a | Parabola touches the x-axis at its vertex |
| D < 0 | Two complex conjugate roots | Parabola never reaches the x-axis |
| D is a perfect square (integer coefficients) | Rational roots; the quadratic factors over the integers | Crosses the x-axis at rational points |
Completing the square
The quadratic formula is what you get by completing the square on the general equation, and the method is worth knowing on its own. For x² − 3x + 2 = 0: move the constant across (x² − 3x = −2), add the square of half the x-coefficient to both sides ((3 ÷ 2)² = 2.25, giving x² − 3x + 2.25 = 0.25), rewrite the left side as a perfect square ((x − 1.5)² = 0.25), take the square root of both sides (x − 1.5 = ±0.5) and solve: x = 2 or x = 1. The intermediate form a(x − h)² + k is called vertex form, because (h, k) is the vertex of the parabola.
What the graph shows
The graph of y = ax² + bx + c is a parabola. It opens upward when a is positive and downward when a is negative. The real roots are the points where the curve crosses the x-axis, and the constant c is where it crosses the y-axis. The vertex sits on the axis of symmetry x = −b ÷ 2a and has a y-coordinate of c − b² ÷ 4a. For the example, the vertex is (1.5, −0.25): the curve dips just below the axis between the two roots, which is why there are two of them. If you need the gradient of a straight line instead, see the slope calculator.
How to use this calculator
- Rearrange your equation into standard form with zero on the right-hand side. 2x² = 5x − 3 becomes 2x² − 5x + 3 = 0.
- Type a, b and c with their signs. Use 0 for a missing term: x² − 9 = 0 has a = 1, b = 0, c = −9.
- Check the rendered equation under the inputs matches what you meant to solve.
- Read the roots, the discriminant and the vertex, and follow the numbered steps to see the working.
Common mistakes
- Sign errors with b: when b = −3, −b is +3, and b² is +9, never −9. Squaring a negative gives a positive.
- Forgetting the ±: a quadratic normally has two roots. Writing only the "+" version loses one of them.
- Dividing only part of the top: the whole of −b ± √D is divided by 2a, not just the square root.
- Reading coefficients out of order: in 5 + x² = 4x, a = 1, b = −4 and c = 5 once it is in standard form.
- Rounding too early: keep √D exact until the last step. The calculator shows up to 4 decimal places, so irrational roots are rounded.
- Fractional coefficients: clear them first with the fraction calculator or multiply through by the common denominator; powers and roots are covered by the exponent calculator.
Frequently asked questions
What happens if a is zero?
Then there is no x² term and the equation is linear, not quadratic: bx + c = 0 has the single solution x = −c ÷ b. The calculator detects this and solves it directly instead of dividing by zero in the quadratic formula. If b is also zero the equation has either no solution (c ≠ 0) or every x as a solution (c = 0).
Why does the calculator show roots with an "i"?
When the discriminant b² − 4ac is negative, the formula asks for the square root of a negative number. There is no real number with that property, so the roots are written with the imaginary unit i = √(−1). The two roots are complex conjugates, such as 1.5 + 1.3229i and 1.5 − 1.3229i, and the parabola never crosses the x-axis.
Can I enter fractions or decimals as coefficients?
Decimals work directly: type 0.5 for ½ or 0.333333 for ⅓. For exact fractions, multiply the whole equation by the common denominator first, which does not change the roots. ½x² + ¼x − 3 = 0 becomes 2x² + x − 12 = 0 after multiplying by 4.
How can I tell if a quadratic can be factored?
With integer coefficients, the quadratic factors over the integers exactly when the discriminant is a perfect square (0, 1, 4, 9, 16 …). Then the roots are rational and the factored form row shows the factors. If the discriminant is positive but not a perfect square, the roots are real but irrational, such as (1 + √5) ÷ 2.
What is the vertex used for?
The vertex is the highest or lowest point of the parabola, so it answers maximum and minimum questions: the peak height of a projectile, the price that maximises revenue, or the size that minimises cost. Its x-coordinate is −b ÷ 2a and its y-coordinate is the value of the quadratic at that x.