What Is a Quadratic Equation?
Quadratic means degree two: the highest power of the unknown is 2, and nothing higher appears. That single restriction is what makes a closed-form solution possible. Cubics and quartics have formulas too, longer and uglier ones; from degree five upward the Abel–Ruffini theorem says no general formula in radicals exists at all. Degree two is the last comfortable case, which is why it is the one every syllabus drills.
Standard Form: ax² + bx + c = 0
Standard form is the shape the formula expects and the shape this page's three boxes assume: everything collected on the left, zero on the right, powers in descending order. The letters a, b and c are the coefficients, and each one carries its own sign. In x² − 5x + 6 = 0, b is −5, not 5 — the minus belongs to the coefficient, not to the operation.
STANDARD FORM a·x² + b·x + c = 0 a ≠ 0 a coefficient of x² (the leading coefficient) b coefficient of x c the constant term REARRANGE FIRST, THEN READ OFF a, b AND c x² = 5x − 6 → x² − 5x + 6 = 0 a = 1, b = −5, c = 6 3x² = 12 → 3x² + 0x − 12 = 0 a = 3, b = 0, c = −12 (x − 2)(x + 3) = 0 → x² + x − 6 = 0 a = 1, b = 1, c = −6
All three rearrangements above were run through this page's own solver. Entering 1, −5, 6 returns 3.00 and 2.00; 3, 0, −12 returns 2.00 and −2.00; 1, 1, −6 returns 2.00 and −3.00 — exactly what (x − 2)(x + 3) = 0 promised before anyone touched the formula.
A missing term is a zero coefficient, not a missing box. x² − 2 = 0 has b = 0, and x² − 5x = 0 has c = 0. Type the zero in; an empty field is read as zero too, but silently, which is a habit worth not forming.
Why a Cannot Be Zero
Set a to zero and the x² term disappears. What is left, bx + c = 0, is a linear equation with exactly one solution, x = −c ÷ b, and no discriminant to speak of. The quadratic formula cannot rescue it either: its denominator is 2a, so a = 0 is a division by zero.
The solver refuses that case outright. Put 0 in the first box, or leave the first box empty, and instead of roots it returns the single line "Invalid coefficients (a cannot be 0)". No discriminant, no type line — the calculation never starts.
If you genuinely have a linear equation, solve it directly. 5x + 6 = 0 gives x = −6 ÷ 5 = −1.2: one root, one step, no square root anywhere.
Root, Solution, Zero, x-Intercept
Four words, one idea, and textbooks switch between them without warning. Each names a value of x that makes the left-hand side equal zero.
- Root — the equation's own word. x = 3 is a root of x² − 5x + 6 = 0 because substituting it gives 9 − 15 + 6 = 0.
- Solution — the same number, described as the answer to a question rather than as a property of a polynomial.
- Zero — the function's word. Write f(x) = x² − 5x + 6 and 3 is a zero of f, since f(3) = 0.
- x-intercept — the graph's word. Plot y = x² − 5x + 6 and the curve crosses the horizontal axis at x = 3 and x = 2.
The four coincide only while the roots are real. When the discriminant turns negative there are still two roots and still two solutions, but no x-intercepts at all: the parabola clears the axis entirely, sitting above it when a is positive and below it when a is negative.
The curve behind every quadratic bends, which is what separates this from straight-line work — a line has at most one root and needs none of this machinery, as the two-point method behind the Slope Calculator.
Where Quadratics Actually Come From
Almost nobody meets ax² + bx + c = 0 in the wild already written that way. It arrives as a sentence about something else and becomes a quadratic on the way to being solved.
- Area with one unknown side. A rectangle three meters longer than it is wide with an area of 40 m² gives w(w + 3) = 40, which is w² + 3w − 40 = 0.
- Height under gravity. A ball thrown upward follows h = −4.9t² + v₀t + h₀ in meters and seconds; asking when it lands means setting h to zero.
- Right triangles. One leg seven centimeters longer than the other with a hypotenuse of 13 gives x² + (x + 7)² = 169, a quadratic once expanded.
- Break-even and revenue. Price times quantity, where quantity itself falls as price rises, multiplies out to a quadratic in price.
- Optimization. The vertex of a parabola is its maximum or minimum, and it sits at x = −b ÷ 2a — the midpoint of the two roots.
Wolfram MathWorld dates the first known solution of a quadratic to the Berlin papyrus of Egypt's Middle Kingdom, roughly 2160–1700 BC, and notes that Diophantus, working around AD 210–290, reported only one root even when both were positive. The second root is a comparatively recent courtesy.
The Quadratic Formula, Explained
One line solves every quadratic that exists. It never fails, it never needs a lucky guess, and it works identically whether the answer is a whole number, an irrational decimal or a complex pair. Factoring is faster when it works; the formula is the one that always works.
The Formula, Written Out
Three expressions do the whole job: the formula itself, the discriminant buried inside it, and the two identities that let you check an answer in five seconds.
THE QUADRATIC FORMULA
−b ± √(b² − 4ac)
x = ──────────────────────
2a
THE DISCRIMINANT
D = b² − 4ac
D > 0 two distinct real roots
D = 0 one repeated real root, x = −b ÷ 2a
D < 0 two complex roots, x = −b/2a ± (√−D / 2a)·i
SUM AND PRODUCT OF THE ROOTS
x₁ + x₂ = −b ÷ a
x₁ · x₂ = c ÷ a
The NIST Digital Library of Mathematical Functions gives the roots of az² + bz + c = 0 in precisely this form in §1.11(iii), names D = b² − 4ac the discriminant, and states the sum and product of the roots as −b/a and c/a on the same page.
The ± is one symbol doing two jobs. Run the whole expression once with a plus and once with a minus and you have both roots; the only thing that changes between them is that sign.
Where the Formula Comes From: Completing the Square
It is not a rule handed down; it is what you get by completing the square on the general equation once, so that nobody has to do it again. MathWorld derives it exactly this way. Following the seven lines below is worth more than memorizing the result, because line five is where the discriminant is born.
COMPLETING THE SQUARE ON ax² + bx + c = 0 1. ax² + bx + c = 0 2. x² + (b/a)x + c/a = 0 divide by a — legal only because a ≠ 0 3. x² + (b/a)x = −c/a 4. x² + (b/a)x + (b/2a)² = (b/2a)² − c/a add the square of half the x-coefficient 5. (x + b/2a)² = (b² − 4ac) / 4a² the left side is now a perfect square 6. x + b/2a = ± √(b² − 4ac) / 2a take the square root of both sides 7. x = (−b ± √(b² − 4ac)) / 2a
Notice what happens at line 5. Before any square root is taken, the whole right-hand side has collapsed into b² − 4ac over a denominator, 4a², that cannot be negative. Whether the next step is possible in the real numbers therefore depends on the sign of b² − 4ac and nothing else. That is the entire reason the discriminant decides the root type.
Line 2 is also where a ≠ 0 stops being a technicality. Divide by a zero a and the derivation collapses at its second step, long before the formula appears.
The Discriminant Is the Part That Decides
Compute b² − 4ac first and you know the shape of the answer before you find it. The solver does the same thing internally: it evaluates the discriminant, branches on its sign, and only then works out the roots. The type line it prints is that branch, reported back to you.
| b² − 4ac | Roots | The parabola y = ax² + bx + c | Type line the panel prints |
|---|---|---|---|
| Positive | Two different real roots | Crosses the x-axis at two points | Two Real Roots |
| Exactly zero | One real root, counted twice | Touches the axis once, at the vertex, and turns | One Repeated Root |
| Negative | Two complex roots, a conjugate pair | Never meets the axis — wholly above it if a > 0, wholly below if a < 0 | Complex Roots |
MathWorld defines a polynomial discriminant as the product of the squares of the differences of the roots, which for a quadratic works out as a²(x₁ − x₂)². Test it on x² − 3x − 4 = 0: the roots are 4 and −1, their difference is 5, and 1² × 5² = 25, which is the discriminant 9 + 16. Test it on 2x² + 5x − 3 = 0: roots 0.5 and −3, difference 3.5, and 2² × 3.5² = 49, which is 25 + 24.
That identity is why a zero discriminant means a repeated root rather than no root. If a²(x₁ − x₂)² = 0 and a is not zero, the two roots have zero distance between them — they are the same number.
Sum and Product: The Check That Takes Five Seconds
Whatever the two roots turn out to be, they must add to −b/a and multiply to c/a. Both quantities come straight off the coefficients, so the check costs no work and catches sign slips immediately.
| Equation | Roots the panel prints | Sum, against −b ÷ a | Product, against c ÷ a |
|---|---|---|---|
| 2x² + 5x − 3 = 0 | 0.50 and −3.00 | −2.50, and −5 ÷ 2 = −2.5 | −1.50, and −3 ÷ 2 = −1.5 |
| x² − 7x + 12 = 0 | 4.00 and 3.00 | 7, and 7 ÷ 1 = 7 | 12, and 12 ÷ 1 = 12 |
| x² + 8x + 15 = 0 | −3.00 and −5.00 | −8, and −8 ÷ 1 = −8 | 15, and 15 ÷ 1 = 15 |
| x² − x − 1 = 0 | 1.62 and −0.62 | 1.00, and 1 ÷ 1 = 1 | −1.0044, but c ÷ a = −1 |
The last row is the honest one. The true roots of x² − x − 1 = 0 are 1.6180339887 and −0.6180339887, and their product is exactly −1; the panel shows them rounded to 1.62 and −0.62, and 1.62 × −0.62 = −1.0044. The identity has not failed, the display has. Use the check as a sanity test on printed values, not as a proof of the last decimal.
The same two identities run backwards. Given roots 3 and 2, the quadratic with leading coefficient 1 and those roots is x² − (sum)x + (product) = x² − 5x + 6 — which is where a great many textbook questions are quietly manufactured.
How Do You Calculate a Quadratic Equation?
Seven steps by hand, four with the tool. Both routes are below, and then one worked example is carried through each of the three discriminant cases so you can see what changes and what does not.
Step by Step, by Hand
Work in this order. Each step depends on the one above it, and the third is where most marks are lost.
- Get the equation into standard form: everything on the left, zero on the right, x² term first.
- Read off a, b and c with their signs attached. A missing x term means b = 0; a missing constant means c = 0.
- Compute D = b² − 4ac. Square b before doing anything else — (−5)² is +25 — and watch the signs of a and c together, because −4ac comes out positive whenever those two disagree in sign, which pushes D up.
- Look at the sign of D. Positive means two real roots, zero means one repeated root, negative means a complex pair.
- Take √D if D is positive or zero. If it is negative, take √(−D) instead and carry that value as the imaginary part.
- Divide. (−b + √D) ÷ 2a is one root and (−b − √D) ÷ 2a is the other. Work out 2a once and reuse it.
- Check: the two roots should add to −b/a and multiply to c/a.
Step 3 accounts for most wrong answers, almost always through one of two sign errors: squaring a negative b as though it stayed negative, or subtracting 4ac when c is already negative. On 2x² + 5x − 3 = 0, −4ac is −4 × 2 × (−3) = +24, so D is 25 + 24 = 49, not 25 − 24 = 1. Those two discriminants lead to completely different answers.
Step by Step With This Solver
The form has three number fields and two buttons. There is nothing to select and no unit to choose.
- Coefficient a — the number in front of x². Anything except 0.
- Coefficient b — the number in front of x, sign included. If there is no x term, type 0 rather than leaving the field empty.
- Coefficient c — the constant term, sign included.
- Press Calculate. The roots and the type line appear in the panel beside the form.
The three boxes arrive empty and carry no default value, so nothing is worked out until you press Calculate. The tool does not recompute as you type either: change a coefficient and press the button again. Reset clears all three fields and returns the panel to its starting state, and Copy result puts the readout and the rows beneath it on the clipboard as plain lines of text.
Decimals and negatives are accepted in every field — −4.9, 0.5 and 0.0025 all work. The fields carry no minimum and no maximum, so nothing on screen stops you entering a coefficient far larger than the arithmetic handles gracefully; the limits section says where that begins to matter.
Worked Example: 2x² + 5x − 3 = 0
Enter 2, 5 and −3, then press Calculate. Every row below is one line of the arithmetic, and the final row is the panel's output character for character.
| Step | For a = 2, b = 5, c = −3 |
|---|---|
| Coefficients | a = 2, b = 5, c = −3 |
| Discriminant b² − 4ac | 5² − 4 × 2 × (−3) = 25 + 24 = 49 |
| Sign of D | Positive — so two distinct real roots |
| √D | √49 = 7, a whole number, so both roots will be rational |
| 2a | 2 × 2 = 4 |
| First root, (−b + √D) ÷ 2a | (−5 + 7) ÷ 4 = 2 ÷ 4 = 0.5 |
| Second root, (−b − √D) ÷ 2a | (−5 − 7) ÷ 4 = −12 ÷ 4 = −3 |
| What the panel returns | Root 1: 0.50 | Root 2: -3.00 | Type: Two Real Roots |
Three independent checks agree. Substituting: 2(0.5)² + 5(0.5) − 3 = 0.5 + 2.5 − 3 = 0, and 2(−3)² + 5(−3) − 3 = 18 − 15 − 3 = 0. Sum and product: 0.5 + (−3) = −2.5 = −5/2, and 0.5 × (−3) = −1.5 = −3/2. And because √49 came out whole, the trinomial factors over the integers: 2x² + 5x − 3 = (2x − 1)(x + 3), whose zeros are ½ and −3.
One number the tool does not print, but which you now have for free: the axis of symmetry sits at −b ÷ 2a = −5 ÷ 4 = −1.25, exactly halfway between 0.50 and −3.00. That is where the vertex of the parabola lives, and the solver says nothing about it.
Worked Example: One Repeated Root, x² − 6x + 9 = 0
Here a = 1, b = −6 and c = 9, so D = 36 − 36 = 0. With the square root gone, the ± has nothing left to do and both branches land on the same value: −b ÷ 2a = 6 ÷ 2 = 3.
Enter 1, −6 and 9 and the panel returns "Root: 3.00 | Type: One Repeated Root" — two segments where the previous example gave three. The word is singular, and no Root 2 row appears at all. That absence is the result: the solver is telling you the two roots have collapsed into one.
Algebraically the reason is visible on sight, because x² − 6x + 9 is (x − 3)². Graphically, the parabola drops to the axis at x = 3, touches it, and climbs away without ever crossing. 4x² − 4x + 1 = 0 behaves the same way and returns "Root: 0.50"; so does 9x² + 12x + 4 = 0, which returns "Root: -0.67".
Worked Example: Complex Roots, x² + 2x + 5 = 0
Now a = 1, b = 2 and c = 5, giving D = 4 − 20 = −16. No real number squares to a negative, so the roots leave the number line. Take √16 = 4 instead and split the formula in two: the real part is −b ÷ 2a = −2 ÷ 2 = −1, and the imaginary part is 4 ÷ 2 = 2.
The panel returns "Roots: -1.00 ± 2.00i | Type: Complex Roots". Both roots share one line because complex roots of a real quadratic always arrive as a conjugate pair, −1 + 2i and −1 − 2i, differing only in the sign in the middle. The Common Core standard for this topic asks students to recognize when the formula gives complex solutions and to write them as a ± bi, which is the form on screen.
Substituting confirms it. (−1 + 2i)² = 1 − 4i + 4i² = −3 − 4i; adding 2(−1 + 2i) = −2 + 4i gives −5; adding the constant 5 gives 0. The imaginary parts cancel, which is what makes the pair a solution.
When a Is Negative, Root 1 Is Not the Bigger One
A ball leaves a hand 1.5 m above the ground at 20 m/s straight up, so its height is h = −4.9t² + 20t + 1.5. Asking when it hits the ground means solving −4.9t² + 20t + 1.5 = 0. Enter −4.9, 20 and 1.5. The discriminant is 20² − 4(−4.9)(1.5) = 400 + 29.4 = 429.4.
The panel returns "Root 1: -0.07 | Root 2: 4.16 | Type: Two Real Roots", and this time Root 1 is the smaller of the two. The label always belongs to the branch that adds the square root, and dividing that branch by a negative 2a puts it below the other one. Whenever a is positive, Root 1 is the larger root; whenever a is negative, it is the smaller. The ordering follows the sign of a, not the size of the answer.
Physically, 4.16 seconds is the flight time and −0.07 seconds is the algebraic mirror — where the parabola would have crossed the ground had the throw started earlier. The equation has two roots; the situation has one.
Quadratic Equation Examples, Solved
Nineteen equations below, each one run through this page's formula rather than copied from anywhere. Column three is the discriminant, and it explains every difference in the two columns after it.
Nineteen Equations and What the Panel Returns
| Equation | a, b, c | b² − 4ac | Roots the panel prints | Type line |
|---|---|---|---|---|
| x² − 5x + 6 = 0 | 1, −5, 6 | 1 | 3.00 and 2.00 | Two Real Roots |
| x² − 7x + 12 = 0 | 1, −7, 12 | 1 | 4.00 and 3.00 | Two Real Roots |
| x² + 7x + 12 = 0 | 1, 7, 12 | 1 | −3.00 and −4.00 | Two Real Roots |
| x² + 8x + 15 = 0 | 1, 8, 15 | 4 | −3.00 and −5.00 | Two Real Roots |
| x² − x − 6 = 0 | 1, −1, −6 | 25 | 3.00 and −2.00 | Two Real Roots |
| x² − 3x − 4 = 0 | 1, −3, −4 | 25 | 4.00 and −1.00 | Two Real Roots |
| x² − 9x + 20 = 0 | 1, −9, 20 | 1 | 5.00 and 4.00 | Two Real Roots |
| 2x² + 5x − 3 = 0 | 2, 5, −3 | 49 | 0.50 and −3.00 | Two Real Roots |
| 3x² − 11x − 4 = 0 | 3, −11, −4 | 169 | 4.00 and −0.33 | Two Real Roots |
| 6x² − 7x − 3 = 0 | 6, −7, −3 | 121 | 1.50 and −0.33 | Two Real Roots |
| 5x² − 3x − 2 = 0 | 5, −3, −2 | 49 | 1.00 and −0.40 | Two Real Roots |
| x² − 2 = 0 | 1, 0, −2 | 8 | 1.41 and −1.41 | Two Real Roots |
| x² − x − 1 = 0 | 1, −1, −1 | 5 | 1.62 and −0.62 | Two Real Roots |
| x² + 6x + 9 = 0 | 1, 6, 9 | 0 | −3.00, on one line only | One Repeated Root |
| 4x² − 4x + 1 = 0 | 4, −4, 1 | 0 | 0.50, on one line only | One Repeated Root |
| 9x² + 12x + 4 = 0 | 9, 12, 4 | 0 | −0.67, on one line only | One Repeated Root |
| x² + 2x + 5 = 0 | 1, 2, 5 | −16 | −1.00 ± 2.00i | Complex Roots |
| 2x² + 3x + 5 = 0 | 2, 3, 5 | −31 | −0.75 ± 1.39i | Complex Roots |
| x² + 1 = 0 | 1, 0, 1 | −4 | 0.00 ± 1.00i | Complex Roots |
Two patterns run down the discriminant column. Where D is a perfect square — 1, 4, 25, 49, 121, 169 — its square root is a whole number and both roots come out rational, which is exactly the set of rows a textbook expects you to factor instead. Where it is not — 8 and 5 — the roots are irrational, and the two decimals on screen are a rounding of a decimal that never ends: 1.41 is √2 (1.41421…) rounded down, and 1.62 is the golden ratio (1.61803…) rounded up.
Rows nine and ten repay a second look. 3x² − 11x − 4 = 0 and 6x² − 7x − 3 = 0 both print −0.33 as their second root, and in both cases the exact value is −⅓. Two decimals is simply what a third looks like at this precision, and no amount of rounding will ever make it look exact.
Factoring vs the Formula: Same Roots, Two Routes
When the discriminant is a perfect square, factoring reaches the same answer in less writing. When it is not, factoring cannot get there at all and the formula is the only way through. Checking D first tells you which situation you are in before you spend five minutes hunting for factor pairs that do not exist.
| Equation | Factored form | Roots | b² − 4ac |
|---|---|---|---|
| x² − 5x + 6 = 0 | (x − 2)(x − 3) = 0 | 2 and 3 | 1 |
| x² + 7x + 12 = 0 | (x + 3)(x + 4) = 0 | −3 and −4 | 1 |
| x² − x − 6 = 0 | (x − 3)(x + 2) = 0 | 3 and −2 | 25 |
| 2x² + 5x − 3 = 0 | (2x − 1)(x + 3) = 0 | 0.5 and −3 | 49 |
| 6x² − 7x − 3 = 0 | (3x + 1)(2x − 3) = 0 | −⅓ and 1.5 | 121 |
| x² − 2 = 0 | no integer factors exist | ±1.41… | 8 |
The factored forms above multiply back out correctly: (2x − 1)(x + 3) expands to 2x² + 6x − x − 3, which is 2x² + 5x − 3, and (3x + 1)(2x − 3) expands to 6x² − 9x + 2x − 3, which is 6x² − 7x − 3. Each of them produces the roots this solver returns for the same coefficients, which is the point — factoring and the formula are two routes to one destination, and the discriminant tells you in advance whether the shorter route is open.
Trial factoring starts from the factor pairs of the constant term, so when you are hunting for the two numbers that multiply to c and add to b, list them first with the Factor Calculator.
A Word Problem That Becomes a Quadratic
A rectangular garden is 3 m longer than it is wide and covers 40 m². Call the width w. The length is w + 3, so the area statement is w(w + 3) = 40, which expands to w² + 3w − 40 = 0. Enter 1, 3 and −40.
The panel returns "Root 1: 5.00 | Root 2: -8.00 | Type: Two Real Roots". A width of 5 m gives a length of 8 m and an area of 40 m², which is the garden. A width of −8 m is a perfectly valid root of the equation and a meaningless answer to the question, so it is discarded on physical grounds rather than mathematical ones.
That discard is the step word problems mark you on. The solver has no idea what w represents and will never reject a root for you; deciding which of the two answers belongs to the situation is entirely your job.
A Right Triangle That Turns Into a Quadratic
One leg of a right triangle is 7 cm longer than the other and the hypotenuse is 13 cm. Pythagoras gives x² + (x + 7)² = 169, and expanding leaves 2x² + 14x + 49 = 169, so 2x² + 14x − 120 = 0. Enter 2, 14 and −120 and the panel returns "Root 1: 5.00 | Root 2: -12.00 | Type: Two Real Roots".
The legs are 5 cm and 12 cm, and 5² + 12² = 25 + 144 = 169 = 13² — the 5-12-13 triple. Now divide the whole equation by 2 first: x² + 7x − 60 = 0, entered as 1, 7 and −60, returns exactly the same two roots. Scaling all three coefficients by the same non-zero number cannot move the roots, because it multiplies both sides of ax² + bx + c = 0 by a constant. Smaller numbers, identical answer, less arithmetic.
Dividing through by a common factor before you start is the cheapest simplification available, and the factor you want is the greatest common factor of a, b and c — for 2, 14 and −120 that is 2, which you can confirm with the GCF Calculator.
Quadratic Equation Chart: Discriminant and Root Type
A quadratic equation chart is really a chart of one number. Fix the sign and the arithmetic type of b² − 4ac and everything else follows from it: how many roots, what kind, what the graph does, and which line the panel prints.
The Four Cases in One Table
| b² − 4ac | Real roots | What x looks like | The parabola | Panel type line |
|---|---|---|---|---|
| Positive and a perfect square (1, 4, 9, 16, 25…) | 2 | Two rational numbers | Cuts the axis at two rational points | Two Real Roots |
| Positive but not a perfect square (2, 5, 8, 12…) | 2 | Two irrationals, −b/2a ± √D/2a | Cuts the axis at two irrational points | Two Real Roots |
| Exactly zero | 1, counted twice | x = −b ÷ 2a | Touches the axis at the vertex and turns | One Repeated Root |
| Negative | 0 | −b/2a ± (√−D / 2a)·i, a conjugate pair | Misses the axis entirely | Complex Roots |
The first two rows produce the same type line, and the solver draws no distinction between them — both simply say Two Real Roots. What differs is whether the printed decimals are exact or rounded. 2x² + 5x − 3 = 0 belongs to row one: D = 49, a perfect square, and the panel prints 0.50 and −3.00, both exact. x² − 2 = 0 belongs to row two: D = 8, and the panel prints 1.41 and −1.41, which is ±√2 rounded to two places, with every digit after the second gone from the screen.
The bottom row is the only one where counting roots depends on which number system you are working in. Over the real numbers a negative discriminant means no solutions; over the complex numbers it means two. The solver answers in the second sense, which is what school algebra now expects.
Watching the Type Change: x² + bx + 4 = 0
Hold a at 1 and c at 4, then walk b upward. The discriminant is b² − 16, so it crosses zero the moment b reaches 4, and every row below came from running the solver on that row's coefficients.
| Equation | b² − 4ac | What the panel prints | Type line |
|---|---|---|---|
| x² + 4 = 0 | −16 | 0.00 ± 2.00i | Complex Roots |
| x² + 2x + 4 = 0 | −12 | −1.00 ± 1.73i | Complex Roots |
| x² + 3x + 4 = 0 | −7 | −1.50 ± 1.32i | Complex Roots |
| x² + 4x + 4 = 0 | 0 | −2.00 | One Repeated Root |
| x² + 5x + 4 = 0 | 9 | −1.00 and −4.00 | Two Real Roots |
| x² + 6x + 4 = 0 | 20 | −0.76 and −5.24 | Two Real Roots |
| x² + 8x + 4 = 0 | 48 | −0.54 and −7.46 | Two Real Roots |
The changeover is a single point, not a range. At b = 3 the parabola still floats clear of the axis; at b = 4 it touches once; at b = 5 it has cut through twice and the two roots already sit 3 apart. Nothing gradual happens in between, because the discriminant varies continuously but the count of real roots does not.
Watch the imaginary part shrink as b climbs toward 4: 2.00i, then 1.73i, then 1.32i, then nothing. The two complex roots are converging on the real axis, and they arrive there together at the exact moment the discriminant reaches zero.
Every Row Above Shares One Number
−b ÷ 2a is the axis of symmetry of the parabola, and it turns up in the output whether the roots are real or not. When they are real it is their midpoint; when they are complex it is the real part the panel prints before the ±.
Take x² + 6x + 4 = 0 from the table. Its axis sits at −6 ÷ 2 = −3, and the midpoint of the printed roots −0.76 and −5.24 is exactly −3.00. Now take x² + 2x + 4 = 0, whose roots are complex: its axis sits at −2 ÷ 2 = −1, and the panel prints −1.00 ± 1.73i. The same number, once as a midpoint and once as a real part.
So the readout on a complex result is not an abstraction with nowhere to live on the graph. The real part is where the vertex sits horizontally, and the imaginary part is what sets how far the parabola holds itself clear of the axis, though it is not that distance. The gap is a times the imaginary part squared: for x² + 2x + 4 = 0 the panel prints −1.00 ± 1.73i, the imaginary part is exactly √3, and the vertex sits 1 × 3 = 3 above the axis. A bigger imaginary part always means a wider gap; it is not a reading of the gap.
How to Read Your Result
The panel puts the first piece of the answer in the large readout and lays the rest out as labeled rows beneath it. How many rows you get depends on the discriminant, so the shape of the panel is itself information.
Three Parts, Two Parts, or a Message
There are exactly four things the panel can show, and each corresponds to one branch of the calculation.
- Two real roots — three parts. The readout carries the whole first root including its label, as in Root 1: 4.00. Below it, a row labeled Root 2 holds the second root, and a row labeled Type reads Two Real Roots.
- One repeated root — two parts. The readout reads Root: 3.00, singular, and the only row beneath it is Type: One Repeated Root. No Root 2 row appears, because there is no second root to name.
- Complex roots — two parts. The readout carries both roots at once, as in Roots: -1.00 ± 2.00i, and the row beneath reads Type: Complex Roots.
- Invalid input — one part and nothing beneath it: Invalid coefficients (a cannot be 0).
Counting the parts is the fastest read available. Three of them means the parabola crosses the axis twice; two beginning with the singular Root means it touches once; two beginning with Roots and containing an i means it never meets the axis at all.
The label travels with the number into the readout. It says Root 1: 4.00 rather than a bare 4.00 because the formula sends label and value as one piece of text, and the readout prints that piece whole.
Which Root Is Root 1
Root 1 is always the branch of the formula that adds the square root, and Root 2 is always the branch that subtracts it. That is the only rule; nothing is sorted by size. Because the two branches differ by 2√D ÷ 2a, their order on screen is settled by the sign of a alone — larger first when a is positive, smaller first when a is negative.
Neither one is more correct than the other. Both satisfy the equation exactly, and the calculator has no way of knowing that your problem is about a garden and cannot have a negative width. Choosing between them is a modeling decision that belongs to you, not to the tool.
When the roots are complex the numbering disappears entirely, because the conjugate pair is printed as a single expression. −1.00 ± 2.00i is two roots, not one, however few rows the panel uses to say so.
Reading the ± i Line
Roots: -1.00 ± 2.00i means two numbers, −1 + 2i and −1 − 2i, where i is the square root of −1. The value before the ± is the real part, always equal to −b ÷ 2a. The value attached to the i is the imaginary part, equal to √(−D) ÷ 2a.
They are conjugates — identical except for the sign in the middle — and for an equation with real coefficients they can only ever appear as a pair. That is why one line describes both, and why a real quadratic will never produce one complex root alongside one real one.
Complex roots are not the calculator giving up. The equation still has exactly two solutions; they simply live off the real number line, and the parabola drawn from the same coefficients never touches the x-axis.
The One Message That Replaces an Answer
A single string stands in for the entire result when the leading coefficient will not do: Invalid coefficients (a cannot be 0). Three things trigger it.
- The a box is set to 0. Without an x² term there is no quadratic to solve.
- The a box is left empty. An empty number field is read as zero, so it lands in the same branch.
- The a box holds something the browser cannot read as a number, which it then hands over as an empty string — again zero.
One thing to know about how it appears: this message shows up in the large readout, styled like an answer, rather than in the amber "Check your inputs" notice used for input problems elsewhere on the site. Read it as an error even though it does not look like one. Nothing is wrong with your b or c — fix the first box and press Calculate again.
Note that b and c get no equivalent guard. Zero is a legitimate value for both, and the solver has no way to distinguish a deliberate zero from an empty box.
Limits: When This Solver Does Not Apply
The algebra here is exact; the arithmetic underneath it is not. Four things can open a gap between what the panel prints and what is true, and all four are easy to spot once you know their shapes.
Two Decimals, and What They Hide
Every root is rounded to two decimal places at the moment it is printed. The calculation itself runs at full precision — the rounding is a display step and nothing else — but the display is all you see.
| Equation | The true roots | What the panel prints |
|---|---|---|
| x² − 2 = 0 | ±1.41421356… | 1.41 and −1.41 |
| x² − x − 1 = 0 | 1.6180339887… and −0.6180339887… | 1.62 and −0.62 |
| x² − 2x + 0.999999 = 0 | 1.001 and 0.999 | 1.00 and 1.00, labeled Two Real Roots |
| x² − 1000x + 1 = 0 | 999.998999999 and 0.001000001 | 1000.00 and 0.00 |
The third row is the one to watch. Its type line is right — the discriminant is about 0.000004, genuinely positive, and there really are two distinct roots — but the two printed values are identical, because 1.001 and 0.999 both round to 1.00. Two matching numbers under a Two Real Roots label mean the roots are close together, not that the label is wrong.
The fourth row loses information in both directions at once: the larger root, 999.999, rounds up past 1000, and the smaller one, just over 0.001, rounds down to nothing. And if you need surds — x = 1 ± √2 rather than 2.41 and −0.41 — this tool will not give them to you at any setting.
Floating Point Can Miss a Repeated Root
x² + 0.1x + 0.0025 = 0 is exactly (x + 0.05)², so it has one repeated root at −0.05. Enter 1, 0.1 and 0.0025 and the panel returns "Root 1: -0.05 | Root 2: -0.05 | Type: Two Real Roots" — the right numbers under the wrong label.
The cause is binary arithmetic. Neither 0.1 nor 0.0025 has an exact representation in the format computers use for decimals, so b² − 4ac evaluates to roughly 1.7 × 10⁻¹⁸ rather than a clean 0. The solver tests that value against zero exactly, and a discriminant positive by a quintillionth of a unit is still positive, so it takes the two-real-roots branch.
The practical rule: if the two printed roots are identical, treat the equation as having a repeated root whatever the type line says, and confirm it by checking on paper whether b² equals 4ac exactly. Whole-number coefficients are immune to this, since integers are stored exactly — 1, 6, 9 correctly returns One Repeated Root.
A Very Large b Destroys the Small Root
MathWorld records a second form of the quadratic formula and explains why it exists: when b² is very much greater than 4ac, the usual form gives inaccurate numerical results for one of the two roots. The alternate form arranges the arithmetic so that the damaging subtraction never happens. This solver uses the usual form.
x² − 100,000,000x + 1 = 0 shows the damage. The product of the roots must equal c ÷ a = 1, so with a larger root of 10⁸ the smaller one is 10⁻⁸. The value the calculation actually produces is 7.45 × 10⁻⁹, about 25% low, because the second root's numerator, −b − √D, subtracts two numbers that agree to fifteen digits and keeps only what is left. The first root's numerator adds them instead, loses nothing worth naming, and returns the large root as 10⁸. The true 10⁻⁸ and the 7.45 × 10⁻⁹ the tool computes both round to 0.00 on screen, so the error never reaches you.
None of this bites at homework scale. With single- and double-digit coefficients the two decimals shown are correct to the last digit, and the discriminant is nowhere near the range where cancellation matters.
A Blank b or c Is Read as Zero
The a field is guarded and the other two are not. Leave b empty with a = 1 and c = −4, press Calculate, and the panel returns "Root 1: 2.00 | Root 2: -2.00 | Type: Two Real Roots" — a completely correct solution to x² − 4 = 0, which may not be the equation you meant to ask about.
It goes further. Put 3 in the a box, leave both b and c empty, and the tool solves 3x² = 0 and returns "Root: 0.00 | Type: One Repeated Root". No warning appears in either case, because an empty number field and a typed zero are indistinguishable by the time the formula sees them. Type the zeros in.
The three fields also carry no minimum, no maximum and no required flag, and the form submits with browser validation switched off, so nothing on the page stops an empty box or a coefficient large enough to trip the precision problems above.
What This Solver Does Not Do
It solves one shape of equation and reports the answer. Everything else on this page is arithmetic you do yourself.
- It does not show its working. You get roots and a type line, not the substitution or the discriminant value.
- It does not draw the parabola, name the vertex, or report the y-intercept.
- It does not give exact answers. √2 arrives as 1.41 and a third arrives as −0.33.
- It does not accept an equation typed as text. Rearrange to ax² + bx + c = 0 yourself and enter three separate coefficients.
- It does not factor. A perfect-square discriminant tells you the factors exist; finding them is still your job.
- It does not handle higher degrees. Cubics need a different method, and from degree five upward the Abel–Ruffini theorem rules out any general formula in radicals.
The one cubic that needs no formula at all is x³ = k, settled by a single operation rather than a branch of algebra — for that, use the Cube Root Calculator.