Math Calculators

Quadratic Equation Solver with Graph and Steps


Quadratic Equation Solver with Graph & Downloads

Quadratic Equation Solver with Graph

x2 + x + = 0
ax² + bx + c = 0
Solution Steps
Enter values and click Solve.
Graph Visualization
Graph of y = ax² + bx + c

Quadratic Equation Solver with Graph and Steps — A Gentle, Complete Guide

Imagine you’re solving a problem in algebra class or modeling a real-world curve — the quadratic equation keeps popping up:
ax² + bx + c = 0. You plug in the coefficients and want the answers fast, but you also want to understand them. This guide walks you through everything: what the solver does, why it matters, the formulas, exact step-by-step solving methods, how the graph ties in, common errors, and the handful of facts that make you look confident in class.

I’ve taught and worked with quadratics for decades — here’s a clear, no-nonsense explanation you can use immediately.


What is this?

A quadratic equation is any equation that can be written as:

a x² + b x + c = 0

where a, b, and c are numbers and a ≠ 0.
A Quadratic Equation Solver takes a, b, c and returns:

  • the discriminant D,
  • the two roots (solutions) x₁ and x₂ (real or complex),
  • the vertex and axis of symmetry, and
  • a graph of the parabola y = a x² + b x + c showing roots and vertex.

The Core Formulae

Discriminant:

D = b² − 4ac

Quadratic formula (roots):

x = (-b ± √D) / (2a)

Vertex (point of minimum/maximum):

x_vertex = -b / (2a)

y_vertex = a*(x_vertex)² + b*(x_vertex) + c

Axis of symmetry: x = -b/(2a)

Sum and Product of roots (Vieta):

x₁ + x₂ = -b / a

x₁ * x₂ = c / a


How the solver works

  1. Input validation
    • Check a, b, c are numbers.
    • If a = 0, reduce to a linear equation b x + c = 0 (root x = −c/b if b ≠ 0); otherwise it’s not quadratic.
  2. Compute discriminant
    • D = b² − 4ac.
  3. Decide nature of roots
    • If D > 0: two distinct real roots.
    • If D = 0: one repeated real root (double root).
    • If D < 0: two complex conjugate roots.
  4. Compute roots carefully

If D ≥ 0: √D is real; compute

x₁ = (-b + √D) / (2a)

x₂ = (-b − √D) / (2a)

If D < 0: set √D = i√|D| and compute complex roots:

x₁ = (-b / (2a)) + i (√|D| / (2a))

x₂ = (-b / (2a)) − i (√|D| / (2a))

For numerical stability (when b is large), use the alternative stable method:

q = -0.5 * (b + sign(b) * √D)

x₁ = q / a

x₂ = c / q

  •  This avoids catastrophic cancellation when b and √D nearly cancel.
  1. Compute vertex and y-intercept
    • x_vertex = -b / (2a)
    • y_vertex = f(x_vertex)
    • y_intercept = c (point (0, c))
  2. Prepare graph
    • Plot y = a x² + b x + c.
    • Mark roots and vertex, label axis and intercepts.
    • Choose x-range to comfortably include vertex and roots (for example, center on x_vertex with ± some span).
  3. Output
    • Discriminant, root1, root2, vertex coordinates, axis of symmetry, and a clear parabola graph.

Manual solving — exact step-by-step examples

Example A — Two distinct real roots

Solve x² − 3x + 2 = 0 (a=1, b=−3, c=2)

  1. Compute discriminant:
    • b² = (−3)² = 9
    • 4ac = 4×1×2 = 8
    • D = 9 − 8 = 1
  2. √D = 1
  3. Roots:
    • x₁ = (−b + √D)/(2a) = (−(−3) + 1)/(2×1) = (3 + 1)/2 = 4/2 = 2
    • x₂ = (−b − √D)/(2a) = (3 − 1)/2 = 2/2 = 1
  4. Vertex:
    • x_vertex = −b/(2a) = 3/2 = 1.5
    • y_vertex = f(1.5) = (1.5)² − 3(1.5) + 2 = 2.25 − 4.5 + 2 = −0.25

Graph crosses the x-axis at x = 1 and x = 2, vertex at (1.5, −0.25).


Example B — Repeated root

Solve x² − 4x + 4 = 0 (a=1, b=−4, c=4)

  1. b² = 16, 4ac = 16, so D = 0.
  2. Single root:
    • x = −b/(2a) = 4/2 = 2
    • It’s a double root; graph just touches x-axis at x=2 (vertex on x-axis).

Example C — Complex roots

Solve x² + 1 = 0 (a=1, b=0, c=1)

  1. b² = 0, 4ac = 4, so D = 0 − 4 = −4.
  2. |D| = 4, √|D| = 2.

Roots:

x = (−0 ± i*2)/(2*1) = ± i

  • So x₁ = i, x₂ = −i.

Graph has no x-intercepts; vertex at (0, 1) and opens upward.

Quadratic Equation FAQs

FAQs About Quadratic Equations

The equation is linear: b·x + c = 0. Solve x = −c/b (if b ≠ 0). If b = c = 0, every x is a solution.
Check the discriminant D = b² − 4ac.
  • D > 0 → real and distinct roots
  • D = 0 → real and equal roots
  • D < 0 → complex roots
Yes. If ax² + bx + c factors cleanly (with integers), factoring is faster. But the quadratic formula always works.
xvertex = −b / (2a), yvertex = f(xvertex).
To avoid loss of precision when b is large and √D nearly equals |b|.
Plot the vertex, y-intercept, and a few points around the vertex. Mark the roots (if real). Draw a symmetric curve.
Yes — often they are rational or irrational numbers depending on D.
Complex roots mean the parabola never crosses the x-axis (no real intercepts).
  • a > 0 → parabola opens up (minimum at vertex)
  • a < 0 → parabola opens down (maximum at vertex)
Try factoring, check D for a perfect square, or use the Rational Root Theorem to test rational factors.