Quadratic Formula Calculator
MathWrite your equation in standard form, ax² + bx + c = 0, and enter a, b and c. The calculator gives the discriminant b² − 4ac, says how many real solutions there are, finds x₁ and x₂, complex ones included, and shows the steps.
Step by step
Δ = (-5)² − 4 · 1 · 6 = 1
- Read the coefficients of ax² + bx + c = 0: a = 1, b = -5 and c = 6.
- Square b: b² = (-5)² = 25. Then 4ac = 4 · 1 · 6 = 24.
- Subtract to get the discriminant: Δ = 25 − 24 = 1.
- The sign of the discriminant decides the solutions: two distinct real solutions.
- Substitute into the quadratic formula x = (−b ± √Δ) / (2a) with b = -5, Δ = 1 and a = 1.
- With a discriminant of 0 or more, the real solutions are in the table, smallest first. With a negative one, they are complex and the result sentence gives them.
Once every entry is valid, you’ll see each step of the calculation here.
Formula
- a
- the coefficient of x², which cannot be 0
- b
- the coefficient of x
- c
- the constant term, the number without x
- Δ
- the discriminant of the equation, b² − 4ac
- i
- the imaginary unit, with i² = −1
How it works
A quadratic equation has the form ax² + bx + c = 0, where a is not 0. The quadratic formula gives its solutions: x = (−b ± √(b² − 4ac)) / (2a). The part under the root, b² − 4ac, is the discriminant, often written D or Δ, and its sign tells you what to expect before you finish. If it is positive, the equation has two distinct real solutions. If it is 0, it has one real solution, a repeated root. If it is negative, it has no real solutions, but it does have two complex solutions that are conjugates of each other.
To use the formula, first move every term to one side so the equation equals 0, then read a, b and c with their signs, using 0 for a missing term. For x² − 5x + 6 = 0, a = 1, b = −5 and c = 6. The discriminant is (−5)² − 4 · 1 · 6 = 25 − 24 = 1, and the solutions are x = (5 ± √1) / 2, which gives 3 and 2. The calculator does these steps for you, shows the substitution below the result and lists the real solutions in a table, smallest first. For a negative discriminant, the solutions are complex numbers of the form p ± qi, where i² = −1, and the result sentence gives p and q.
The graph of the quadratic function y = ax² + bx + c is a parabola, and the real solutions are the points where it crosses the x-axis: two points, one point where it just touches, or none. The x-coordinate of the vertex is −b / (2a), halfway between the two solutions, and its height is c − b² / (4a). This calculator does not draw the graph or output the vertex, but those two formulas give it from the same a, b and c. When b is even you can use the quarter discriminant (b/2)² − ac, which has the same sign as the discriminant and smaller numbers.
The formula
The formula comes from completing the square. Multiplying ax² + bx + c = 0 by 4a gives 4a²x² + 4abx + 4ac = 0, and adding b² − 4ac to both sides gives 4a²x² + 4abx + b² = b² − 4ac. The left side is the perfect square (2ax + b)², so (2ax + b)² = b² − 4ac. A square is never negative, so when b² − 4ac is negative no real x works. When it is positive, 2ax + b = ±√(b² − 4ac), and solving for x gives the formula. The NIST Digital Library of Mathematical Functions lists the same roots, with D = b² − 4ac as the discriminant.
The real solutions are computed so that no digits are lost when one solution is tiny, as in x² − 1,000,000x + 1 = 0, and they are listed smallest first even when a is negative. A discriminant that is zero only because of rounding in decimal coefficients is treated as 0, so a repeated root is not mistaken for two close ones. Results are shown with up to six decimal places.
Example
A ball is thrown up at 64 feet per second from a height of 80 feet, so its height after t seconds is −16t² + 64t + 80. When does it hit the ground?
- Set the height to 0: −16t² + 64t + 80 = 0, so a = -16, b = 64 and c = 80.
- The discriminant is 64² − 4 · (-16) · 80 = 4,096 − (-5,120) = 9,216, and its square root is 96.
- The solutions are t = (−64 ± 96) / (2 · (-16)) = (−64 ± 96) / (−32), which gives -1 and 5. A negative time is before the throw, so the ball lands after 5 seconds.
The discriminant is 9,216, which is positive, so there are two distinct real solutions: x₁ = -1 and x₂ = 5.
Load this example into the calculatorFrequently asked questions
What is the quadratic formula?
For ax² + bx + c = 0 with a not equal to 0, the solutions are x = (−b ± √(b² − 4ac)) / (2a). The ± sign gives two values, one with a plus and one with a minus. The formula works for every quadratic equation, whether or not it can be factored.
How do I use the quadratic formula?
Write the equation as ax² + bx + c = 0, then read a, b and c with their signs. Work out b² − 4ac, take its square root, and compute (−b + root) / (2a) and (−b − root) / (2a). Enter a, b and c here and the calculator shows each step.
What is the discriminant and what does it tell me?
The discriminant is b² − 4ac, the expression under the square root in the quadratic formula. If it is positive, there are two distinct real solutions. If it is 0, there is one repeated real solution. If it is negative, there are no real solutions, only two complex ones.
What if the discriminant is negative?
The equation has no real solutions, and the parabola never crosses the x-axis. It does have two complex solutions, (−b ± i√(−Δ)) / (2a), written with the imaginary number i, where i² = −1. For x² + x + 1 = 0, Δ = −3 and the solutions are −0.5 ± 0.866025i. The result sentence gives them.
What if a is 0?
Then the equation is not quadratic. It becomes bx + c = 0, with the single solution x = −c / b when b is not 0. The quadratic formula would divide by 2a = 0, so the calculator asks for a value of a other than 0.
How do I write an equation in standard form?
Move all terms to one side so the other side is 0, and put the terms in the order x², x, number. For 2x² = 3x + 5, subtract 3x and 5 from both sides to get 2x² − 3x − 5 = 0, so a = 2, b = −3 and c = −5. Then the discriminant is 9 + 40 = 49 and x = 2.5 or −1.
How do I solve x² − 5x + 6 = 0 with the quadratic formula?
Here a = 1, b = −5 and c = 6. The discriminant is 25 − 24 = 1, so x = (5 ± 1) / 2, which gives x = 3 and x = 2. You can check it by factoring: (x − 2)(x − 3) = x² − 5x + 6.
What is a repeated root?
It is a solution that counts twice, which happens when the discriminant is 0. For x² − 4x + 4 = 0, Δ = 16 − 16 = 0 and the only solution is x = −b / (2a) = 2. On the graph, the parabola touches the x-axis at its vertex without crossing it.
How do I find the vertex of a parabola?
The x-coordinate of the vertex is −b / (2a), halfway between the two solutions, and the y-coordinate is c − b² / (4a). For x² − 5x + 6, the vertex is at x = 2.5 and y = 6 − 25 / 4 = −0.25. This calculator gives the solutions, not the vertex, but these formulas use the same a, b and c.
How do I check my solutions?
Put each solution back into the equation. For x² − 5x + 6 = 0, x = 2 gives 4 − 10 + 6 = 0 and x = 3 gives 9 − 15 + 6 = 0, so both are correct. You can also check that the solutions add up to −b / a and multiply to c / a: 2 + 3 = 5 and 2 · 3 = 6.
When can I use factoring instead of the quadratic formula?
Factoring is quick when the discriminant is a perfect square, because the solutions are then rational numbers, as in x² − 5x + 6. The quadratic formula always works, including when the solutions are irrational or complex, and it is the safe choice when factoring is not obvious. To factor x² + bx + c, look for two numbers that multiply to c and add up to b, such as −2 and −3 for x² − 5x + 6, which gives (x − 2)(x − 3). The factor calculator lists the factor pairs of a whole number.
Why are the solutions listed smallest first?
So the order does not depend on the sign of a. Whether the plus sign or the minus sign in the formula gives the smaller value changes with the sign of a: for x² − 5x + 6 the minus sign gives 2, but for −x² + 4x − 3 it gives 3. The calculator sorts the values, so x₁ is never larger than x₂.
Where does the quadratic formula come from?
It comes from completing the square. Multiplying ax² + bx + c = 0 by 4a gives 4a²x² + 4abx + 4ac = 0, and adding b² − 4ac to both sides gives 4a²x² + 4abx + b² = b² − 4ac, which is (2ax + b)² = b² − 4ac. Taking the square root of both sides and solving for x gives x = (−b ± √(b² − 4ac)) / (2a).
Where are quadratic equations used in real life?
They describe thrown objects and falling objects, where height depends on time squared, and they show up in area problems, such as finding the sides of a rectangle from its perimeter and area. A quadratic also models profit when a price change affects both the price and the number sold.
- NIST Digital Library of Mathematical Functions, section 1.11(iii): polynomials of degree two, the roots of az² + bz + c = 0 and the discriminant (National Institute of Standards and Technology)
- Common Core State Standards for Mathematics, High School Algebra, HSA-REI.B.4: solve quadratic equations in one variable (Common Core State Standards Initiative)
- Quadratic formula (Wikipedia)
- Discriminant (Wikipedia)