Quadratic Equation Solver
Solve ax² + bx + c = 0 for real roots
Updated
What is the Quadratic Equation Solver?
Solve any quadratic equation of the form ax² + bx + c = 0 instantly—with exact radical forms, decimal approximations, step-by-step working, and full vertex analysis. Whether you're checking homework, teaching, or just need a quick answer, this solver handles everything from simple integers to decimal coefficients.
Why this solver?
- Exact answers – Not just rounded decimals. Get simplified fractions and radicals (like (\frac{-3 \pm i\sqrt{3}}{4})).
- Complex roots – Automatically detects negative discriminants and shows the imaginary part.
- Step-by-step solutions – Every calculation is broken down: identifying coefficients, computing the discriminant, applying the quadratic formula, and finding the vertex.
- Factored form – When the roots are rational, the equation is written as (a(x-r_1)(x-r_2)).
- Copy-friendly – One click to copy the full solution as plain text.
- Handles edge cases – Constant equations (no solution or infinitely many solutions) and linear equations are detected gracefully.
- Vertex & axis of symmetry – The parabola's turning point and symmetry line are always shown.
- Live preview – See results instantly as you type; no need to press a button.
Enter your equation in any of these formats
2x^2+3x-5=0
x^2 - 4x + 4 = 0
(Spaces are allowed.)
-x^2+6x=0
(Missing constant.)
3.5x^2 - 2.1x + 0.75 = 0
(Decimal coefficients.)
How it works
The solver follows the standard quadratic equation solution process, enhanced with exact radical simplification, fraction reduction, and clear formatting.
1. Equation Parsing
The input is split around =0 and scanned for the x², x, and constant terms using regular expressions. It supports:
- Optional
+and-signs - Decimal coefficients
- Implicit coefficients (for example,
x^2is treated as1x^2)
If the equation cannot be parsed, the solver returns a clear error message.
2. Coefficient Extraction
The coefficients a, b, and c are extracted as follows:
- a → coefficient of the
x²term - b → coefficient of the
xterm (excludingx²) - c → constant term
3. Discriminant Calculation
The discriminant (Δ) is calculated using:
Δ = b² − 4ac
The value of the discriminant determines the type of roots:
- Δ > 0 → Two distinct real roots
- Δ = 0 → One repeated real root (double root)
- Δ < 0 → Two complex conjugate roots
4. Root Calculation
The roots are calculated using the quadratic formula:
x = (−b ± √Δ) / (2a)
If the discriminant is negative, the roots become:
x = (−b ± i√|Δ|) / (2a)
5. Exact Form Simplification
When all coefficients are integers, the solver simplifies radicals by factoring out perfect squares. For example:
√12 = 2√3
The resulting fraction is then reduced to lowest terms using the greatest common divisor (GCD), producing simplified expressions such as:
(1 ± 2√3) / 3
For decimal coefficients, exact radical forms are often not meaningful, so the solver displays decimal approximations instead.
6. Vertex & Axis of Symmetry
For the parabola:
y = ax² + bx + c
the vertex (h, k) is calculated as:
h = −b / (2a)
k = c − b² / (4a)
The axis of symmetry is the vertical line:
x = h
7. Factored Form
When the discriminant is a perfect square and the coefficients are integers, the equation is written in factored form:
a(x − r₁)(x − r₂)
where r₁ and r₂ are the roots.
8. Edge Cases
The solver also handles special cases automatically:
a = 0andb ≠ 0→ Solves the equation as a linear equation:
x = −c / b
a = 0andb = 0→ Treated as a constant equation:c = 0→ Infinitely many solutionsc ≠ 0→ No solution
Examples
Two real roots
Solve 2x² + 3x - 5 = 0
Double root
Solve x² - 4x + 4 = 0
Complex roots
Solve x² + x + 1 = 0
Frequently asked questions
What Is the Quadratic Formula and How Do You Use It?
What Is the Quadratic Formula and How Do You Use It?
The quadratic formula provides the solutions to any equation in the standard form: [ ax^2 + bx + c = 0 ] Use the formula: [ x = \frac{-b \pm \sqrt{b^2 - 4ac}}{2a} ] The ± symbol means there are usually two possible solutions (roots). The expression inside the square root, [ b^2 - 4ac ] is called the discriminant, and it determines the type of roots the equation has:
- Positive discriminant ((b^2 - 4ac > 0)) → Two distinct real roots
- Zero discriminant ((b^2 - 4ac = 0)) → One repeated real root
- Negative discriminant ((b^2 - 4ac < 0)) → Two complex conjugate roots
How should I type my quadratic equation?
How should I type my quadratic equation?
Enter your equation in standard form ending with =0. Use x^2 for the squared term. Spaces are optional and are ignored by the parser.
Examples:
3x^2 + 5x - 2 = 0
-x^2 + 4x = 0
(No constant term.)
2.5x^2 - 1.75x + 0.5 = 0
(Decimal coefficients.) Missing terms are allowed and are automatically treated as having a coefficient of zero.
What does it mean when the discriminant is negative?
What does it mean when the discriminant is negative?
A negative discriminant means the quadratic equation has no real roots. Instead, it has two complex conjugate roots, such as: [ 1 \pm 2i ] The solver displays both the exact complex form and decimal approximations.
Does the solver show the calculation steps?
Does the solver show the calculation steps?
Yes. Every valid quadratic equation includes a complete step-by-step solution showing:
- Extraction of the coefficients (a), (b), and (c)
- Calculation of the discriminant
- Application of the quadratic formula
- Simplification of exact radicals (when possible)
- Decimal approximations
- Vertex and axis of symmetry
- Factored form (when applicable) Linear equations and constant equations also include appropriate solution steps.
Can I copy the solution for homework or notes?
Can I copy the solution for homework or notes?
Yes. Use the Copy button to copy a complete plain-text summary that includes:
- Exact roots
- Decimal approximations
- Discriminant
- Vertex
- Axis of symmetry
- Factored form (when available) This makes it easy to paste the results into homework, notes, or other documents.
Related tools
More utilities you might find handy.
Circle Calculator
Calculate circle radius, diameter, circumference, and area from any one known value. Instant results with adjustable precision.
Cube Root Calculator
Calculate cube root of any number
Decimal & Base Converter
Instantly convert numbers between decimal, binary, hexadecimal, octal, and any custom base from 2 to 36.