Article
Quadratic Equation: Discriminant, Roots and Examples
A quadratic equation has the form ax² + bx + c = 0, and the number of its solutions depends on the discriminant. Below you will find the formulas, the solution steps, four worked examples and answers to typical questions, and you can test your own coefficients in the quadratic equation calculator.
Last updated:
Helpful companions are the square root calculator, the linear equation calculator and the difference of squares.
General form and the discriminant formula
A quadratic equation is written in the general form ax² + bx + c = 0, where a is not zero. The numbers a, b and c are called coefficients. The number of real solutions is decided by the discriminant, Δ = b² − 4ac.
ax² + bx + c = 0, a ≠ 0
Δ = b² − 4ac
x₁ = (−b − √Δ) ÷ (2a), x₂ = (−b + √Δ) ÷ (2a)
for Δ = 0: x₀ = −b ÷ (2a)
| Discriminant | Real solutions | Roots |
|---|---|---|
| Δ > 0 | two | x₁ ≠ x₂ |
| Δ = 0 | one (double root) | x₀ = −b ÷ (2a) |
| Δ < 0 | none | no real roots |
If a = 0, the equation is no longer quadratic. It becomes linear: bx + c = 0.
Try it with an example
This example shows the equation x² − 5x + 6 = 0. The coefficients are already stored in the link to the calculator.
- a
- 1
- b
- −5
- c
- 6
- Result
- Δ = 1; x₁ = 2, x₂ = 3
Open the calculator with these numbers
The calculator reads the values from the page address and shows the result right away. You can change them freely.
How the calculator works
The calculator computes the discriminant and the real roots for the coefficients a, b and c, and shows a check with Vieta’s formulas. The coefficient a should be nonzero, because for a = 0 the equation is no longer quadratic. When the discriminant is negative, the calculator reports that there are no real roots. It does not return complex roots.
How to solve a quadratic equation step by step
First bring the equation to the form ax² + bx + c = 0 and read the coefficients together with their signs. In x² − 3x + 2 = 0 we have a = 1, b = −3 and c = 2. A wrong sign on b is one of the most common mistakes.
Next compute the discriminant, Δ = b² − 4ac. For these coefficients you get 9 − 8 = 1. A positive discriminant means two distinct roots, zero means one solution, and a negative value means there are no real solutions.
Finally, substitute the discriminant into the root formula. You can take the square root of the discriminant in the square root calculator. In the quadratic equation calculator you only enter a, b and c; the result includes the discriminant, the roots and a check with Vieta’s formulas.
Zeros of a quadratic function
The roots of ax² + bx + c = 0 are also the zeros of the function f(x) = ax² + bx + c, that is, the points where its graph, a parabola, crosses the x-axis. The number of zeros depends on the sign of the discriminant.
| Discriminant | Zeros | Formula | Example |
|---|---|---|---|
| Δ > 0 | two | x₁ = (−b − √Δ) ÷ (2a), x₂ = (−b + √Δ) ÷ (2a) | x² − 5x + 6: Δ = 1, x = 2 and 3 |
| Δ = 0 | one | x = −b ÷ (2a) | x² + 2x + 1: x = −1 |
| Δ < 0 | none (among real numbers) | — | x² + 1: Δ = −4 |
The vertex of the parabola has the x-coordinate p = −b ÷ (2a). For x² − 5x + 6 this is p = 2.5, the point exactly halfway between the zeros 2 and 3. The y-coordinate of the vertex is q = −Δ ÷ (4a) = −0.25. The calculator returns the discriminant and the roots, but it does not compute the coordinates of the vertex.
Vieta’s formulas as a quick check
For an equation with two roots x₁ and x₂, the sum of the roots is −b ÷ a and their product is c ÷ a. For x² − 3x + 2 = 0 the roots are 1 and 2: the sum is 3, which equals −(−3) ÷ 1, and the product is 2, which equals c ÷ a. If both conditions hold, the result is correct.
| Equation | a, b, c | Δ | Roots |
|---|---|---|---|
| x² − 3x + 2 = 0 | 1; −3; 2 | 1 | 1; 2 |
| x² + 2x + 1 = 0 | 1; 2; 1 | 0 | −1 |
| x² + 1 = 0 | 1; 0; 1 | −4 | no real solutions |
| 2x² − 8 = 0 | 2; 0; −8 | 64 | −2; 2 |
| x² − 5x + 6 = 0 | 1; −5; 6 | 1 | 2; 3 |
What happens when a = 0 or b = 0
When a = 0, there is no x² term, so the task reduces to the linear equation bx + c = 0 with the solution x = −c ÷ b. The linear equation calculator handles such equations too. For 2x − 4 = 0 the result is x = 2.
When b = 0, the equation has the form ax² + c = 0. For 2x² − 8 = 0 the discriminant is 64 and the roots are −2 and 2. The same equation can be factored with the difference of squares formula: x² − 4 = (x − 2)(x + 2).
Solving without the discriminant: when c = 0
When the constant term is missing, the equation has the form ax² + bx = 0 and you can factor out x: x · (ax + b) = 0. The product is zero when x = 0 or when ax + b = 0, that is, x = −b ÷ a. For x² − 4x = 0 you get x · (x − 4) = 0, so the roots are 0 and 4. The quadratic equation calculator returns the same result for a = 1, b = −4 and c = 0.
Once you know the roots, you can write the trinomial in factored form: ax² + bx + c = a · (x − x₁) · (x − x₂). For x² − 5x + 6 you get (x − 2) · (x − 3), and multiplying out the brackets gives x² − 5x + 6, which confirms the result.
Where quadratic equations appear
Geometry. If a rectangle has a known perimeter and area, its side lengths come from a quadratic equation. The area itself is available in the rectangle area calculator.
Physics. The fall time from a given height follows from h = ½gt², which is quadratic in t. The free fall calculator returns the result directly.
Right triangles. Solving for a side from a² + b² = c² leads to a quadratic equation. We cover it in the article Pythagorean Theorem: Formula, Examples and Calculator.
Algebraic identities. Factoring a trinomial often uses the square of a sum or the difference of squares.
Four worked examples
You can check each example in the quadratic equation calculator.
1. x² − 3x + 2 = 0, two roots
A positive discriminant.
- Read a = 1, b = −3, c = 2.
- Compute Δ = (−3)² − 4 · 1 · 2 = 9 − 8 = 1.
- The square root of the discriminant is 1, so x = (3 ± 1) ÷ 2.
- The solutions are x₁ = 1 and x₂ = 2.
2. x² + 2x + 1 = 0, one double root
A discriminant equal to zero.
- Read a = 1, b = 2, c = 1.
- Compute Δ = 4 − 4 = 0.
- Use x₀ = −b ÷ (2a) = −2 ÷ 2.
- The solution is x = −1; the equation can be written as (x + 1)² = 0.
3. x² + 1 = 0, no real solutions
A negative discriminant.
- Read a = 1, b = 0, c = 1.
- Compute Δ = 0 − 4 = −4.
- The square root of a negative number is not a real number.
- The result: no real solutions.
4. 2x² − 8 = 0, no x term
The coefficient b equals zero.
- Read a = 2, b = 0, c = −8.
- Compute Δ = 0 + 64 = 64, and the square root of the discriminant is 8.
- Substitute: x = (0 ± 8) ÷ 4.
- The solutions are x = −2 and x = 2.
Common mistakes with quadratic equations
- A wrong sign on coefficient b — in x² − 3x + 2 = 0 the coefficient b is −3, not 3.
- Dividing by a instead of 2a — the whole numerator −b ± √Δ must be divided by 2a.
- Dropping one of the roots — the ± sign stands for two separate solutions whenever the discriminant is positive.
- Not rewriting in general form — the equation x² = 3x − 2 must first be written as x² − 3x + 2 = 0.
- Taking a = 0 — then the equation is not quadratic and should be solved as a linear one.
- Treating a negative discriminant as an arithmetic error — it simply means there are no real solutions.
- Skipping the check — Vieta’s formulas catch most arithmetic slips.
Frequently asked questions
How do you calculate the discriminant?
Use Δ = b² − 4ac. For x² − 3x + 2 = 0 you get 9 − 8 = 1.
What does a negative discriminant mean?
It means the equation has no real solutions. An example is x² + 1 = 0, where Δ = −4.
How many solutions does the equation have when the discriminant is zero?
One solution, called a double root, equal to −b ÷ (2a). For x² + 2x + 1 = 0 it is −1.
How do you find the zeros of a quadratic function?
The zeros of f(x) = ax² + bx + c are the roots of ax² + bx + c = 0. Compute the discriminant Δ = b² − 4ac, then x = (−b ± √Δ) ÷ (2a). For f(x) = x² − 5x + 6 the discriminant is 1, so the zeros are 2 and 3.
What if the coefficient a is zero?
The equation is no longer quadratic. Solve it as the linear equation bx + c = 0, so x = −c ÷ b, provided b is not zero.
How do you check the result with Vieta’s formulas?
The sum of the roots should equal −b ÷ a and their product c ÷ a. For roots 2 and 3 of x² − 5x + 6 = 0 the sum is 5 and the product is 6.
Can an equation without an x term be solved with the discriminant too?
Yes. For 2x² − 8 = 0 we have b = 0, the discriminant is 64, and the roots are −2 and 2.
Does the calculator return complex roots?
No. The calculator returns real solutions only, and for a negative discriminant it states that there are none.
Solve your own equation
Enter the coefficients a, b and c in the quadratic equation calculator to get the discriminant, the number of solutions and the roots together with a check. It also handles special cases such as a = 0.
If the solution needs extra arithmetic, use the square root calculator or the power calculator.