Quadratic Equation Solver
Roots of ax² + bx + c = 0 by the quadratic formula, exact and decimal, with the discriminant, vertex, a graph and every step.
Results
Roots
x ≈ −0.5811 or x ≈ 2.5811
Exact: x = (2 ± √10)/2, the two real solutions of 2x² − 4x − 3 = 0
- Discriminant
- D = 40Positive, not a perfect square: two different irrational roots.
- Vertex
- (1, −5)Minimum y = −5 at x = 1
- Axis of symmetry
- x = 1The parabola is a mirror image on either side of this line.
- y-intercept
- (0, −3)Where the graph crosses the y-axis: y = c when x = 0.
- Sum of roots
- 2−b/a, whatever the kind of roots.
- Product of roots
- −3/2c/a, whatever the kind of roots.
How this was solved
- Standard form: 2x² − 4x − 3 = 0, with a = 2, b = −4 and c = −3.
- Quadratic formula: x = (−b ± √(b² − 4ac)) / (2a)
- Discriminant: b² − 4ac = (−4)² − 4 × 2 × (−3) = 16 − (−24) = 40
- 40 is positive but not a perfect square, so there are two different irrational roots.
- Simplify the square root: √40 = √(4 × 10) = 2√10
- Substitute: x = (−(−4) ± 2√10) / (2 × 2) = (4 ± 2√10)/4
- Divide the top and bottom by 2: x = (2 ± √10)/2
- With √10 ≈ 3.16228: x₁ = (2 − √10)/2 ≈ −0.5811 and x₂ = (2 + √10)/2 ≈ 2.5811
- Check: (2 + √10)/2 + (2 − √10)/2 = 4/2 = 2 = −b/a (the √10 parts cancel), and the product is (2² − 10)/2² = −6/4 = −3/2 = c/a.
- Divide every term by 2 so x² has coefficient 1: x² − 2x − 3/2 = 0
- Move the constant to the right side: x² − 2x = 3/2
- Add the square of half the x coefficient, (−2 ÷ 2)² = 1, to both sides: x² − 2x + 1 = 3/2 + 1
- The left side is now a perfect square: (x − 1)² = 5/2
- Take the square root of both sides: x − 1 = ±√(5/2) = ±√10/2
- Solve for x: x = 1 ± √10/2, which is x = (2 ± √10)/2
- The same steps give the vertex form of the equation, 2(x − 1)² − 5 = 0, so the vertex is (1, −5).
- The discriminant 40 isn't a perfect square, so no two whole numbers multiply to a × c = −6 and add to b = −4: 2x² − 4x − 3 doesn't factor over the rationals (whole numbers and fractions).
- Over the real numbers it factors with its roots: 2(x − (2 + √10)/2)(x − (2 − √10)/2) = 0
Forms and shape
- Standard form
- 2x² − 4x − 3 = 0ax² + bx + c = 0
- Vertex form
- 2(x − 1)² − 5 = 0a(x − h)² + k = 0, with the vertex (h, k)
- Factored form
- Doesn’t factorOver the rationals: √10 is irrational. The Factoring tab shows it over the real numbers.
- Opens
- Upwarda > 0, so the vertex is the lowest point.
- Where y > 0
- x < −0.5811 or x > 2.5811(−∞, (2 − √10)/2) ∪ ((2 + √10)/2, ∞)
- Where y < 0
- −0.5811 < x < 2.5811((2 − √10)/2, (2 + √10)/2)
Chart data: Graph of y = 2x² − 4x − 3
| Point | x | y |
|---|---|---|
| Vertex | 1 | −5 |
| Root x₁ | −0.5811 | 0 |
| Root x₂ | 2.5811 | 0 |
| y-intercept | 0 | −3 |
| x | y |
|---|---|
| −1.5 | 7.5 |
| −1 | 3 |
| −0.5 | −0.5 |
| 0 | −3 |
| 0.5 | −4.5 |
| 1 | −5 |
| 1.5 | −4.5 |
| 2 | −3 |
| 2.5 | −0.5 |
| 3 | 3 |
| 3.5 | 7.5 |
Assumptions
- a, b and c are read exactly: 0.1 is 1/10 and 1/3 stays 1/3, so the exact answers involve no rounding.
- Decimals are rounded to 4 places for display only, and to at most 15 significant digits, about as many as the arithmetic carries. A value too small to show at that precision keeps 3 significant digits instead (in scientific notation below 0.000001).
- Decimal roots use the stable form of the quadratic formula: q = −(b + sign(b)√D)/2, then q/a and c/q, with D computed exactly. The textbook form can lose digits when b² is much larger than 4ac.
- The graph and the table of values show x from −1.5 to 3.5, chosen to include the vertex, the real roots and, when it is close, the y-intercept.
Calculated in your browser. This site doesn't send or store the numbers you enter.
What this solver answers
It finds the solutions (roots) of any quadratic equation : exactly, with square roots simplified and fractions reduced, and as decimals to the number of places you choose. It also gives the discriminant, the vertex, the vertex and factored forms, where the graph is above or below the axis, a graph with the roots marked and a table of values. Complex roots are written as , and is solved as the linear equation it becomes instead of being treated as an error.
How to use it
- a, b, c: the numbers in front of , in front of , and on their own, after everything is on one side of the equals sign. Each box takes whole numbers, decimals and fractions such as
1/2,-3/4or2 1/3; a fraction is kept exact, and a “Read as” line shows how it was read. On a phone, keys under the box type the minus sign and the slash that a number keypad hides. - Equation: choose it to type the whole equation as you have it, such as
2x^2 = 4x + 6,x² − 5x + 6(no equals sign means ”= 0”) or3x(x − 2) = 5 − x. The solver expands both sides, moves everything to the left and shows the standard form with a, b and c under the box. Any one letter can be the unknown, and a leadingy =orf(x) =is read as “where is it 0?”. - Decimal places: how many to show in decimal answers. Exact answers are never rounded.
The Try chips load cases worked through below: complex roots, a double root, fractions, a typed equation with as the unknown, and .
How to use the quadratic formula
For with :
- , , : the coefficients of the equation in standard form
- : the discriminant , the part under the square root
- : one root uses , the other
The formula comes from completing the square on the general equation: divide by , move to the right, add to both sides so the left side becomes , and take the square root. The Completing the square tab in the results does exactly this with your numbers.
Worked example: 2x² − 4x − 3 = 0
Here , and (the example the calculator opens with).
- Discriminant: , which is . It is positive but not a perfect square, so there are two irrational roots.
- Simplify the square root: .
- Substitute: , and dividing the top and bottom by 2 gives .
- Decimals: with , and .
- Check with the sum and product of the roots: they add up to and multiply to .
The vertex is at , where , so the vertex form is . The graph opens upward, crosses the y-axis at , is below the axis for and above it outside that interval. Because 40 is not a perfect square, doesn’t factor over the rational numbers.
What the discriminant tells you
The sign of tells you the kind of roots before you finish the formula (for whole-number or fraction coefficients):
| Discriminant | Roots | Example from the Try chips |
|---|---|---|
| Positive and a perfect square | Two different rational roots | : , roots −3 and 5 |
| Positive, not a perfect square | Two different irrational roots, | : |
| Zero | One double root, | : , root 3/2 |
| Negative | No real roots; two complex conjugate roots | : |
So a quadratic has exactly one real solution only when : has , and the left side is the perfect square .
Quadratics with complex (imaginary) roots
When is negative the square root in the formula is imaginary, with . For : and , so . The two roots are conjugates: they differ only in the sign of the imaginary part. The parabola never reaches the x-axis; its lowest point, the vertex, is at , above the axis.
Finding the vertex and axis of symmetry
The vertex is at , and its height is , which is the same as . The axis of symmetry is the vertical line , halfway between the roots. When the parabola opens upward and the vertex is its minimum; when it opens downward and the vertex is its maximum. The y-intercept is always .
Vertex form and factored form
- Vertex form shows the vertex directly. OpenStax calls this the standard form of a quadratic function, while for equations “standard form” usually means , as on this page.
- Factored form exists over the rational numbers only when the roots are rational, which is when the discriminant is a perfect square. The calculator writes the factors with whole numbers: , found by looking for two numbers that multiply to and add to (they are −5 and 3). With fractions it first multiplies through to clear them: times 6 is , which gives the roots −1/3 and 1 and .
Solving an equation that isn’t in standard form
Move every term to one side first, then read off a, b and c. Choosing Equation under Enter does this for you and shows each step:
- expands to , and subtracting the right side gives . Then and , about −0.7033 and 2.3699.
- A ball thrown up at 12 m/s from 1.5 m has height meters after seconds. Typing that equation finds when : , about −0.1192 and 2.5682. Only the positive root is a time after the throw, so the ball lands after about 2.5682 seconds. The vertex, about , is the highest point: 8.8469 m after 1.2245 seconds.
- To ask when the ball is at 5 m, type
-4.9t^2 + 12t + 1.5 = 5. The roots are about 0.3384 s (on the way up) and 2.1105 s (on the way down).
What if a = 0?
Then there is no term and the equation is linear, , with the one solution : gives . If is also 0, what’s left is . That is true for every when is 0 (an identity) and never true otherwise (no solution); the calculator says which.
Reading the result
- Roots: the answer, exact when the roots are rational or complex and as decimals when they are irrational, with the exact form underneath.
- Discriminant, vertex, axis, y-intercept, sum and product of the roots: the facts a homework question usually asks for next. The sum and product hold for every kind of root.
- How this was solved: the steps to standard form, then tabs for the quadratic formula, completing the square and factoring, each with your numbers and a check.
- Forms and shape: standard, vertex and factored forms, which way the parabola opens, and where is positive or negative, in words and in interval notation.
- Graph and table of values: the parabola with its roots, vertex and y-intercept marked, and a table of values at round steps across the same range, which you can download as a CSV file.
Assumptions and limitations
- Coefficients are real numbers typed as whole numbers, decimals or fractions, and they are used exactly: 0.1 is 1/10 and 1/3 stays 1/3. Irrational coefficients such as √2 or π can’t be typed; round them to a decimal first, and the answer is then exact for that decimal.
- A typed equation must be a polynomial of degree 2 or less after simplifying. Powers must be whole numbers, and the unknown can’t be in a denominator: multiply both sides by it first.
- Decimals are rounded only for display. A decimal root too small to show at your precision keeps 3 significant digits instead, so it never reads as 0.
- Square roots of very large numbers are checked for square factors up to 200,000 (up to a smaller bound for numbers of more than about 300 digits, so the check stays quick); when that isn’t enough to prove the root fully simplified, the assumptions under the result say so.
Accuracy: why the calculator uses a stable version of the formula
Computers store decimals with about 16 significant digits. When is much larger than , is almost exactly , and one of subtracts two nearly equal numbers, losing most of those digits. For the textbook formula worked in ordinary double-precision arithmetic gives the small root as about . The true root is . The calculator computes the discriminant exactly, takes the root without cancellation first (, then ) and gets the other as , which gives and −100,000,000. A note appears under the answer whenever the textbook form would have lost digits.
Common mistakes
- Reading a, b and c before rearranging. In , is not 4: in standard form the equation is , so and .
- Sign slips with a negative b. With , is and is , not −16.
- Dividing only the square root by 2a. The whole numerator is divided: , not .
- Leaving √40 or (4 ± 2√10)/4 unsimplified. Take out square factors first, then divide every term of the numerator and the denominator by their common factor.
- Dividing both sides by x. In , dividing by loses the root ; move the terms to one side and factor, , to keep both roots, 0 and 2.
- Keeping a root the problem can’t use. A negative time or length is a correct root of the equation but not an answer to the question.
Questions
How do I find the vertex from the two roots?
The axis of symmetry runs halfway between the roots, so the vertex’s x is their average, (x₁ + x₂) ÷ 2. For 2x² − 4x − 3 = 0 that is (−0.5811 + 2.5811) ÷ 2 = 1. Put that x back into the equation’s left side to get the y of the vertex, here −5. This works for a double root too, which is the vertex itself.
Does every quadratic equation have two solutions?
Counting a double root twice and allowing complex numbers, yes, always exactly two. Over the real numbers alone there can be two, one or none, which is what the sign of the discriminant tells you. A graph shows the real ones as the points where the parabola meets the x-axis.
Which method should I use, factoring, completing the square or the formula?
The quadratic formula always works. Factoring is quickest when the discriminant is a perfect square and the numbers are small, because then the roots are rational. Completing the square is the method to use when you also need the vertex form. The calculator shows all three for the same equation, so you can check the one your class uses.
Sources
- College Algebra 2e, 2.5 Quadratic Equations OpenStax (Rice University) Standard form ax² + bx + c = 0; solving by factoring and grouping (two numbers whose product is ac and whose sum is b), by completing the square and by the quadratic formula; the discriminant table (zero, positive perfect square, positive non-square, negative).
- College Algebra 2e, 5.1 Quadratic Functions OpenStax (Rice University) The vertex, the axis of symmetry x = −b/(2a) halfway between the zeros, the y-intercept, a > 0 opening upward, and the form a(x − h)² + k with vertex (h, k), which the book calls the standard or vertex form of a quadratic function; height models such as h(t) = −4.9t² + … in meters and seconds.
- College Algebra 2e, 2.4 Complex Numbers OpenStax (Rice University) The imaginary unit i, the square root of a negative number, and the complex conjugate a − bi of a + bi.
- College Algebra 2e, 1.3 Radicals and Rational Exponents OpenStax (Rice University) Simplifying a square root with the product rule by taking out perfect-square factors.
- College Algebra 2e, 2.2 Linear Equations in One Variable OpenStax (Rice University) Linear equations are identities (true for every value), conditional (one solution) or inconsistent (no solution), which covers a = 0.
- Vieta’s Formulas Wolfram MathWorld For a quadratic, the roots add up to −b/a and multiply to c/a, used for the check in the steps.
- What Every Computer Scientist Should Know About Floating-Point Arithmetic (D. Goldberg, 1991) Oracle (reprint of ACM Computing Surveys 23(1)) Catastrophic cancellation in the quadratic formula when b² is much larger than 4ac, and the rearranged formula that avoids it for the root that would cancel.
Smart Financial Calc: https://smartfinancialcalc.com/math/quadratic-equation-calculator/