Free Algebra Solver
Quadratic formula

Quadratic Formula Calculator

Enter a quadratic equation. The calculator finds a, b, and c, works out the discriminant, and gives exact roots with steps.

Preview x² - 5x + 6 = 0 (Solve) Ready
Examples
Solution

Worked example: x² - 5x + 6 = 0

Worked example. Edit the problem above and press Solve to solve your own.

Problemx² - 5x + 6 = 0
  1. Write the quadratic in standard form

    Move every term to the left and combine like terms, then identify a, b, and c.

    x² - 5x + 6 = 0
    Original equation
    x² − 5x + 6 = 0
    Standard form: ax² + bx + c = 0
    a = 1, b = −5, c = 6
    Identify the coefficients

    Standard form exposes the exact coefficients used by complete quadratic methods.

  2. Compute the discriminant

    Substitute the exact coefficients into D = b² − 4ac.

    D = b² − 4ac
    Discriminant formula
    D = (−5)² − 4(1)(6)
    Substitute a, b, and c
    D = 1
    Simplify

    The discriminant determines the number and type of roots.

  3. Apply the quadratic formula and check the roots

    Substitute the exact coefficients, simplify both roots, and check rational candidates.

    x = (−b ± √(b² − 4ac)) / 2a
    Quadratic formula
    x = (5 ± √1) / 2
    Substitute the exact values
    x = 2 or x = 3
    Simplify the root values
    x = 3: Exact residual: 0
    Substitution verified
    x = 2: Exact residual: 0
    Substitution verified

    For a nonzero quadratic coefficient, the formula enumerates the complete root set.

Answerx = 2 or x = 3

Quadratic formula guide

How to use the quadratic formula calculator

This quadratic formula calculator solves any equation of the form ax² + bx + c = 0 and shows each step, from reading a, b, and c to simplifying the roots. Type the equation as you see it in your homework, using ^ for powers.

How do you solve a quadratic equation with the quadratic formula?

Write the equation as ax² + bx + c = 0, read off a, b, and c, and substitute them into x = (−b ± √(b² − 4ac)) / 2a. Work out the discriminant b² − 4ac first. Then take its square root, use the plus sign for one root and the minus sign for the other, and simplify each answer.

What is the standard form of a quadratic equation?

Standard form is ax² + bx + c = 0, with every term on one side and zero on the other. The number in front of x² is a, the number in front of x is b, and the constant is c.

The signs belong to the numbers. In x² − 5x + 6 = 0, a = 1, b = −5, and c = 6. If your equation looks like 3x² = 7x − 2, move everything to the left first: 3x² − 7x + 2 = 0. The quadratic equation solver does this rearranging for you, but it helps to know why the step is there.

Quadratic formula calculator example: x² − 5x + 6 = 0

The roots are x = 2 and x = 3. Here is the same work the calculator shows, line by line.

Quadratic formula
x =−b ± √(b² − 4ac)2a
Coefficients
a = 1, b = −5, c = 6
Discriminant
(−5)² − 4(1)(6) = 25 − 24 = 1
Substitute
x =5 ± √12
Roots
x = 6/2 = 3 or x = 4/2 = 2

You can check either root by putting it back in. For x = 2: 4 − 10 + 6 = 0, so it works.

What does the discriminant tell you before you solve?

The discriminant, b² − 4ac, tells you what kind of roots to expect. A positive value gives two real roots, zero gives one repeated root, and a negative value gives no real roots.

It also tells you whether the answer will be neat. When the discriminant is a perfect square like 1, 4, or 25, the square root comes out whole and the roots are rational. Anything else leaves a radical in the answer.

Equationb² − 4acRoots
x² − 5x + 6 = 01x = 2 or x = 3 (rational)
x² − 2x − 1 = 08x = 1 ± √2 (radical)
x² + 2x + 5 = 0−16x = −1 ± 2i (complex)

What if the roots have square roots or i in them?

Then the exact answer is written with √ or i, and the calculator keeps it exact instead of rounding. For x² − 2x − 1 = 0 the discriminant is 8, and √8 simplifies to 2√2, so x = (2 ± 2√2)/2 = 1 ± √2.

