Solve ax² + bx + c = 0, distinguishing real, repeated, complex and degenerate cases with substitution residuals.
Your input
Outputs are cleared when the input changes.
Result
Enter your data or use the example, then run the tool.
Worked example
x² − 3x + 2 = 0 has roots 1 and 2. x² + 1 = 0 has roots +i and −i.
a = b = c = 0 is an identity with infinitely many solutions; a = 0, b ≠ 0 is linear.
Method
Set s = −1 when b < 0, otherwise +1 (including b = 0). Compute q = −(b + s√D)/2 and real roots q/a, c/q; handle q = 0 separately to reduce cancellation.
A negative discriminant gives conjugate complex roots. A zero leading coefficient is classified explicitly; residuals inspect numerical error.
Limits
Finite real coefficients only. Results are floating-point approximations, not symbolic algebra or guaranteed exact radicals. Each coefficient’s magnitude must be at most 10^150.
Nearly repeated roots are sensitive to coefficient changes. A tiny residual alone does not prove root accuracy; extreme scales may be rejected.
Your inputs stay on this device. Only optional, consented page visits are measured. Input values, files, filenames and processing logs are not sent to Analytics.
When switching languages, text, settings and selected files are temporarily kept on this device. Transfers are removed after restoring; interrupted transfers are cleaned up on a later visit. Inputs and files are never uploaded.