Skip to main content

Quadratic Formula Calculator

Try an example:

This quadratic formula calculator solves any equation of the form ax2+bx+c=0ax^2+bx+c=0. It shows the steps, the discriminant and a graph, and it gives exact answers, including complex ones. It comes from our free math solver, and you don't need an account.

How to Use the Quadratic Formula Calculator

Enter Your Equation

Type the whole equation, such as 2x^2-5x-3=0. It does not need to equal zero. If you type x^2=5x-6, the steps move everything to one side first.

Read the Steps

You see the values of aa, bb and cc, then the formula with those numbers in it, then the simplified roots. A small table gives the discriminant, the vertex and the axis of symmetry.

Switch the Method

Use the method buttons to see the same equation solved by factoring, by completing the square or by the formula.

The Quadratic Formula

For ax2+bx+c=0ax^2+bx+c=0 with a≠0a\neq 0:

x=−b±b2−4ac2ax=\frac{-b\pm\sqrt{b^2-4ac}}{2a}

In words: x equals minus b, plus or minus the square root of b squared minus 4ac, all over 2a.

The numbers aa, bb and cc are called coefficients. aa goes with x2x^2, bb goes with xx, and cc is the number on its own. The ±\pm sign means you work it out twice, once with plus and once with minus.

How Do You Calculate the Quadratic Formula?

Set the equation equal to zero and read off a, b and c. Work out b squared minus 4ac. Take its square root. Then find minus b plus that root, and minus b minus that root. Divide both results by 2a. Those two numbers are the solutions.

  1. Write the equation as ax2+bx+c=0ax^2+bx+c=0.
  2. Find b2−4acb^2-4ac.
  3. Put the numbers into the formula.
  4. Work out the plus answer and the minus answer.
  5. Simplify, then put each answer back into the equation to check it.

What Does the Discriminant Tell You?

The discriminant is the part under the square root, b squared minus 4ac. It tells you how many real solutions there are before you solve. A positive value means two real solutions, zero means one repeated solution, and a negative value means two complex solutions.

b2−4acb^2-4acSolutionsThe parabola
PositiveTwo real rootsCrosses the xx-axis twice
ZeroOne repeated rootTouches the xx-axis once
NegativeTwo complex rootsNever meets the xx-axis

Quadratic formula calculator graphs: three parabolas with two, one and no x-axis crossings

Methods This Quadratic Equation Solver Uses

Factoring

Find two numbers that multiply to acac and add to bb. It is the fastest way when the numbers are kind. Practice it with the factoring calculator.

Completing the Square

Rewrite the equation as a perfect square and take square roots. Doing this to ax2+bx+c=0ax^2+bx+c=0 with letters is where the formula itself comes from. The complete the square calculator walks through it.

The Quadratic Formula

It works on every quadratic equation, with any numbers.

Which one should you choose? Try factoring for about 30 seconds. If nothing fits, use the formula. Complete the square when you also need the vertex.

Worked Examples

Example 1: Two Rational Roots

Solve 2x2−5x−3=02x^2-5x-3=0. Here a=2a=2, b=−5b=-5, c=−3c=-3.

  1. Discriminant: (−5)2−4(2)(−3)=25+24=49(-5)^2-4(2)(-3)=25+24=49.
  2. Formula: x=5±494=5±74x=\dfrac{5\pm\sqrt{49}}{4}=\dfrac{5\pm 7}{4}.
  3. Plus: x=124=3x=\frac{12}{4}=3. Minus: x=−24=−12x=\frac{-2}{4}=-\frac{1}{2}.

Example 2: Roots With a Square Root

Solve x2+4x+1=0x^2+4x+1=0. Here a=1a=1, b=4b=4, c=1c=1.

  1. Discriminant: 16−4=1216-4=12.
  2. Formula: x=−4±122x=\dfrac{-4\pm\sqrt{12}}{2}.
  3. Since 12=23\sqrt{12}=2\sqrt{3}, divide every term by 2: x=−2±3x=-2\pm\sqrt{3}.

The exact answers are −2+3-2+\sqrt{3} and −2−3-2-\sqrt{3}, or about −0.268-0.268 and −3.732-3.732. Keep the exact form unless you are asked for decimals.

Example 3: Complex Roots

Solve x2+2x+5=0x^2+2x+5=0. Here a=1a=1, b=2b=2, c=5c=5.

  1. Discriminant: 4−20=−164-20=-16. It is negative, so the roots are complex.
  2. −16=4i\sqrt{-16}=4i, so x=−2±4i2=−1±2ix=\dfrac{-2\pm 4i}{2}=-1\pm 2i.

Common Mistakes to Check

Using the Wrong Sign for b

If b=−5b=-5, then −b=+5-b=+5 and b2=+25b^2=+25. Put parentheses around bb every time, and both signs come out right.

Dividing Only Part of the Top

The whole top is divided by 2a2a. In Example 2, dividing only the root by 2 would give −4±3-4\pm\sqrt{3}, which is wrong.

Practice Problems

  1. Solve x2−7x+12=0x^2-7x+12=0.
  2. Solve 3x2+5x−2=03x^2+5x-2=0.
  3. Solve x2−6x+9=0x^2-6x+9=0.
  4. Solve x2−2x−4=0x^2-2x-4=0.
  5. Solve x2+4x+13=0x^2+4x+13=0.
Show the answers
  1. x=4x=4 or x=3x=3
  2. x=13x=\frac{1}{3} or x=−2x=-2
  3. x=3x=3, a repeated root
  4. x=1+5x=1+\sqrt{5} or x=1−5x=1-\sqrt{5}
  5. x=−2+3ix=-2+3i or x=−2−3ix=-2-3i

Related Calculators

Learn More

FAQ

What Are 5 Methods of Solving a Quadratic Equation?

Factoring, taking square roots, completing the square, the quadratic formula and graphing. This quadratic solver with steps shows three of them as step-by-step methods and adds a graph.

How Can I Solve a Quadratic Equation Online?

Type it into the box at the top of this page and press Solve. You can use it as a quadratic equation calculator for equations with real or complex roots.

How Do I Use the Quadratic Formula on My Calculator?

Work out b2−4acb^2-4ac first and store it. Then type (-b+sqrt(D))/(2a), with your numbers in place of the letters and DD as the stored value. Keep both sets of parentheses. Repeat with a minus sign for the second root.

What If the Discriminant Is Negative?

There are no real solutions, so the graph never meets the xx-axis. There are still two complex solutions, written with i=−1i=\sqrt{-1}.

Can Every Quadratic Be Factored?

Not with whole numbers. x2+4x+1x^2+4x+1 has no whole-number factors, because its roots contain 3\sqrt{3}. The formula still solves it.

What Happens If a Is Zero?

Then there is no x2x^2 term, so the equation is linear, not quadratic. The formula would divide by zero. Use the equation solver instead.


Next step: put your own equation into the quadratic formula calculator above and look at the discriminant before you read the roots.