For x² + 2x + 5 = 0 the discriminant is −16. With the number domain set to real numbers, the result is "No real solution". Switch the setting to complex numbers and you get x = −1 ± 2i, because √−16 = 4i and (−2 ± 4i)/2 simplifies to −1 ± 2i.

When should you factor instead of using the formula?

Factor when the discriminant is a perfect square and the numbers are small, because it is usually faster. x² − 5x + 6 = 0 factors as (x − 2)(x − 3) = 0 in a few seconds.

Use the formula when factoring isn't obvious, when a is large, or when the roots turn out to be irrational. The formula always works, so it makes a good fallback. If you want to see the factored form, the factor calculator shows the ac method step by step.

A quick test helps you decide. Work out b² − 4ac first. If it is 0, 1, 4, 9, 16, 25, or another perfect square, the quadratic factors over whole numbers and factoring is worth a try. If not, go straight to the formula.

What are the most common quadratic formula mistakes?

The big one is squaring a negative b without brackets. With b = −5, b² is 25, but typing −5² into many calculators gives −25. Write (−5)² every time.

Another frequent slip is dividing only part of the top by 2a. The whole numerator, −b ± √(b² − 4ac), sits over 2a. Students also forget to move every term to one side before reading c, which changes the sign of c and every answer after it.

How do you type a quadratic into the solver?

Type it the way it is written, with ^ for the power: x^2 - 5x + 6 = 0. The quadratic calculator also accepts equations that are not yet in standard form, such as 2x^2 = 3x + 5, and any single letter as the variable.

Pasted homework text like "Solve for t:" is fine too. For equations of degree 3 to 6, the same solver uses the rational root theorem and synthetic division before applying the quadratic formula to what is left.

What do the roots mean on a graph?

The real roots are the x-intercepts of the parabola y = ax² + bx + c. They are the x-values where the curve crosses or touches the x-axis.

For y = x² − 5x + 6 the curve crosses at x = 2 and x = 3. The vertex sits halfway between them at x = 2.5, which is the same as −b/(2a) = 5/2. When the roots are complex, the parabola never reaches the x-axis at all.

Seeing this picture helps you sanity-check an answer. If a sketch shows the curve dipping below the axis twice, you should get two real roots from the formula. If you get one, recheck the discriminant.

Frequently asked questions

Short answers to the questions people ask most about this topic.

What is the quadratic formula?

The quadratic formula is x = (−b ± √(b² − 4ac)) / 2a. It gives the roots of any equation ax² + bx + c = 0 where a is not zero. The ± sign is what produces two answers.

Can the quadratic solver give complex roots?

Yes. Set the number domain to complex numbers before you solve. With real numbers selected, an equation with a negative discriminant shows "No real solution" instead.

Why does my answer have a square root in it?

The discriminant is not a perfect square, so the roots are irrational. The calculator leaves them in exact radical form, such as 1 ± √2, rather than rounding to decimals.

What if a = 0?

Then the equation has no x² term and it is linear, not quadratic. The solver will treat it as a linear equation and solve it in one or two steps.

Is the quadratic formula the same as completing the square?

They give the same roots. The quadratic formula is what you get when you complete the square on ax² + bx + c = 0 with letters instead of numbers.

How do I solve quadratic equations without a calculator?

Try factoring first if the numbers are small. If that fails, use the formula: find the discriminant, take its square root, then divide −b ± √D by 2a.

Can it solve equations with x³ or higher powers?

Yes, up to degree 6. It looks for rational roots, divides them out, and uses the quadratic formula on the remaining quadratic factor.

What does the ± sign mean in the formula?

It means you do the calculation twice: once adding the square root and once subtracting it. That is why most quadratics have two roots. When the discriminant is 0, both versions give the same number.

Math keypad

Solve mode

Use the keypad below or tap the expression to use your phone keyboard.

Keyboard tips

Ctrl + Enter
Run the selected operation
a/b key
Select part of the problem first to wrap it in a fraction, root, power, or bars
sin(30)
Scientific functions work in Calculate mode; angles are in degrees unless you use π
^
Enter a power, such as x^2
sqrt(
Calculate an exact or simplified square root
a:b
Separate quantities in a ratio
12, 18
Separate integers in an LCM and GCD calculation
@ x =
Assign x when evaluating an expression
y =
Enter a polynomial function to graph
|
Wrap an absolute-value expression