minukalkulaator.ee

Quadratic equation solver

Solve the quadratic equation ax² + bx + c = 0: calculate the discriminant, roots and parabola vertex.

ax² + bx + c = 0

Roots
2; 1
Discriminant1
Parabola vertex(1.5; -0.25)

Calculations are based on Estonia's tax rates in force for 2026. Results are informational.

Last updated: 2026-06-03

How to solve a quadratic equation?

A quadratic equation is solved with x = (−b ± √D) / 2a, where the discriminant D = b² − 4ac. If D > 0 there are two roots, if D = 0 one root, and if D < 0 there are no real roots.

How it is calculated

Formula

ax² + bx + c = 0. Discriminant D = b² − 4ac. Roots x = (−b ± √D) ÷ (2a). D > 0 two roots, D = 0 one, D < 0 no real roots.

Example

x² − 5x + 6 = 0 → D = 1 → x = 3 and x = 2.

Example 1: two roots when D > 0

Let us solve 2x² - 7x + 3 = 0. The coefficients are a = 2, b = -7 and c = 3. The discriminant is D = (-7)² - 4 × 2 × 3 = 49 - 24 = 25. Since D is positive, the equation has two distinct real roots.

√25 = 5, so x = (7 ± 5) ÷ 4. With the plus sign x₁ = 12 ÷ 4 = 3, and with the minus sign x₂ = 2 ÷ 4 = 0.5. Check: 2 × 3² - 7 × 3 + 3 = 18 - 21 + 3 = 0.

Note that -b is +7 here because b itself is negative. When D is a perfect square (1, 4, 9, 25, 49 ...), the roots are rational. When it is not, a root stays in the answer and the calculator rounds it to four decimals: for example the roots of x² - 2 = 0 are shown as ±1.4142, exactly ±√2.

Examples 2 and 3: one root or no real roots

In x² - 6x + 9 = 0 the discriminant is D = 36 - 36 = 0. Both branches of the formula give the same answer, x = 6 ÷ 2 = 3. This is a double root: the left side is the perfect square (x - 3)², and the parabola touches the x-axis at a single point, which is also its vertex (3; 0).

In x² + 2x + 5 = 0 the discriminant is D = 4 - 20 = -16. A negative number has no real square root, so there are no real roots. The vertex is (-1; 4): since a > 0 the parabola opens upwards and its lowest point lies above the x-axis.

Over the complex numbers this equation does have roots, x = -1 ± 2i, because √-16 = 4i. In a standard school course the answer is usually given as "no real roots", and the calculator behaves the same way.

Vertex form and what the vertex tells you

Any quadratic can be written as y = a(x - x₀)² + y₀, where (x₀; y₀) is the vertex and x₀ = -b ÷ 2a. The function from example 1 is 2x² - 7x + 3 = 2(x - 1.75)² - 3.125, so its vertex is (1.75; -3.125), exactly what the calculator shows.

The same trick solves an equation without the formula. Write x² - 6x + 5 = 0 as (x - 3)² - 4 = 0, so (x - 3)² = 4, x - 3 = ±2 and the roots are 5 and 1. This method is called completing the square, and the general quadratic formula is derived from it.

The vertex is useful whenever you need a maximum or minimum. In a simplified model a ball is thrown upwards and its height is h = -5t² + 20t + 1 metres. The vertex (2; 21) says the ball reaches its highest point, 21 m, after two seconds. The roots -0.0494 and 4.0494 show it hits the ground after about 4.05 seconds; the negative root has no physical meaning here.

Vieta's formulas: a quick check without the formula

The roots of a quadratic satisfy x₁ + x₂ = -b ÷ a and x₁ × x₂ = c ÷ a. The roots from example 1, 3 and 0.5, give a sum of 3.5 = 7 ÷ 2 and a product of 1.5 = 3 ÷ 2, so the answer checks out.

When a = 1 you can often guess the roots mentally. For x² + x - 12 = 0 the roots must add up to -1 and multiply to -12. The numbers 3 and -4 fit, so x² + x - 12 = (x - 3)(x + 4). The calculator gives the same roots with D = 49.

Incomplete equations, a word problem and common mistakes

If b = 0 or c = 0 you do not need the formula. x² - 16 = 0 gives x² = 16 and x = ±4. 3x² - 12x = 0 gives x(3x - 12) = 0 and the roots 0 and 4. If a = 0 the equation is no longer quadratic: 2x - 6 = 0 is linear and the calculator returns the single root x = 3.

Word problem: a rectangle has an area of 40 m² and its length is 3 m more than its width. The width x satisfies x(x + 3) = 40, that is x² + 3x - 40 = 0. D = 9 + 160 = 169 and the roots are 5 and -8. A length cannot be negative, so the width is 5 m and the length 8 m.

  • Rearrange the equation to ... = 0 before reading the coefficients: x² = 5x - 6 becomes x² - 5x + 6 = 0, where b = -5.
  • b² is never negative: if b = -7 then b² = 49, not -49.
  • Divide the whole numerator by 2a, not just the part with the root.
  • Check your answer by substituting it into the original equation or by using Vieta's formulas.

Frequently asked questions

How do I solve a quadratic equation?+

Use the formula x = (−b ± √D) ÷ (2a), where the discriminant D = b² − 4ac.

What does the discriminant tell me?+

If D > 0 there are two real roots, if D = 0 one root, and if D < 0 there are no real roots.

Related calculators

Add this calculator to your siteFree - copy the code and paste it into your page. Please keep the credit link to minukalkulaator.ee.