Ultra Calculator
    Maths

    Quadratic Formula Calculator

    To solve ax² + bx + c = 0, put a, b and c into x = (-b ± √(b² - 4ac)) ÷ 2a. The discriminant, b² - 4ac, tells you what to expect: positive gives two real roots, zero gives one repeated root and negative gives two complex roots.

    Last updated by Ultra Calculator

    Quadratic Formula

    How to calculate it

    x = (-b ± √(b² - 4ac)) ÷ (2a)
    a
    the coefficient of x², which must not be 0
    b
    the coefficient of x
    c
    the constant term
    x
    a root, a value that makes ax² + bx + c equal 0

    The discriminant Δ = b² - 4ac decides the type of roots: Δ > 0 gives two real roots, Δ = 0 one repeated root, and Δ < 0 two complex roots written as p + qi and p - qi, where i = √(-1).

    Worked example

    One repeated root: x² - 4x + 4 = 0

    The discriminant is 0, so both roots are 2. The quadratic is a perfect square, (x - 2)².

    You enter
    a (x² coefficient)1
    b (x coefficient)-4
    c (constant term)4
    The calculator returns
    Root 1 (x₁)2
    Root 2 (x₂)2
    Discriminant (b² - 4ac)0
    Type of rootsOne real root (repeated)
    Vertex (h, k)(2, 0)

    How to use this calculator

    1. Rearrange your equation so one side is 0, in the form ax² + bx + c = 0.
    2. Enter the three numbers in a (x² coefficient), b (x coefficient) and c (constant term), keeping any minus signs.
    3. Read Root 1 (x₁) and Root 2 (x₂). Complex roots appear as p + qi and p - qi.
    4. Check Discriminant (b² - 4ac) and Type of roots to see whether there are two distinct real roots, one repeated root or two complex roots. Vertex (h, k) gives the turning point of the parabola.

    Frequently asked questions

    How do you use the quadratic formula?

    Write the equation as ax² + bx + c = 0 and read off a, b and c. For 2x² - 7x + 3 = 0, the discriminant is (-7)² - 4 × 2 × 3 = 25, its square root is 5, and x = (7 ± 5) ÷ 4. The roots are x = 3 and x = 0.5.

    What does the discriminant tell you?

    The discriminant b² - 4ac is the part under the square root. If it is positive, there are two different real roots; if it is 0, there is one repeated root; and if it is negative, there are two complex roots and no real roots.

    What happens if a is 0?

    There is no x² term, so the equation becomes bx + c = 0. If b is not 0, its solution is x = -c ÷ b. The quadratic formula would divide by zero, which is why the calculator requires a value of a other than 0.

    What are complex roots?

    When the discriminant is negative, no real number solves the equation, and the graph of y = ax² + bx + c never crosses the x-axis. The roots are p + qi and p - qi, where i = √(-1). For x² + 2x + 5 = 0, they are -1 + 2i and -1 - 2i.

    Should I factorise or use the formula?

    Factorising is quicker when the roots are whole numbers or simple fractions. For example, x² - 5x + 6 = (x - 2)(x - 3). The formula works for every quadratic, including those with irrational or complex roots that do not factorise neatly.

    How can I check my roots?

    The two roots add up to -b ÷ a and multiply to c ÷ a. For 2x² - 7x + 3 = 0, 3 + 0.5 = 3.5 = 7 ÷ 2 and 3 × 0.5 = 1.5 = 3 ÷ 2, confirming the pair of roots.

    Learn more

    Where the formula comes from

    Divide ax² + bx + c = 0 by a, then complete the square: (x + b/(2a))² = (b² - 4ac) ÷ (4a²). Taking the square root of both sides and subtracting b/(2a) gives the quadratic formula. This derives a general solution by completing the square.

    Roots and the graph

    Real roots are where the parabola y = ax² + bx + c meets the x-axis. Its turning point, the vertex, sits at x = -b ÷ (2a), halfway between two distinct real roots. The parabola opens upwards when a is positive and downwards when a is negative.

    Reading the discriminant

    The height of the vertex is -Δ ÷ (4a). Together with the sign of a, this tells you which side of the x-axis the vertex is on. When Δ is positive, the curve crosses the axis twice; when Δ is 0, the vertex sits on the axis; and when Δ is negative, the curve never reaches it.

    • Checking homework answers for quadratic equations
    • Finding when a ball thrown upwards lands, from a height equation such as h = 20t - 4.9t²
    • Working out the sides of a rectangle from its area and perimeter
    • Finding break-even points when profit is a quadratic of price or quantity
    • Confirming a factorisation before writing it up

    Losing the minus sign on b

    In 2x² - 7x + 3 = 0, b is -7, not 7. Enter the sign with the number.

    Not rearranging to equal 0 first

    x² = 5x - 6 has to become x² - 5x + 6 = 0 before you read off a, b and c.

    Dividing only part of the top by 2a

    The whole of -b ± √(b² - 4ac) is divided by 2a, not just the square root.

    Squaring a negative b wrongly

    (-7)² is 49, not -49. The b² term in the discriminant is never negative.

    Reading the terms in the order written

    3 - 7x + 2x² = 0 still has a = 2, b = -7 and c = 3. Match each number to its power of x.

    • Clear fractions or decimals before entering: 0.5x² + 1.5x + 1 = 0 becomes x² + 3x + 2 = 0 when you multiply through by 2.
    • If a, b and c are whole numbers and the discriminant is a perfect square, the quadratic factorises.
    • Divide through by any common factor first. 2x² - 10x + 12 = 0 has the same roots as x² - 5x + 6 = 0.

    Methodology and sources

    The calculator reads a, b and c as decimals, with a blank b or c counting as 0, and works out the discriminant Δ = b² - 4ac. Decimals such as 1.4 can't be stored exactly, so b² - 4ac for x² + 1.4x + 0.49 = 0 (a perfect square) works out a tiny fraction away from 0. A discriminant no bigger than the rounding of b² and 4ac themselves (about 3 parts in 10^16 of their sum) is therefore treated as 0, and anything larger gives two roots, however close. For two real roots it works out the root further from 0 as -(b ± √Δ) ÷ (2a), taking the sign that matches b, and the other as c ÷ a divided by that root, since the two roots multiply to c ÷ a. The textbook formula would take two nearly equal numbers from each other for the smaller root and lose its digits: for x² + 10^8 x + 1 = 0 it gives -7.45 × 10^-9 instead of -1 × 10^-8. If Δ is 0, it returns one repeated root, -b ÷ (2a). If Δ is negative, it returns the complex pair p + qi and p - qi, with p = -b ÷ (2a) and q the size of √(-Δ) ÷ (2a), whatever the sign of a. Vertex (h, k) is the turning point of y = ax² + bx + c, at h = -b ÷ (2a) and k = -Δ ÷ (4a). Roots and the vertex are rounded to 4 decimal places but never more than 12 significant figures, about as many as the arithmetic gets right, so √2 appears as 1.4142 rather than as a surd. From 10^12 they are shown as powers of ten with 12 significant figures, and a non-zero value below 0.00005, which would round to 0, as a power of ten with 3. Two different roots that would look the same, such as -0.9999999 and -1.0000001, are shown with as many more places or figures as it takes to tell them apart. The discriminant is shown the way the form shows numbers: 4 decimal places, or a power of ten with 3 significant figures when it is 10^15 or more or would otherwise round to 0. When b² and 4ac are nearly equal, as with large coefficients and roots very close together, the discriminant carries the rounding of both, so the last digits of the roots and the vertex can be uncertain. a must not be 0, and each of a, b and c must be 0 or between 10^-100 and 10^100 in size; within that range every step of the working stays within what a number can hold, and multiplying or dividing a, b and c by the same power of ten doesn't change the roots.