How to use the quadratic formula calculator
- Enter the coefficients a, b and c of ax² + bx + c = 0. Whole numbers, decimals, fractions such as 3/4 and negative numbers all work. A blank b or c counts as 0.
- Or type the whole equation, such as 3x² = 2x + 5, with terms on either side. The calculator moves everything to one side and fills in a, b and c.
- Read the roots, exactly and as decimals, then the discriminant, vertex, factored form and graph, and follow each step of the working.
The quadratic formula
A quadratic equation is one where the highest power of x is 2. Written in standard form, ax² + bx + c = 0 with a not equal to 0, its solutions, also called roots or zeros, are:
x = (−b ± √(b² − 4ac)) / 2a
The ± means there are usually two answers: one using + and one using −. The formula always works, whether or not the equation factors neatly, which is why it is the standard method when other shortcuts fail.
What the discriminant tells you
The part under the square root, b² − 4ac, is called the discriminant. Before you finish the calculation, it tells you what kind of answers to expect:
- Positive and a perfect square (such as 25): two different rational roots, and the equation factors over the integers.
- Positive but not a perfect square (such as 17): two different irrational roots, written with a square root.
- Zero: one repeated root. The graph just touches the x-axis at its vertex.
- Negative: no real roots. The graph never meets the x-axis, and the two roots are complex numbers.
A worked example: 2x² + 7x + 3 = 0
- Here a = 2, b = 7 and c = 3.
- The discriminant is 7² − 4 × 2 × 3 = 49 − 24 = 25.
- So x = (−7 ± √25) / 4 = (−7 ± 5) / 4.
- With +: (−7 + 5) / 4 = −2/4 = −1/2. With −: (−7 − 5) / 4 = −12/4 = −3.
The roots are x = −1/2 and x = −3. Because the discriminant is a perfect square, the equation also factors: 2x² + 7x + 3 = (2x + 1)(x + 3). Check either root by putting it back in: 2 × (−3)² + 7 × (−3) + 3 = 18 − 21 + 3 = 0.
Irrational roots in simplest radical form
When the discriminant isn’t a perfect square, leave the square root in the answer rather than rounding, and simplify it. For x² + 3x − 2 = 0, the discriminant is 9 + 8 = 17, so x = (−3 ± √17)/2, which is about 0.5616 and −3.5616.
To simplify a square root, take out the largest square factor: √72 = √(36 × 2) = 6√2. Then divide the whole fraction by any factor common to every term. For 2x² − 4x − 8 = 0, the discriminant is 80, √80 = 4√5, and x = (4 ± 4√5)/4 = 1 ± √5. The calculator does both steps.
Complex roots
If the discriminant is negative, its square root isn’t a real number. Using i, the imaginary unit with i² = −1, √−36 = 6i. For x² − 4x + 13 = 0, the discriminant is 16 − 52 = −36, so x = (4 ± 6i)/2 = 2 ± 3i. Complex roots of an equation with real coefficients always come in pairs like this, a + bi and a − bi.
The Common Core high school standards for algebra ask students to “recognize when the quadratic formula gives complex solutions and write them as a ± bi for real numbers a and b” (standard HSA-REI.B.4.b). The calculator writes complex roots exactly that way.
Other ways to solve a quadratic equation
The same standard lists the methods students should know: solving “by inspection (e.g., for x² = 49), taking square roots, completing the square, the quadratic formula and factoring, as appropriate to the initial form of the equation.”
- Taking square roots works when there is no x term: x² = 49 gives x = ±7.
- Factoring is quickest when the roots are whole numbers or simple fractions: x² − 5x + 6 = (x − 2)(x − 3) = 0, so x = 2 or x = 3.
- Completing the square rewrites the equation as (x − p)² = q, then takes square roots.
- The quadratic formula works every time, and is completing the square done once, in general.
Where the formula comes from
Standard HSA-REI.B.4.a asks students to “use the method of completing the square to transform any quadratic equation in x into an equation of the form (x − p)² = q that has the same solutions” and to “derive the quadratic formula from this form.” Starting from ax² + bx + c = 0:
- Divide by a: x² + (b/a)x + c/a = 0.
- Move the constant across: x² + (b/a)x = −c/a.
- Add (b/2a)² to both sides to complete the square: (x + b/2a)² = b²/4a² − c/a = (b² − 4ac)/4a².
- Take square roots: x + b/2a = ±√(b² − 4ac)/2a.
- Subtract b/2a: x = (−b ± √(b² − 4ac))/2a.
The vertex and the graph
The graph of y = ax² + bx + c is a parabola. It opens upward when a is positive and downward when a is negative. Its turning point, the vertex, lies on the axis of symmetry x = −b/2a, exactly halfway between the two roots. Completing the square gives the vertex form y = a(x − h)² + k, where (h, k) is the vertex: for x² − 4x + 13 it is y = (x − 2)² + 9, so the lowest point is (2, 9), above the x-axis, which is why that equation has no real roots.
The calculator draws the parabola, marks the vertex and any points where it crosses the x-axis, and gives the y-intercept (0, c).
The sum and product of the roots
For ax² + bx + c = 0, the two roots always add up to −b/a and multiply to c/a. For 2x² + 7x + 3 = 0, −1/2 + (−3) = −7/2 and −1/2 × −3 = 3/2. This is a quick check on any answer, and it works for complex roots too: (2 + 3i) + (2 − 3i) = 4 and (2 + 3i)(2 − 3i) = 4 + 9 = 13.
Fractions, decimals and accuracy
If the coefficients have fractions or decimals, multiply the whole equation by a number that clears them; the roots don’t change. 0.5x² − 3x + 4 = 0 becomes x² − 6x + 8 = 0 when doubled, with roots 2 and 4. The calculator does this, and also divides out any common factor, so the numbers in the formula stay small and the answer is exact.
Decimal answers are worked out carefully too. When b² is much bigger than 4ac, using the formula directly subtracts two nearly equal numbers and loses accuracy in the smaller root. The calculator works out the larger root first and finds the other from the product of the roots, c/a, so even a root like the −0.00000001 of x² + 100,000,000x + 1 = 0 comes out right.
Your data stays on your device
Everything is worked out in your browser. Nothing you type is sent anywhere or stored.
Frequently asked questions
What is the quadratic formula?
For an equation ax² + bx + c = 0 with a not 0, x = (−b ± √(b² − 4ac)) / 2a. The ± gives the two roots: one with + and one with −. It works for every quadratic equation, including ones that don’t factor.
What does a negative discriminant mean?
If b² − 4ac is negative, the equation has no real roots: its graph never crosses the x-axis. It has two complex roots instead, written a ± bi, where i is the square root of −1. For x² − 4x + 13 = 0 they are 2 ± 3i.
What if a is 0?
Then there is no x² term, so the equation is linear, bx + c = 0, not quadratic, and the quadratic formula would divide by zero. Its one solution is x = −c/b. The calculator tells you this if you enter a = 0.
How do I find the vertex of a parabola?
The vertex of y = ax² + bx + c is at x = −b/2a, the axis of symmetry. Put that x into the equation to find y. The calculator gives the vertex exactly, along with the vertex form y = a(x − h)² + k.
Can I enter fractions and decimals?
Yes. Type coefficients such as 3/4 or −1.5, or a whole equation such as 0.5x² = 3x − 2. The calculator works with exact fractions, clears them before using the formula, and gives exact answers.
Is anything I type saved or sent?
No. Everything is worked out in your browser and nothing you type is sent anywhere or stored.