Quadratic Formula Calculator
Enter a, b and c. You get both roots in exact form, the discriminant, the vertex and a small graph of the parabola.
https://flxcode.com/quadratic-formula-calculator/
Example
Discriminant 12 is positive but not a perfect square, so the roots are irrational. About −3.732051 and −0.267949.
Steps
- Start from x² + 4x + 1 = 0, so a = 1, b = 4, c = 1.
- Discriminant: b² − 4ac = 4² − 4·1·1 = 16 − 4 = 12.
- The discriminant is positive, so there are two real roots.
- Formula: x = (−b ± √D) / 2a = ((−4) ± √12) / 2.
- Simplify the root: √12 = 2√3.
- Divide the top and bottom by their common factor 2: x = −2 ± √3.
- The two roots are about −3.732051 and −0.267949.
Discriminant, vertex and check
- Discriminant D = 12: two real roots.
- Vertex form: y = (x + 2)² − 3
- Vertex: (−2, −3). Axis of symmetry: x = −2.
- Opens up, so the vertex is the minimum. Y-intercept: (0, 1).
- Check: the roots add up to −b/a = −4 and multiply to c/a = 1.
- Decimal roots: x₁ ≈ −3.732051, x₂ ≈ −0.267949.
Graph
No ads. No account. Nothing you type or record is uploaded. We count page events with a daily code. Check it.
Problem or idea? Email us
The formula, in one line
x = (−b ± √(b² − 4ac)) / 2a. First work out b² − 4ac. Then take its square root, simplify it, and divide. The square root calculator does the simplifying step on its own if you want to check it.
| Discriminant D = b² − 4ac | Roots | The parabola |
|---|---|---|
| D > 0, a perfect square | Two rational roots | Crosses the x-axis at two nice points |
| D > 0, not a perfect square | Two irrational real roots, like −2 ± √3 | Crosses at two points |
| D = 0 | One real root, repeated | Touches the axis at the vertex |
| D < 0 | Two complex roots, a ± bi | Stays above or below the axis |
Worked examples
| Equation | Answer | What to notice |
|---|---|---|
| x² − 5x + 6 = 0 | x = 2 or x = 3 | D = 1, a perfect square: whole-number roots |
| 2x² + 3x − 2 = 0 | x = −2 or x = 1/2 | D = 25: rational roots with a fraction |
| x² + 4x + 1 = 0 | x = −2 ± √3 | D = 12 = 4 × 3, so √12 becomes 2√3 |
| x² − 6x + 9 = 0 | x = 3 | D = 0: one root, counted twice |
| x² + 2x + 5 = 0 | x = −1 ± 2i | D = −16: complex pair |
| 3x² − 2x + 4 = 0 | x = 1/3 ± (i√11)/3 | D = −44: a complex pair with a radical |
| (1/2)x² − x − 4 = 0 | x = −2 or x = 4 | Fractions are cleared first (multiply by 2) |
| 4x − 8 = 0 | x = 2 | a = 0 is not a quadratic: solved as bx + c = 0 |
The steps the tool follows
- Read a, b and c. Fractions and decimals are scaled to whole numbers first.
- Compute D = b² − 4ac and say what kind of roots to expect.
- Put the numbers into the formula. Pull square factors out of √D (√20 = 2√5) and cancel what the top and bottom share.
- If D is negative, write √D as a multiple of i.
- Find the vertex, h = −b / 2a, and give the vertex form y = a(x − h)² + k.
Other ways to solve
Factoring is faster when the roots are whole numbers: x² − 5x + 6 = (x − 2)(x − 3). Completing the square is where the formula comes from, and it gives the vertex form directly. The formula always works, which is why it is the one to learn. For the roots of higher-degree equations or systems of equations, the matrix calculator solves linear systems by row reduction.
Numbers this uses
- Coefficients: whole numbers, decimals or fractions, up to 40 digits each. Exact BigInt fractions, no floats.
- Square factors of D are taken out up to D = 1,000,000,000,000,000 (1e15). Larger discriminants show the root unsimplified.
- Decimal roots: 6 places, half away from zero, computed from the exact radical.
- The graph is drawn with ordinary floats for the picture only. Roots and labels come from the exact values.
Nothing you type is uploaded. We count events without cookies (details).
FAQ
What is the quadratic formula?
For ax² + bx + c = 0 with a not 0, the solutions are x = (−b ± √(b² − 4ac)) / 2a. The ± gives two roots, one with + and one with −. Put the three coefficients in the boxes and the tool fills the formula for you, step by step.
What does the discriminant tell me?
The part under the root, D = b² − 4ac, tells you the kind of answer before you solve. D above 0 gives two real roots. D = 0 gives one repeated root, and the parabola just touches the x-axis. D below 0 gives two complex roots, a ± bi, and the parabola never reaches the axis.
What if a is 0?
Then there is no x² term and the equation is linear, bx + c = 0, with the single solution x = −c/b. The quadratic formula would divide by 2a = 0. The tool says so and solves the linear equation instead. If b is 0 as well, it tells you whether every x works (c = 0) or none does.
How are complex roots written?
As a ± bi, where i is the square root of −1. For x² + 2x + 5 = 0 the roots are −1 + 2i and −1 − 2i. They always come as a conjugate pair when the coefficients are real. The tool gives the exact form and the decimal values.
Can I enter fractions and decimals?
Yes. Type 1/2 or 0.25 in any box. The tool multiplies all three coefficients by the same number to make them whole, which does not change the roots, then uses exact whole-number arithmetic. So there is no rounding until the very last decimal line.
What is vertex form and why is it shown?
y = a(x − h)² + k, with the vertex at (h, k). Here h = −b / 2a and k is the y value there. The vertex is the lowest point if the parabola opens up (a above 0) and the highest if it opens down. It sits halfway between the two roots.
How do I check my answer?
The roots add up to −b/a and multiply to c/a. For x² − 5x + 6 the sum is 5 and the product is 6, and 2 + 3 and 2 × 3 agree. The tool prints both numbers so you can compare. You can also put a root back into the equation, which should give 0.
Are my numbers saved or sent anywhere?
No. The roots are worked out in your browser. What you type is not put in the address bar, not stored and not counted. We only count which kind of answer came out: two real roots, a double root, a complex pair or a linear case.
More from FLXCode
Square Root CalculatorNew
Exact simplified radicals (√72 = 6√2), decimals to your digits, cube and n-th roots, perfect-square check, steps.
Exponent CalculatorNew
Powers with integer, negative and fractional exponents. Integer results are exact, with scientific notation.
Matrix CalculatorNew
Add, multiply, transpose, determinant, inverse, rank and RREF up to 6 × 6, exact fractions, row-operation steps.
Long Division CalculatorNew
Long division laid out like on paper, with the remainder and the decimal, repeating part marked.