Quadratic formula calculator
Enter a, b and c of ax² + bx + c = 0, get the roots with the steps.
x² − 3x + 2 = 0
What is the quadratic formula?
For ax² + bx + c = 0, x = (−b ± √(b² − 4ac)) ÷ 2a. For 2x² + 3x − 2 = 0: b² − 4ac = 9 + 16 = 25, so x = (−3 ± 5) ÷ 4, which gives x = 0.5 and x = −2.
What does the discriminant tell me?
The discriminant b² − 4ac decides the roots: positive — two real roots, zero — one repeated root, negative — no real roots, only two complex ones.
What if the discriminant is negative?
The roots are complex numbers with i = √−1. For x² + 2x + 5 = 0, b² − 4ac = −16, so x = (−2 ± 4i) ÷ 2 = −1 ± 2i.
How do I find the vertex of a parabola?
The vertex is at x = −b ÷ 2a; put that x back in to get y. For x² − 3x + 2 the vertex is at x = 1.5, y = −0.25 — the lowest point, since a is positive.
What if a is 0?
Then the equation is not quadratic but linear, bx + c = 0, with one root x = −c ÷ b. The calculator solves that case too.
How can I check the roots of a quadratic equation?
The roots add up to −b ÷ a and multiply to c ÷ a. For 2x² − 5x − 3 = 0 the roots are 3 and −0.5: their sum is 2.5, which equals 5 ÷ 2, and their product is −1.5, which equals −3 ÷ 2.
Where the formula comes from
Complete the square on ax² + bx + c = 0: divide by a, move c ÷ a across, add (b ÷ 2a)² to both sides, and the left side becomes (x + b ÷ 2a)². Taking the square root of both sides and solving for x gives x = (−b ± √(b² − 4ac)) ÷ 2a. The expression under the root, b² − 4ac, is the discriminant. The formula works for every quadratic with a ≠ 0, including those that cannot be factored over the integers.
Worked examples of the three cases
Two real roots: 2x² − 5x − 3 = 0 has discriminant 25 + 24 = 49, so x = (5 ± 7) ÷ 4, giving −0.5 and 3. One repeated root: x² − 6x + 9 = 0 has discriminant 0 and the single root x = 3. Complex roots: 3x² + 2x + 5 = 0 has discriminant −56, so x = −0.3333 ± 1.2472i. An irrational pair: x² − 4x + 1 = 0 has discriminant 12 and roots 0.2679 and 3.7321, which are 2 ± √3.
Word problem: when does a thrown ball land?
Ignoring air resistance, the height in feet of an object thrown upward at v₀ feet per second from h₀ feet is h(t) = −16t² + v₀t + h₀, with t in seconds (the 16 is half the gravitational acceleration of about 32 ft/s²). For a ball thrown at 48 ft/s from a height of 6 ft, it lands when −16t² + 48t + 6 = 0, so a = −16, b = 48, c = 6. The discriminant is 2,688 and the roots are −0.12 and 3.12. Time cannot be negative, so the ball lands after 3.12 seconds. The vertex gives the peak: t = −b ÷ 2a = 1.5 s, at a height of 42 ft. Whenever a physical situation produces two roots, check each against the problem and discard the one that makes no sense.
Word problem: a rectangle with a known area
A rectangle is 5 ft longer than it is wide and has an area of 150 square feet. With width w, w(w + 5) = 150, so w² + 5w − 150 = 0, with a = 1, b = 5, c = −150. The discriminant is 625, and the roots are −15 and 10. A width cannot be negative, so w = 10 ft and the length is 15 ft; the check is 10 × 15 = 150.
Vertex form and factored form
Completing the square also rewrites the quadratic as a(x − h)² + k, where h = −b ÷ 2a is the axis of symmetry and k is the value at the vertex. If the roots r₁ and r₂ are real, the factored form is a(x − r₁)(x − r₂). The three forms describe the same parabola: the standard form shows the y-intercept c, the vertex form shows the turning point, and the factored form shows where the graph crosses the x-axis. A positive a opens the parabola upward (the vertex is a minimum); a negative a opens it downward (a maximum).
Precision when b is large
If b² is much larger than 4ac, the root whose sign makes −b and the square root nearly cancel loses digits on a calculator, because two almost equal numbers are subtracted. Numerical analysts compute the other root first, from the formula with the sign chosen to add, and get the second as c ÷ (a × first root), since the product of the roots is c ÷ a. This only matters for extreme coefficients, but it explains why two programs can print slightly different trailing digits for the same equation.
Common mistakes
Sign errors are by far the most common: when b is negative, −b is positive, and b² is always positive even for negative b. The second is dividing only part of the numerator by 2a; the whole of −b ± √(b² − 4ac) is divided. Third, trying to apply the formula before moving everything to one side: the equation must be in the form ax² + bx + c = 0 with a zero on the right. And when the discriminant is negative there are no real roots, so the graph never crosses the x-axis; the complex pair is still a valid answer in algebra.
Sources: OpenStax College Algebra 2e, section 2.5 (Quadratic Equations), for the formula, discriminant and complex roots; OpenStax Algebra and Trigonometry for the sum and product of roots. Related: parabola calculator, completing the square calculator, cubic equation calculator and polynomial calculator.