Quadratic Formula Calculator
Solve ax² + bx + c = 0 from coefficients or by typing the whole equation. You get the discriminant, exact roots in simplified radical or complex form, decimals to your chosen precision, every solving step, the vertex and parabola properties, equivalent forms, a graph and an independently verified calculation receipt.
- Exact arithmetic
- Full steps
- Complex roots
- Graph
- Independently verified
- Local calculation
Enter the equation
Solving ax² + bx + c = 0. Fractions and decimals both work — type 1/2 or 0.5.
Accepted: whole numbers, decimals such as 0.5 or .5, fractions such as 3/4 and -7/12, and E notation such as 2e3. A fraction is kept exact — it is never converted to a decimal first.
Terms may sit on both sides. x^2 and x² are the same, products such as 3(x + 1)(x - 2) = 0 are expanded for you, and the normalized form is echoed below.
Read as x² − 5x + 6 = 0
Quick examples
Answer
- Discriminant
Δ = b² − 4ac = 1positive → two distinct real roots- Exact roots
- x₁
3x₂2 - Decimal roots
- x₁ exactly
3.000000x₂ exactly2.000000
The parabola opens upward, crosses the x−axis twice, at x = 3 and x = 2, and has its minimum at the vertex (5/2, −1/4) on the axis of symmetry x = 5/2. The y−intercept is (0, 6).
Two distinct real roots. x1 = 3; x2 = 2.
Step-by-step solution
Step 1 Identify the coefficients
x² − 5x + 6 = 0a = 1, b = −5, c = 6.
Step 2 Substitute into the discriminant
Δ = b² − 4ac = (−5)² − 4(1)(6)The discriminant is evaluated on the canonical integer coefficients, so its sign is an exact integer fact rather than a rounding question.
Step 3 Evaluate the discriminant
Δ = 25 − 24 = 1On the coefficients as entered, Δ = 1.
Step 4 Classify the roots from the sign of Δ
Δ > 0A positive discriminant gives two distinct real roots.
Step 5 Substitute into the quadratic formula
x = (−b ± √Δ) / (2a) = (5 ± √1) / 2The formula is applied to the canonical coefficients a = 1, b = −5, c = 6.
Step 6 Simplify the radical
√1 = 1The discriminant is a perfect square, so the roots are rational.
Step 7 Take the + branch
x₁ = (5 + 1) / 2 = 3The plus branch of the ±.
Step 8 Take the − branch
x₂ = (5 − 1) / 2 = 2The minus branch of the ±.
Step 9 State the roots
x = 3 or x = 2Exact form above; decimals are a display rounding of the exact values.
Decimals: 3.000000 and 2.000000
Step 10 Verify by substitution and by Viète’s relations
ax² + bx + c = 0 at each root; x₁ + x₂ = −b/a = 5; x₁x₂ = c/a = 6Every check is exact arithmetic in ℚ(√1) — no decimal tolerance is involved.
Graph
Quadratic properties
- Discriminant
1(positive)- Root type
- Two distinct real roots
- Roots
x₁ = 3·x₂ = 2- Multiplicity
- 1 for each of the two distinct roots
- Vertex
(5/2, −1/4)exactly(2.500000, −0.250000)- Axis of symmetry
x = 5/2- y-intercept
(0, 6)- x-intercepts
3·2- Opening
- upward
- Minimum / maximum
- minimum
−1/4atx = 5/2 - Domain
- all real numbers
(−∞, ∞) - Range
- y ≥ -1/4
[−1/4, ∞) - Sum of roots
−b/a = 5- Product of roots
c/a = 6
Equivalent forms
- Standard form
x² − 5x + 6 = 0- Vertex form
y = (x − 5/2)² − 1/4expands back to the standard coefficients- Factored over the reals
y = (x − 3)(x − 2)expands back to the standard coefficients
Factored over the complex numbers
y = (x − 3)(x − 2) expands back to the standard coefficients
The real factorization is already the complex one: both roots are real.
Viète’s relations
The sum and product of the roots are readable straight off the coefficients, which makes them a fast independent check on any answer.
| Relation | From the roots | From the coefficients | Independent check |
|---|---|---|---|
x₁ + x₂ = −b/a | 3 + 2 | 5 | verified by the independent checker |
x₁ · x₂ = c/a | (3)(2) | 6 | verified by the independent checker |
A tick appears only when the independent verifier confirms the identity in exact arithmetic; a dash means the check did not apply.
Verification and calculation receipt
Show the calculation receipt and every verification check
All applicable checks passed. Engine v1.0.0 · parser v1.0.0 · receipt v1.0.0 · independent verifier v1.0.0.
- a·r₁² + b·r₁ + c = 0 in exact surd arithmetic — passedquadratic.engine.root1-substitution · rational part 0, radical part 0
- a·r₂² + b·r₂ + c = 0 in exact surd arithmetic — passedquadratic.engine.root2-substitution · rational part 0, radical part 0
- r₁ + r₂ = −b/a — passedquadratic.engine.viete-sum · 5 vs 5
- r₁·r₂ = c/a — passedquadratic.engine.viete-product · 6 vs 6
- Δ recomputed from the entered coefficients — passedquadratic.engine.discriminant · 1 vs 1
- Δ recomputed from the canonical coefficients — passedquadratic.engine.canonical-discriminant · 1 vs 1
- The vertex form expands back to the standard coefficients — passedquadratic.engine.vertex-form · y = (x - 5/2)² - 1/4
- The factored form expands back to the standard coefficients — passedquadratic.engine.factored-form · y = (x - 3)(x - 2)
- The vertex lies on the parabola — passedquadratic.engine.vertex-on-curve · f(5/2) = -1/4 vs k = -1/4
- Coefficients re-read from the raw coefficient input match the parse — passedquadratic.parsed-equation · re-read a=1, b=-5, c=6
- The printed normalized equation evaluates to the published coefficients — passedquadratic.normalized-equation · printed "x² - 5x + 6 = 0"
- The canonical coefficients are a positive multiple of the originals with no common factor — passedquadratic.canonical-equivalence · λ = 1, content = 1, integer = true, scales = true
- Δ = b² − 4ac on the entered coefficients, and on the canonical ones — passedquadratic.discriminant · expected Δ = 1, published 1; canonical expected 1, published 1
- The sign of Δ matches the published root classification and root kinds — passedquadratic.root-classification · Δ sign 1 ⇒ two-distinct-real; published "two-distinct-real"
- Substituting root 1 into a·x² + b·x + c returns exactly 0 — passedquadratic.root1-substitution · a·r² + b·r + c = 0 + 0·√1
- Substituting root 2 into a·x² + b·x + c returns exactly 0 — passedquadratic.root2-substitution · a·r² + b·r + c = 0 + 0·√1
- Each printed exact root re-parses to the structured root beside it — passedquadratic.root-text · "3" ✓, "2" ✓
- r₁ + r₂ = −b/a, and equals the published root sum — passedquadratic.viete-sum · r₁ + r₂ = 5 + 0·√1; −b/a = 5; published 5
- r₁ · r₂ = c/a, and equals the published root product — passedquadratic.viete-product · r₁·r₂ = 6 + 0·√1; c/a = 6; published 6
- The vertex x-coordinate equals −b/(2a) — passedquadratic.vertex-x · published 5/2 vs −b/(2a) = 5/2
- The vertex lies on the parabola: f(h) = k — passedquadratic.vertex-on-parabola · f(5/2) = -1/4 vs k = -1/4
Calculation receipt (JSON)
{
"ok": true,
"mode": "coefficients",
"rawInput": {
"a": "1",
"b": "-5",
"c": "6"
},
"normalizedEquation": "x² - 5x + 6 = 0",
"canonicalEquation": "x² - 5x + 6 = 0",
"variable": "x",
"degree": 2,
"originalCoefficients": {
"a": {
"n": "1",
"d": "1",
"text": "1"
},
"b": {
"n": "-5",
"d": "1",
"text": "-5"
},
"c": {
"n": "6",
"d": "1",
"text": "6"
}
},
"canonicalCoefficients": {
"a": {
"n": "1",
"d": "1",
"text": "1"
},
"b": {
"n": "-5",
"d": "1",
"text": "-5"
},
"c": {
"n": "6",
"d": "1",
"text": "6"
},
"multiplier": {
"n": "1",
"d": "1",
"text": "1"
},
"rescaled": false
},
"discriminant": {
"applicable": true,
"formula": "Δ = b² − 4ac",
"value": {
"n": "1",
"d": "1",
"text": "1"
},
"canonicalValue": {
"n": "1",
"d": "1",
"text": "1"
},
"sign": 1,
"classification": "positive",
"rootClassification": "two-distinct-real",
"perfectSquare": true,
"radical": {
"radicand": "1",
"outside": "1",
"inside": "1",
"simplified": true,
"imaginaryUnit": false,
"text": "1"
},
"decimal": "1.000000"
},
"roots": {
"classification": "two-distinct-real",
"count": 2,
"distinct": 2,
"real": true,
"list": [
{
"index": 1,
"branch": "plus",
"kind": "rational",
"multiplicity": 1,
"imaginary": false,
"rationalPart": {
"n": "3",
"d": "1",
"text": "3"
},
"radicalCoefficient": {
"n": "0",
"d": "1",
"text": "0"
},
"radicand": "1",
"simplified": true,
"exact": "3",
"decimal": "3.000000"
},
{
"index": 2,
"branch": "minus",
"kind": "rational",
"multiplicity": 1,
"imaginary": false,
"rationalPart": {
"n": "2",
"d": "1",
"text": "2"
},
"radicalCoefficient": {
"n": "0",
"d": "1",
"text": "0"
},
"radicand": "1",
"simplified": true,
"exact": "2",
"decimal": "2.000000"
}
]
},
"forms": {
"standard": {
"text": "x² - 5x + 6 = 0",
"polynomial": "x² - 5x + 6",
"coefficients": {
"a": {
"n": "1",
"d": "1",
"text": "1"
},
"b": {
"n": "-5",
"d": "1",
"text": "-5"
},
"c": {
"n": "6",
"d": "1",
"text": "6"
}
}
},
"vertex": {
"available": true,
"text": "y = (x - 5/2)² - 1/4",
"h": {
"n": "5",
"d": "2",
"text": "5/2"
},
"k": {
"n": "-1",
"d": "4",
"text": "-1/4"
},
"a": {
"n": "1",
"d": "1",
"text": "1"
},
"expandsTo": {
"a": {
"n": "1",
"d": "1",
"text": "1"
},
"b": {
"n": "-5",
"d": "1",
"text": "-5"
},
"c": {
"n": "6",
"d": "1",
"text": "6"
}
},
"reconstructs": true
},
"factoredReal": {
"available": true,
"text": "y = (x - 3)(x - 2)",
"expandsTo": {
"a": {
"n": "1",
"d": "1",
"text": "1"
},
"b": {
"n": "-5",
"d": "1",
"text": "-5"
},
"c": {
"n": "6",
"d": "1",
"text": "6"
}
},
"reconstructs": true
},
"factoredComplex": {
"available": true,
"note": "The real factorization is already the complex one: both roots are real.",
"text": "y = (x - 3)(x - 2)",
"expandsTo": {
"a": {
"n": "1",
"d": "1",
"text": "1"
},
"b": {
"n": "-5",
"d": "1",
"text": "-5"
},
"c": {
"n": "6",
"d": "1",
"text": "6"
}
},
"reconstructs": true
}
},
"properties": {
"applicable": true,
"vertex": {
"x": {
"n": "5",
"d": "2",
"text": "5/2"
},
"y": {
"n": "-1",
"d": "4",
"text": "-1/4"
},
"text": "(5/2, -1/4)",
"decimal": {
"x": "2.500000",
"y": "-0.250000"
}
},
"axisOfSymmetry": {
"x": {
"n": "5",
"d": "2",
"text": "5/2"
},
"text": "x = 5/2",
"decimal": "2.500000"
},
"yIntercept": {
"value": {
"n": "6",
"d": "1",
"text": "6"
},
"point": "(0, 6)",
"decimal": "6.000000"
},
"xIntercepts": [
{
"exact": "3",
"decimal": "3.000000"
},
{
"exact": "2",
"decimal": "2.000000"
}
],
"xInterceptCount": 2,
"opening": "upward",
"extremum": {
"type": "minimum",
"value": {
"n": "-1",
"d": "4",
"text": "-1/4"
},
"at": {
"n": "5",
"d": "2",
"text": "5/2"
},
"text": "minimum value -1/4 at x = 5/2",
"decimal": "-0.250000"
},
"domain": {
"text": "all real numbers",
"interval": "(−∞, ∞)"
},
"range": {
"text": "y ≥ -1/4",
"interval": "[-1/4, ∞)",
"bound": {
"n": "-1",
"d": "4",
"text": "-1/4"
},
"decimal": "-0.250000"
},
"rootSum": {
"value": {
"n": "5",
"d": "1",
"text": "5"
},
"text": "−b/a = 5",
"decimal": "5.000000"
},
"rootProduct": {
"value": {
"n": "6",
"d": "1",
"text": "6"
},
"text": "c/a = 6",
"decimal": "6.000000"
}
},
"steps": [
{
"n": 1,
"id": "step-1-identify-coefficients",
"kind": "identify-coefficients",
"title": "Identify the coefficients",
"expression": "x² - 5x + 6 = 0",
"detail": "a = 1, b = -5, c = 6.",
"values": {
"a": {
"n": "1",
"d": "1",
"text": "1"
},
"b": {
"n": "-5",
"d": "1",
"text": "-5"
},
"c": {
"n": "6",
"d": "1",
"text": "6"
}
}
},
{
"n": 2,
"id": "step-2-discriminant-substitution",
"kind": "discriminant-substitution",
"title": "Substitute into the discriminant",
"expression": "Δ = b² − 4ac = (-5)² − 4(1)(6)",
"detail": "The discriminant is evaluated on the canonical integer coefficients, so its sign is an exact integer fact rather than a rounding question.",
"values": {
"a": {
"n": "1",
"d": "1",
"text": "1"
},
"b": {
"n": "-5",
"d": "1",
"text": "-5"
},
"c": {
"n": "6",
"d": "1",
"text": "6"
}
}
},
{
"n": 3,
"id": "step-3-discriminant-arithmetic",
"kind": "discriminant-arithmetic",
"title": "Evaluate the discriminant",
"expression": "Δ = 25 − 24 = 1",
"detail": "On the coefficients as entered, Δ = 1.",
"values": {
"canonical": {
"n": "1",
"d": "1",
"text": "1"
},
"original": {
"n": "1",
"d": "1",
"text": "1"
}
}
},
{
"n": 4,
"id": "step-4-classification",
"kind": "classification",
"title": "Classify the roots from the sign of Δ",
"expression": "Δ > 0",
"detail": "A positive discriminant gives two distinct real roots.",
"values": {
"sign": 1,
"classification": "positive",
"roots": "two-distinct-real"
}
},
{
"n": 5,
"id": "step-5-formula-substitution",
"kind": "formula-substitution",
"title": "Substitute into the quadratic formula",
"expression": "x = (−b ± √Δ) / (2a) = (5 ± √1) / 2",
"detail": "The formula is applied to the canonical coefficients a = 1, b = -5, c = 6.",
"values": {
"minusB": {
"n": "5",
"d": "1",
"text": "5"
},
"twoA": {
"n": "2",
"d": "1",
"text": "2"
},
"discriminant": {
"n": "1",
"d": "1",
"text": "1"
}
}
},
{
"n": 6,
"id": "step-6-radical-simplification",
"kind": "radical-simplification",
"title": "Simplify the radical",
"expression": "√1 = 1",
"detail": "The discriminant is a perfect square, so the roots are rational.",
"values": {
"radicand": "1",
"outside": "1",
"inside": "1",
"simplified": true,
"imaginaryUnit": false
}
},
{
"n": 7,
"id": "step-7-branch-plus",
"kind": "branch-plus",
"title": "Take the + branch",
"expression": "x₁ = (5 + 1) / 2 = 3",
"detail": "The plus branch of the ±.",
"values": {
"root": "3"
}
},
{
"n": 8,
"id": "step-8-branch-minus",
"kind": "branch-minus",
"title": "Take the − branch",
"expression": "x₂ = (5 − 1) / 2 = 2",
"detail": "The minus branch of the ±.",
"values": {
"root": "2"
}
},
{
"n": 9,
"id": "step-9-final-roots",
"kind": "final-roots",
"title": "State the roots",
"expression": "x = 3 or x = 2",
"detail": "Exact form above; decimals are a display rounding of the exact values.",
"values": {
"root1": "3",
"root2": "2"
},
"decimal": {
"root1": "3.000000",
"root2": "2.000000"
}
},
{
"n": 10,
"id": "step-10-verification",
"kind": "verification",
"title": "Verify by substitution and by Viète’s relations",
"expression": "ax² + bx + c = 0 at each root; x₁ + x₂ = −b/a = 5; x₁x₂ = c/a = 6",
"detail": "Every check is exact arithmetic in ℚ(√1) — no decimal tolerance is involved.",
"values": {
"passed": true,
"checks": 9
}
}
],
"verification": {
"passed": true,
"checks": [
{
"id": "quadratic.engine.root1-substitution",
"label": "a·r₁² + b·r₁ + c = 0 in exact surd arithmetic",
"applicable": true,
"passed": true,
"detail": "rational part 0, radical part 0"
},
{
"id": "quadratic.engine.root2-substitution",
"label": "a·r₂² + b·r₂ + c = 0 in exact surd arithmetic",
"applicable": true,
"passed": true,
"detail": "rational part 0, radical part 0"
},
{
"id": "quadratic.engine.viete-sum",
"label": "r₁ + r₂ = −b/a",
"applicable": true,
"passed": true,
"detail": "5 vs 5"
},
{
"id": "quadratic.engine.viete-product",
"label": "r₁·r₂ = c/a",
"applicable": true,
"passed": true,
"detail": "6 vs 6"
},
{
"id": "quadratic.engine.discriminant",
"label": "Δ recomputed from the entered coefficients",
"applicable": true,
"passed": true,
"detail": "1 vs 1"
},
{
"id": "quadratic.engine.canonical-discriminant",
"label": "Δ recomputed from the canonical coefficients",
"applicable": true,
"passed": true,
"detail": "1 vs 1"
},
{
"id": "quadratic.engine.vertex-form",
"label": "The vertex form expands back to the standard coefficients",
"applicable": true,
"passed": true,
"detail": "y = (x - 5/2)² - 1/4"
},
{
"id": "quadratic.engine.factored-form",
"label": "The factored form expands back to the standard coefficients",
"applicable": true,
"passed": true,
"detail": "y = (x - 3)(x - 2)"
},
{
"id": "quadratic.engine.vertex-on-curve",
"label": "The vertex lies on the parabola",
"applicable": true,
"passed": true,
"detail": "f(5/2) = -1/4 vs k = -1/4"
},
{
"id": "quadratic.parsed-equation",
"label": "Coefficients re-read from the raw coefficient input match the parse",
"applicable": true,
"passed": true,
"detail": "re-read a=1, b=-5, c=6"
},
{
"id": "quadratic.normalized-equation",
"label": "The printed normalized equation evaluates to the published coefficients",
"applicable": true,
"passed": true,
"detail": "printed \"x² - 5x + 6 = 0\""
},
{
"id": "quadratic.canonical-equivalence",
"label": "The canonical coefficients are a positive multiple of the originals with no common factor",
"applicable": true,
"passed": true,
"detail": "λ = 1, content = 1, integer = true, scales = true"
},
{
"id": "quadratic.discriminant",
"label": "Δ = b² − 4ac on the entered coefficients, and on the canonical ones",
"applicable": true,
"passed": true,
"detail": "expected Δ = 1, published 1; canonical expected 1, published 1"
},
{
"id": "quadratic.root-classification",
"label": "The sign of Δ matches the published root classification and root kinds",
"applicable": true,
"passed": true,
"detail": "Δ sign 1 ⇒ two-distinct-real; published \"two-distinct-real\""
},
{
"id": "quadratic.root1-substitution",
"label": "Substituting root 1 into a·x² + b·x + c returns exactly 0",
"applicable": true,
"passed": true,
"detail": "a·r² + b·r + c = 0 + 0·√1"
},
{
"id": "quadratic.root2-substitution",
"label": "Substituting root 2 into a·x² + b·x + c returns exactly 0",
"applicable": true,
"passed": true,
"detail": "a·r² + b·r + c = 0 + 0·√1"
},
{
"id": "quadratic.root-text",
"label": "Each printed exact root re-parses to the structured root beside it",
"applicable": true,
"passed": true,
"detail": "\"3\" ✓, \"2\" ✓"
},
{
"id": "quadratic.viete-sum",
"label": "r₁ + r₂ = −b/a, and equals the published root sum",
"applicable": true,
"passed": true,
"detail": "r₁ + r₂ = 5 + 0·√1; −b/a = 5; published 5"
},
{
"id": "quadratic.viete-product",
"label": "r₁ · r₂ = c/a, and equals the published root product",
"applicable": true,
"passed": true,
"detail": "r₁·r₂ = 6 + 0·√1; c/a = 6; published 6"
},
{
"id": "quadratic.vertex-x",
"label": "The vertex x-coordinate equals −b/(2a)",
"applicable": true,
"passed": true,
"detail": "published 5/2 vs −b/(2a) = 5/2"
},
{
"id": "quadratic.vertex-on-parabola",
"label": "The vertex lies on the parabola: f(h) = k",
"applicable": true,
"passed": true,
"detail": "f(5/2) = -1/4 vs k = -1/4"
}
],
"method": "exact arithmetic in ℚ and ℚ(√m); no floating-point tolerance",
"independentAvailable": true,
"independentPassed": true,
"verifierVersion": "1.0.0"
},
"precision": {
"decimalPlaces": 6,
"guardDigits": 12,
"displayOnly": true,
"note": "Decimal places affect only fields named \"decimal\". The discriminant, exact roots, forms, properties and verification are exact and precision-independent. Decimals are produced by exact integer square roots carried 12 digits beyond the requested precision, never by a floating-point square root."
},
"warnings": [],
"errorCode": null,
"errorMessage": null,
"hint": null,
"parserVersion": "1.0.0",
"engineVersion": "1.0.0",
"receiptVersion": "1.0.0"
}Solving quadratic equations — the complete guide
- What it is
- How to use
- The discriminant
- How it works
- Exact vs decimal
- Roots and the graph
- Which method
- Common mistakes
- Worked examples
- FAQ
What is the quadratic formula?
A quadratic equation is any equation that can be rearranged into the standard form ax² + bx + c = 0 with a ≠ 0. The quadratic formula solves every one of them:
x = (−b ± √(b² − 4ac)) / (2a)
Three things make the formula worth memorizing. It is complete: unlike factoring, it never fails, whatever the coefficients. It is uniform: the same three numbers go in the same three places every time, so there is no case analysis to remember first. And it carries its own diagnosis, because the quantity under the square root — the discriminant b² − 4ac — tells you what kind of answer to expect before you finish computing it.
The ± is not decoration. A quadratic has exactly two roots when counted with multiplicity, and the ± is where both come from: the plus branch and the minus branch of the same expression. When the discriminant is zero the two branches collide and the equation has one root of multiplicity two; when it is negative the branches separate into a conjugate pair of complex numbers. The formula never returns "no answer" — it returns an answer that may not be a real number.
The requirement a ≠ 0 is not a technicality either. With a = 0 the denominator 2a is zero and the formula is undefined, which is exactly right: without an x² term the equation is linear and has one solution, not two. This calculator detects that case and solves the linear equation instead of pretending the quadratic formula applied.
How to use the calculator
There are two ways in, and they produce identical mathematics. Coefficient mode takes a, b and c separately — the fastest route when your equation is already in standard form. The fields accept whole numbers, decimals and fractions: 1/2 and 0.5 are read as the same exact number, and a fraction is never converted to a decimal on the way in, so nothing is lost before the arithmetic starts.
Equation mode takes the whole equation as you have it written. Terms can sit on both sides (2x² + 5x = 3), the leading coefficient can be implicit or negative (-x² + 4 = 0), x^2 and x² mean the same thing, and a factored input such as 3(x + 1)(x - 2) = 0 is expanded for you. Underneath the input the calculator echoes the normalized form it derived — always ax² + bx + c = 0 — so you can confirm at a glance that it read your equation the way you meant it. That echo is the single most useful habit on this page: if the normalized form is wrong, everything downstream is answering a different question.
Switching between the two modes keeps your work. Going from coefficients to equation writes the normalized equation into the text field; going the other way fills a, b and c from the parsed equation. The conversion only happens when it is unambiguous, so you never lose an input to a silent rewrite.
The decimal places control changes presentation and nothing else. Move it from 4 to 15 and the decimals lengthen, but the discriminant, the exact roots, the equivalent forms, the properties and every verification check stay byte-for-byte identical — they were computed exactly and were never rounded in the first place.
What the discriminant tells you
The discriminant is Δ = b² − 4ac, and its sign classifies the roots completely:
| Discriminant | Roots | Graph | Example |
|---|---|---|---|
| Δ > 0 | Two distinct real roots | Crosses the x-axis twice | x² − 5x + 6 = 0, Δ = 1 |
| Δ = 0 | One repeated real root (multiplicity 2) | Touches the x-axis at the vertex | x² − 4x + 4 = 0, Δ = 0 |
| Δ < 0 | Two complex-conjugate roots | Never meets the x-axis | x² + 2x + 5 = 0, Δ = −16 |
A second, less-quoted fact is useful in exams: when a, b and c are integers and Δ is a perfect square, the roots are rational and the quadratic factors over the integers. Δ = 1 for x² − 5x + 6 is a perfect square, and sure enough the equation factors as (x − 2)(x − 3). Δ = 32 for x² − 6x + 1 is not, so no integer factorization exists and the roots carry a radical: 3 ± 2√2.
The discriminant is also where floating-point calculators quietly go wrong. Computing b² − 4ac in binary floating point can land a hair either side of zero when the true value is exactly zero — turning a repeated root into two nearly-equal roots, or into a complex pair. This calculator evaluates Δ in exact integer arithmetic after clearing denominators, so the classification is an integer fact. Coefficients 0.1, 0.2 and 0.1 give exactly Δ = 0 here, and exactly one repeated root.
How the quadratic formula works
The formula is not an arbitrary rule to memorize; it is what you get when you complete the square on the general equation once, so nobody has to do it again. Here is the derivation in full.
- Start from the general equation, with
a ≠ 0:ax² + bx + c = 0. - Divide through by a, which is legal precisely because a is not zero:
x² + (b/a)x + c/a = 0. - Move the constant to the right:
x² + (b/a)x = −c/a. - Complete the square. Half of the x-coefficient is
b/(2a); add its square to both sides:x² + (b/a)x + b²/(4a²) = −c/a + b²/(4a²). - The left side is now a perfect square, and the right side goes over the common denominator 4a²:
(x + b/(2a))² = (b² − 4ac) / (4a²). The discriminant has appeared on its own, which is why it governs everything that follows. - Take the square root of both sides, keeping both signs:
x + b/(2a) = ± √(b² − 4ac) / (2a). - Subtract
b/(2a)and combine over one denominator:x = (−b ± √(b² − 4ac)) / (2a).
Step 5 is the one worth remembering. It says every quadratic is a shifted, scaled version of y = x²: the vertex sits at x = −b/(2a), and the roots are that vertex position plus and minus the same distance, √Δ/(2a). That symmetry is why the two roots always average to the vertex x-coordinate, and why a zero discriminant means the two roots have collapsed onto the vertex itself.
This calculator follows the derivation literally rather than numerically. It clears denominators to get integer coefficients, evaluates Δ exactly, extracts the largest square factor from the radical (so √32 becomes 4√2 rather than 5.656854…), and only then divides by 2a — which is how (6 ± √32)/2 is published as 3 ± 2√2 instead of a decimal that has already lost the structure.
Exact roots vs decimal roots
An exact root is the number itself: 3 + 2√2, 5/2, −1 + 2i. A decimal root is that number written to a chosen number of places for reading: 5.828427, 2.5, −1.000000 + 2.000000i. The first is a value; the second is a rendering of it.
The distinction matters more than it looks. 3 + 2√2 squared minus six times itself plus one is exactly zero; 5.828427 substituted back gives roughly −0.0000005, which is not zero and never will be. Any downstream calculation that reuses the decimal inherits that error, and the error compounds. It also matters for recognition: 3 ± 2√2 is visibly a conjugate pair with sum 6 and product 1, while the decimals hide both facts.
This page keeps the two strictly apart. Exact values are computed with arbitrary-precision rational and radical arithmetic and are never rounded internally. Decimals are produced afterwards, from exact integer square roots carried twelve digits beyond the precision you asked for, so the last displayed digit is trustworthy. Where a decimal cannot state a value exactly, it is marked with ≈; where it can — an integer root, or a fraction such as 5/2 whose denominator is built only from 2s and 5s — it is marked with =. A rounded value is never presented as an exact one.
Quadratic roots and the graph
The roots of ax² + bx + c = 0 are exactly the x-intercepts of the parabola y = ax² + bx + c. Solving the equation and reading the graph are the same act performed two ways, which is why the graph on this page is worth a glance even when you only wanted the numbers.
Four features carry most of the information. The opening direction is the sign of a: upward for a > 0, downward for a < 0. The vertex sits at x = −b/(2a) and is a minimum when the parabola opens upward, a maximum when it opens downward — which is also what fixes the range: y ≥ k or y ≤ k, where k is the vertex height. The axis of symmetry is the vertical line through the vertex, and the two roots are mirror images across it. The y-intercept is just c, because setting x = 0 leaves the constant term alone.
Reading the discriminant off the picture is then immediate: two crossings means Δ > 0, a single tangential touch means Δ = 0, and a curve floating clear of the axis means Δ < 0. The last case is the one worth sitting with — a parabola entirely above the x-axis still has two roots; they simply live in the complex plane, where the graph cannot show them. This calculator draws the parabola in that case anyway, and states in words that it does not meet the axis, rather than leaving a blank panel that looks like a failure.
The graph is a visual aid, not the source of truth. It reads the published result and never feeds anything back into the algebra, so if the coefficients place the curve outside a representable scale, the graph steps aside with a notice and the roots, the receipt and the verification are unaffected.
Factoring vs the quadratic formula vs completing the square
Three methods solve the same equations, and choosing well saves real time.
| Method | Best when | Cost | Gives you |
|---|---|---|---|
| Factoring | Δ is a perfect square and the numbers are small | Fastest when it works; wasted effort when it does not | Roots, and the factored form directly |
| Quadratic formula | Always — especially fractions, irrational or complex roots | One substitution, no searching | Roots and the discriminant classification |
| Completing the square | You need the vertex form, or you are deriving the formula | Slowest by hand | Vertex form a(x − h)² + k, so vertex and range fall out |
The practical rule: try to factor for ten seconds only when a = 1 and the constant term has obvious factor pairs that add to b. For x² − 5x + 6, the pair (−2, −3) multiplies to 6 and adds to −5 — done, in less time than substituting into the formula. If that inspection does not land almost immediately, switch to the formula rather than hunting; a non-perfect-square discriminant means no integer factorization exists and the hunt cannot succeed.
Completing the square is not a rival so much as the parent method. Use it when the question asks for the vertex, the maximum or minimum, or the range — it produces those directly, whereas the formula produces the roots and leaves you to compute the vertex separately. This calculator gives you both at once: the roots from the formula, and the vertex form from completing the square on the same coefficients.
Common quadratic formula mistakes
| Mistake | Wrong | Correct |
|---|---|---|
| Losing the sign of b | For x² − 5x + 6, using −b = −5 ✗ | b = −5, so −b = +5 ✓ — the sign belongs to the coefficient. Substitute b in brackets: −(−5). |
| Squaring a negative b wrongly | b = −5 ⇒ b² = −25 ✗ | b² = (−5)² = 25 ✓ — a square is never negative. This single slip flips the discriminant's sign more often than any other. |
| Dividing only part of the numerator | x = −b ± √Δ / (2a) ✗ | x = (−b ± √Δ) / (2a) ✓ — the whole numerator is divided by 2a, not just the radical. |
| Forgetting to rearrange first | 2x² + 5x = 3 with c = 3 ✗ | Move everything across: 2x² + 5x − 3 = 0, so c = −3 ✓ — the formula assumes the equation is already equal to zero. |
| Calling a negative discriminant "no solution" | Δ = −16 ⇒ no roots ✗ | Two complex roots, −1 ± 2i ✓ — there are no real roots; the equation still has two solutions. |
| Leaving the radical unsimplified | x = (6 ± √32)/2 as a final answer ✗ | x = 3 ± 2√2 ✓ — √32 = 4√2, and the 2 in the denominator then cancels. |
| Using the formula when a = 0 | 0x² + 2x − 4 = 0 through the formula ✗ | Linear: x = −c/b = 2 ✓ — with a = 0 the formula divides by zero and does not apply. |
Worked examples
Every number in these five examples is produced by the same engine that answers the calculator above — not typed by hand — so an editorial slip cannot survive the build. Each one loads into the calculator with a single click.
Integer roots: x² − 5x + 6 = 0
- Discriminant
1— positive- Exact roots
- x₁
3= 3.000000x₂2= 2.000000 - Vertex
(5/2, −1/4)- Factored form
y = (x − 3)(x − 2)
Repeated root: x² − 4x + 4 = 0
- Discriminant
0— zero- Exact roots
- x₁
2= 2.000000x₂2= 2.000000 - Vertex
(2, 0)- Factored form
y = (x − 2)²
Irrational roots: x² − 6x + 1 = 0
- Discriminant
32— positive- Exact roots
- x₁
3 + 2√2≈ 5.828427x₂3 − 2√2≈ 0.171573 - Vertex
(3, −8)- Factored form
y = (x − (3 + 2√2))(x − (3 − 2√2))
Complex roots: x² + 2x + 5 = 0
- Discriminant
−16— negative- Exact roots
- x₁
−1 + 2i= −1.000000 ± 2.000000ix₂−1 − 2i= −1.000000 ± 2.000000i - Vertex
(−1, 4)- Factored form
- Δ < 0: the polynomial is irreducible over the real numbers.
Fraction coefficients: ½x² − 1½x + 1 = 0
- Discriminant
1/4— positive- Exact roots
- x₁
2= 2.000000x₂1= 1.000000 - Vertex
(3/2, −1/8)- Factored form
y = 1/2(x − 2)(x − 1)
Frequently asked questions
What is the quadratic formula?
For ax² + bx + c = 0 with a ≠ 0, the solutions are x = (−b ± √(b² − 4ac)) / (2a). The ± sign produces the two roots, and the quantity under the square root, b² − 4ac, is the discriminant that decides what kind of roots you get.
How do I solve a quadratic equation with this calculator?
Either type a, b and c into the coefficient fields, or switch to Equation mode and paste the equation as you have it written — "2x² + 5x = 3", "(x − 2)(x − 3) = 0" or "x² − 5x + 6 = 0" all work. The answer, the steps, the properties and the graph update immediately, and nothing is sent anywhere: the calculation runs in your browser.
What does the discriminant tell you?
The sign of Δ = b² − 4ac classifies the roots before you finish solving. Δ > 0 gives two distinct real roots and a parabola that crosses the x-axis twice; Δ = 0 gives one repeated real root and a parabola tangent to the x-axis; Δ < 0 gives a complex-conjugate pair and a parabola that never touches the x-axis. This calculator computes Δ in exact integer arithmetic, so the classification cannot be flipped by rounding.
What happens when the discriminant is negative?
Nothing breaks — the equation still has two solutions, they are just not real numbers. √(−16) = 4i, so x² + 2x + 5 = 0 gives x = (−2 ± 4i)/2 = −1 ± 2i. The calculator shows this as an ordinary result, not an error, and draws the parabola so you can see that it stays clear of the x-axis.
How are complex roots written?
As a conjugate pair p ± qi, where p = −b/(2a) and q = √(−Δ)/(2a). When the imaginary part carries a radical it is kept exact, for example (−1 ± i√3)/2 for x² + x + 1 = 0. The two roots always have the same real part and opposite imaginary parts, which is why their sum is real.
Can I enter fractions or decimals as coefficients?
Yes, and they are treated as exactly the same number. Type 1/2 or 0.5 for a and you get identical exact results; the calculator clears denominators internally so ½x² − 1½x + 1 = 0 is solved as x² − 3x + 2 = 0, with roots 2 and 1. Fractions are never converted to floating point first.
Can I paste the whole equation instead of coefficients?
Yes. Equation mode accepts x^2 or x², terms on both sides of the equals sign, a leading minus, fractional or decimal coefficients, and factored input such as 3(x + 1)(x − 2) = 0. The normalized form ax² + bx + c = 0 is shown under the input so you can confirm the calculator read your equation the way you meant it.
What if a = 0?
Then there is no x² term, 2a = 0, and the quadratic formula does not apply — dividing by zero is exactly what it would do. The calculator says so and solves the lower-degree case instead: bx + c = 0 has the single solution x = −c/b, while a = b = 0 is either an identity with infinitely many solutions (c = 0) or a contradiction with none (c ≠ 0).
How do I find the vertex of a quadratic?
The vertex sits on the axis of symmetry at x = −b/(2a), and its y-coordinate is the value of the quadratic there. For x² − 5x + 6 the vertex is at (5/2, −1/4) — kept as exact fractions here, not as 2.5 and −0.25. It is a minimum when a > 0 and a maximum when a < 0.
How do the roots relate to the graph?
The real roots are exactly the x-intercepts of y = ax² + bx + c. Two distinct real roots means two crossings, a repeated root means the parabola touches the axis once at its vertex, and a complex pair means it never reaches the axis. The roots are always symmetric about the axis of symmetry, so their midpoint is the vertex x-coordinate.
Should I factor or use the quadratic formula?
Factor when the roots are obviously rational and small — x² − 5x + 6 = (x − 2)(x − 3) is faster by inspection. Use the formula when factoring is not obvious, when the coefficients are fractions, or when the roots are irrational or complex, because the formula always works. Completing the square is the method the formula is derived from, and it is what you want when you need the vertex form.
What is the difference between exact and decimal roots?
An exact root is the value itself — 3 + 2√2, or 5/2 — while a decimal root is that value rounded for reading, 5.828427 at six places. Irrational and repeating values have no finite decimal, so their decimals are marked with ≈. Changing the precision control here changes only the decimals; the discriminant, the exact roots, the forms and the verification are unaffected.
How is the answer verified?
Every result is re-checked live by a second implementation that shares no code with the solver. It recovers the coefficients from your equation by evaluating it at sample points, re-parses the printed roots with its own reader, substitutes them back in exact arithmetic, and confirms the discriminant, the classification, Viète's sum and product and the vertex. What was checked — and anything that could not be checked — is listed in the calculation receipt.
Are my numbers sent anywhere?
No. The whole engine and the whole verifier run in your browser; there is no calculation API, no analytics of your inputs and nothing stored. The shareable link encodes your coefficients or your equation in the URL only when you choose to copy it.
When to use a different calculator
Methodology, assumptions, limits and review status
Coefficients are held as exact BigInt rationals {n, d} with d > 0 and gcd(|n|, d) = 1 — never as binary floating point — so 1/2 and 0.5 are the same number and no coefficient is lossy before the formula runs. Typed equations are read by a dedicated tokenizer and recursive-descent parser (no eval, no Function constructor) that expands products, moves the right-hand side across and normalizes to ax² + bx + c = 0; anything that is not a one-variable polynomial of degree ≤ 2 is refused with a specific error code rather than approximated. The equation is canonicalized by clearing denominators and removing the common integer factor while preserving the sign of a, so the discriminant Δ = b² − 4ac is an exact integer and its classification into two distinct real roots, one repeated real root or a complex-conjugate pair is an integer fact rather than a floating-point comparison. Roots are produced in exact symbolic form p ± q√m (or p ± q·i√m), with the largest square factor pulled out of the radical inside a declared trial-division budget; beyond that budget the result stays exact but is explicitly labelled as not fully simplified. Decimal places are a display transformation only: the digits come from exact integer square roots carried twelve places beyond the requested precision, so changing the precision control never changes the discriminant, the exact roots, the equivalent forms or the verification. Every result carries a deterministic calculation receipt whose verification is re-derived by a second, independent implementation that shares no code with the engine — it recovers the coefficients from the equation by sampling and finite differences, re-parses the printed roots with its own reader, and substitutes them back in its own exact surd arithmetic.
Exact and approximate, kept apart: coefficients, the discriminant, the roots, the vertex, the equivalent forms and Viète’s relations are exact. Decimal output is a rounded rendering of an exact value, marked with ≈ whenever the decimal cannot state the value exactly and with = when it can. Changing the decimal-places control never changes an exact quantity.
Assumptions:
- The variable is a single letter; x is assumed when none is typed. Two different letters are treated as a two-variable equation and refused.
- A number is read with English conventions: a point is the decimal separator and a comma is never a decimal separator or a thousands group inside a coefficient.
- Implicit multiplication binds left to right, so 1/2x² means (1/2)·x², not 1/(2x²). Adjacent numerals such as "2 3" are refused instead of being multiplied.
- Root 1 is always the plus branch of the ±, (−b + √Δ)/(2a), and root 2 the minus branch; when a < 0 the plus branch is therefore the smaller number.
- Canonicalization multiplies the equation by a positive rational only, so the sign of a — and with it the opening direction, the vertex value and the range — is preserved.
- Vertex, axis, intercepts, root sum and root product describe the equation as entered, not the rescaled integer twin.
- Decimal output is rounded half-up away from zero and is a display of the exact value, never the value itself.
Limitations:
- Degree is capped at 2. A cubic or higher equation, a term that divides by the variable, a function call such as sin(x), a fractional or negative exponent, a second variable or a second equals sign each return a specific structured error instead of an approximate answer.
- Equation text is capped at 2,000 characters and coefficients at 200 digits of numerator plus denominator; past those limits the calculator refuses rather than truncating.
- Radical simplification uses a declared trial-division budget (200,000 divisors, radicands up to 40 digits). Beyond it the roots stay exact but are marked as not fully simplified — they are never labelled simplified on the strength of a partial factorization.
- The graph is a visual aid only. When the coefficients put the curve outside a representable numerical scale the graph is withheld with a notice, and the algebraic result, the receipt and the verification are unaffected.
- Simultaneous equations, inequalities, complex coefficients and parameterized coefficients are out of scope and belong to other tools.
Engine: quadratic-engine v1.0.0 · Parser: v1.0.0 · Receipt: v1.0.0 · Independent verifier: v1.0.0 · Author: Ugo Candido · Last updated: . Calculations run locally in your browser — your numbers are never sent to a calculation API, and nothing is stored.
External review status: No independent third-party mathematical review. Correctness is enforced by exact rational and integer arithmetic, hand-written reference vectors whose expected values were never generated by the code under test, and live re-verification of every result by a second implementation that shares no code with the engine.