ForHosting KIT · Math

Quadratic formula solver

Plug in a, b and c and get the roots straight from the formula: x² − 3x + 2 has discriminant 1 and roots 2 and 1, with the parabola's vertex at (1.5, −0.25). Free in your browser.

  • Free
  • Runs in your browser
  • No sign-up
  • Your data stays on your device
Use it from WebAPIEmailTelegramApp soon
If you enter
A
1
B
-3
C
2
You get
Equation
1*x^2 + -3*x + 2 = 0
Discriminant
1
Root type
two_real

The quadratic formula is the standard closed-form solution for any equation of the form a times x squared plus b times x plus c equals zero when a is not zero. Given three finite coefficients, this solver computes the discriminant D equals b squared minus four a c, returns the two roots as complex numbers with real and imaginary parts, and reports the vertex of the related parabola. When D is positive you get two distinct real roots; when D is zero you get a repeated real root; when D is negative you get a conjugate complex pair. The same response always includes the vertex at x equals negative b over two a so graphing and completing-the-square homework stay aligned with the algebraic answer. Invalid or non-quadratic input—especially a equal to zero—is rejected with a clear validation error rather than a silent wrong linear solution.

How the quadratic formula, discriminant, and vertex work

Start from the general second-degree polynomial equation a x squared plus b x plus c equals zero with a nonzero. Completing the square or deriving from the vertex form both lead to the same closed expression: x equals negative b plus or minus the square root of b squared minus four a c, all divided by two a. The quantity under the radical is the discriminant D equals b squared minus four a c.

Its sign completely classifies the solution set over the complex numbers: D greater than zero yields two distinct real roots, D equal to zero yields one real root of multiplicity two, and D less than zero yields two non-real complex conjugates whose real part is negative b over two a and whose imaginary parts are plus or minus the square root of the absolute value of D over two a.

This implementation never invents approximate symbolic factors; it evaluates the formula with careful floating-point pairing so that when one root would suffer cancellation for large absolute b, the second root is recovered from Vieta product identities whenever that path is stable. Parallel to the roots, the related parabola y equals a x squared plus b x plus c has its unique extremum at the vertex x equals negative b over two a, with y equal to the function value at that abscissa.

That vertex is always returned so students can plot the axis of symmetry, find the minimum or maximum value, and cross-check completing-the-square steps without a second tool. Coefficients must be finite numbers; infinity and NaN are rejected. The special case a approximately zero is rejected with invalid input because the formula would divide by zero and the problem would no longer be quadratic.

What you send and what you get back

Send three finite numbers under the fields a, b, and c representing the coefficients of a x squared plus b x plus c equals zero. All three fields are required. For real solutions im is zero; for complex solutions the pair is conjugate with equal real parts and opposite imaginary parts.

The vertex object always provides x and y for the parabola extremum. A formula field restates the classical expression for UI labels and documentation. Classic textbook checks: a equals one, b equals negative three, c equals two yields roots two and one with discriminant one and vertex at one point five, negative one quarter; a equals one, b equals negative two, c equals one yields a repeated root at one; a equals one, b equals zero, c equals one yields the pure imaginary pair plus or minus i.

Where quadratic solvers show up in real work

Secondary-school and college algebra courses constantly assign solve-by-formula drills, discriminant classification tables, and graph-the-parabola labs; a single trusted oracle that returns roots and vertex together speeds grading and demo setup. Programming contest problems and interview warm-ups often hide a quadratic under physics kinematics, projectile range, or break-even revenue models, and engineers need exact classification of real versus complex outcomes rather than a silent NaN from an unchecked square root.

Data and finance notebooks solve for break-even points of quadratic cost or demand curves and must refuse a equals zero rather than mislabel a linear case as quadratic. Graphics and game engines sample parabolic arcs and need the vertex for apex height while still exposing closed-form roots for collision-time equations of the form a t squared plus b t plus c equals zero.

