Português

Quadratic Equations — Quadratic Formula and Parabola

A quadratic equation has the form ax² + bx + c = 0, where a, b and c are real numbers and a ≠ 0 (with a = 0 it becomes a linear equation, in Portuguese). Solving it means finding the values of x that make the expression zero — and, on the graph, finding where the parabola crosses the x-axis. Move a, b and c and watch both change together.

The parabola and the roots

The graph of y = ax² + bx + c is a curve called a parabola. The roots of the equation are the points where it meets the x-axis (there, y = 0). The discriminant Δ = b² − 4ac (read “delta”) tells how many real roots there are, and the vertex is the lowest or highest point of the curve.

Step by step

    The controls only take whole numbers. For decimal coefficients or to see the complex roots, use the quadratic formula calculator.

    Where the formula comes from

    Some quadratic equations can be solved with no formula at all. If the equation were

    it would be enough to take the square root of both sides — remembering that both 3 and −3 give 9 when squared:

    The quadratic formula is just this done in general: turn any ax² + bx + c = 0 into a perfect square equal to a number (“completing the square”) and then take the square root.

    1. Since a ≠ 0, we can divide everything by a. Then move the term without x to the other side:
    2. Recall that (x + k)² = x² + 2kx + k². The left side has x² and 2kx with 2k = b/a, that is, k = b/(2a). The k² is missing: add it to both sides, so the equality still holds:
    3. The left side is now (x + b/(2a))². On the right, write both fractions over the denominator 4a² and combine them:
    4. If Δ ≥ 0 (the case Δ < 0 is in the box below), take the square root of both sides, with ±. The square root of 4a² is 2|a| (the absolute value of 2a), but since ± already covers both signs, writing 2a gives the same thing. Then isolate x:
    Why Δ is in charge. Step 3 shows that a square must equal Δ/4a². The denominator 4a² is positive, and the square of a real number is never negative. So: if Δ > 0, there are two real roots (one with +, one with −); if Δ = 0, they coincide and there is one (a double root); if Δ < 0, there is no real root, and on the graph the parabola never reaches the x-axis.

    The −b/(2a) that shows up in the middle of the calculation is the x of the vertex: when there are two roots, they sit at the same distance from it, one on each side. The expansion of (x + k)² is the square of a sum, on the exponents page.

    Shortcuts: when a term is missing

    The quadratic formula always works, but when b or c is zero there are shorter ways.

    No x term (b = 0)

    Isolate x² and take the square root, without forgetting the ±:

    If the number on the other side is negative (as in x² = −4), there is no real root: no real number squared is negative.

    No constant term (c = 0)

    Factor out x. A product is zero only if at least one of the factors is zero:

    With c = 0, one of the roots is always 0. And never divide both sides by x: that would make the root 0 disappear.

    Factored form

    If x₁ and x₂ are the roots (with x₁ = x₂ when Δ = 0), the expression can be rewritten as a product — the reverse of the shortcut above:

    Checking the example: (x − 2)(x − ½) = x² − ½x − 2x + 1 = x² − 2.5x + 1, and 2 · (x² − 2.5x + 1) = 2x² − 5x + 2.

    Sum and product of the roots

    Expanding the factored form, a(x − x₁)(x − x₂) = ax² − a(x₁ + x₂)x + ax₁x₂. Comparing with ax² + bx + c term by term: −a(x₁ + x₂) = b and ax₁x₂ = c. Dividing by a (which is not zero) gives the two relations below, which hold for the roots of any quadratic equation: with Δ = 0, x₁ = x₂; with Δ < 0, the roots are complex numbers and the relations still hold. The controls below are the same as the graph’s.

    Sum

    holds

    Product

    holds
    Roots in your head. With a = 1, look for two numbers with sum −b and product c. In x² − 5x + 6 = 0: sum 5 and product 6 → 2 and 3 (2 + 3 = 5 and 2 · 3 = 6). When the roots are whole numbers, this is often faster than the formula; when they are not, use the formula.

    Worked example

    The numbers in this example are made up so the arithmetic stays simple. A rectangular plot of land has a perimeter of 16 m and an area of 15 m². What are the lengths of its sides?

    Data (from the problem): perimeter P = 16 m; area A = 15 m². Call the side lengths x and y, in meters.

    Equations. The perimeter is the sum of the four sides, and the area is the product of the two sides:

    From the first, dividing by 2: x + y = 8, so y = 8 − x. Substituting into the second:

    Multiplying both sides by −1 (which does not change the roots):

    Quadratic formula, with the discriminant first:

    With sum and product you could guess it: two numbers with sum 8 and product 15 are 3 and 5.

    Do the roots fit the problem? A side must have a positive length, and so must the other one (8 − x): 0 < x < 8. Both roots pass. With x = 3, the other side is 8 − 3 = 5; with x = 5, it is 8 − 5 = 3.

    Check: perimeter 2 · 3 + 2 · 5 = 6 + 10 = 16 m; area 3 · 5 = 15 m².

    Result: the plot measures 3 m by 5 m (exact values).

    Interpretation. The two roots are not two different plots: they are the two sides of the same plot, because calling the shorter or the longer side x is our choice. See the parabola for this example: it crosses the x-axis at 3 and at 5.

    Common mistakes and limits

    Try it yourself

    1. Solve x² − 5x + 6 = 0.

    Show answer

    Δ = (−5)² − 4 · 1 · 6 = 25 − 24 = 1, and √1 = 1. So x = (5 ± 1)/2: x = 4/2 = 2 or x = 6/2 = 3. x = 2 or x = 3. (Or by sum and product: sum 5, product 6.)

    See it on the graph →

    2. Solve x² − 9 = 0 without the quadratic formula.

    Show answer

    x² = 9, so x = ±√9: x = 3 or x = −3.

    See it on the graph →

    3. Solve 2x² + 6x = 0.

    Show answer

    2x(x + 3) = 0, so 2x = 0 or x + 3 = 0: x = 0 or x = −3.

    See it on the graph →

    4. How many real roots does x² + 2x + 5 = 0 have?

    Show answer

    Δ = 2² − 4 · 1 · 5 = 4 − 20 = −16 < 0: none. The parabola opens upward (a = 1 > 0) and the vertex, at x = −2/2 = −1 and y = 1 − 2 + 5 = 4, that is, at (−1, 4), lies above the x-axis.

    See it on the graph →

    5. Solve x² − 6x + 9 = 0.

    Show answer

    Δ = (−6)² − 4 · 1 · 9 = 36 − 36 = 0: a double root, x = 6/2 = 3. Indeed, x² − 6x + 9 = (x − 3)².

    See it on the graph →

    6. Write a quadratic equation whose roots are 3 and 4.

    Show answer

    With a = 1: sum 3 + 4 = 7 and product 3 · 4 = 12, so x² − 7x + 12 = 0. The factored form, (x − 3)(x − 4) = 0, gives the same. Multiplying everything by any nonzero number (2x² − 14x + 24 = 0, for example) gives another correct answer, with the same roots.

    See it on the graph →

    7. For which values of k does x² + kx + 9 = 0 have a single real root?

    Show answer

    A single real root means Δ = 0: k² − 4 · 1 · 9 = k² − 36 = 0, so k² = 36 and k = 6 or k = −6. The equations are x² + 6x + 9 = (x + 3)² = 0, with root −3, and x² − 6x + 9 = (x − 3)² = 0, with root 3.

    See k = 6 on the graph →

    References

    The general statements on this page, with the same hypotheses as the text (completing the square, the quadratic formula for Δ ≥ 0, no real root for Δ < 0, the double root for Δ = 0, the shortcuts for b = 0 and c = 0, the factored form, sum and product also with complex roots, and the vertex as minimum or maximum), the worked example and the answers to the exercises are proved in the Lean proof assistant (provas/Provas/EquacaoSegundoGrau.lean, in the site’s repository). The calculator was checked by computer for every combination of a, b and c on the controls, recomputing each equality it shows.