If you later need cubic or quartic closed forms, systems of two equations, or symbolic factoring over the integers, treat those as separate search intents and landings rather than overloading this quadratic-formula solver page.

Homework and exam answer keys

Generate exact roots, discriminant class, and vertex coordinates for textbook ax²+bx+c sets so teachers and auto-graders share one ground truth.

What formula does this quadratic solver use?

The classical quadratic formula x = (−b ± √(b² − 4ac)) / (2a). The discriminant D = b² − 4ac selects two real roots, one repeated real root, or a complex conjugate pair.

Does it return complex roots?

Yes. When D < 0 the roots array holds two objects with the same re and opposite im values (a conjugate pair). When roots are real, im is zero.

What is the vertex field?

For the parabola y = ax² + bx + c, vertex.x is −b/(2a) and vertex.y is the function value at that x. It is the minimum when a > 0 and the maximum when a < 0.

What does it cost?

The browser tool is free and runs locally.

How are roots kept accurate when b is very large?

When one root would lose digits because two nearly equal numbers are subtracted, the second root is recovered from the product of the roots, c/a, whenever that path is stable. Both roots stay reliable that way.

Everything on this page is available programmatically. This section is for teams who want to wire it into their own systems; everyone else can just use the tool above.

POSThttps://api.kit.forhosting.com/algebra/quadratic-formula

Prefer to automate it? One authenticated POST creates the task; the result comes back by webhook or a signed link. The same capability also runs here on the web, by email and from Telegram — and soon from our app too.

curl -X POST https://api.kit.forhosting.com/algebra/quadratic-formula \
  -H "Authorization: Bearer $KIT_KEY" \
  -H "Content-Type: application/json" \
  -d '{"a":1,"b":-3,"c":2}'
{
  "a": 1,
  "b": -3,
  "c": 2
}
{
  "task_id": "tsk_a1b2c3d4e5f6a1b2c3d4e5f6",
  "type": "algebra.quadratic_formula",
  "status": "queued",
  "_links": {
    "result": "/tasks/tsk_…/result"
  }
}

The API is asynchronous: the call returns a task_id immediately and the result arrives by webhook. Polling is capped at 1 req/s per task.

Per request$0.002

Published price — no tokens, no invented credits. A failed task is never charged.

HTTPCodeMeaning
401unauthorizedMissing or invalid API key.
402insufficient_balanceYour balance doesn't cover the task price.
404unknown_typeThat task type doesn't exist.
429rate_limitedToo many requests. Use the webhook instead of polling.

How the quadratic formula, discriminant, and vertex work

The entire path is deterministic—no random seeds, no clocks, no network calls, and no model drift—so identical coefficients always produce identical JSON.

What you send and what you get back

Missing fields, non-numeric strings, NaN, and Infinity fail with invalid_input and are not charged. When a is zero or extremely close to zero the request fails with a message that the quadratic formula requires a nonzero quadratic term, so clients can switch to a linear solver rather than guessing. On success the response echoes cleaned coefficients, a printable equation string, the discriminant as a number, root_type as one of two_real, one_real, or complex, a boolean real_roots flag, and an array roots of two objects each with re and im. Pricing for successful API calls is the published base of $0.002 per item; validation failures do not consume prepaid balance.

Where quadratic solvers show up in real work

Because this capability is a pure parse engine, API pricing is the published base of $0.002 per successful item and failed validation does not consume balance.

Physics and kinematics times

Solve a t² + b t + c = 0 for projectile or free-fall models and know immediately whether impact times are real or complex.

Break-even and parabolic models

Find zeros and the vertex of quadratic cost, revenue, or demand curves in notebooks without silently treating a=0 as quadratic.

What happens if a is zero?

The request fails with invalid_input. The quadratic formula requires a non-zero quadratic coefficient; a linear equation bx + c = 0 is a different problem.

Read the full KIT documentation →