Uni-Sine
MathematicsAlgebra

Quadratic formula calculator: solve ax² + bx + c = 0

The quadratic formula solves any quadratic equation ax² + bx + c = 0: x = (−b ± √(b² − 4ac)) / 2a. With this quadratic formula calculator, type a, b and c into our Quadratic Graph calculator and it draws the parabola y = ax² + bx + c and lists its roots, the x values where it crosses the x axis. Those roots are the solutions of the equation.

Try it

Quadratic Graph

Plot and analyse quadratic functions

Go to its page

How to use the quadratic graph calculator

  1. Get your equation into the form ax² + bx + c = 0, with 0 on one side.
  2. In the Equation section, type a, b and c into the three boxes. Include the signs: for x² − 5x + 6, type 1, −5 and 6. The preview shows the equation you have built.
  3. Read the roots in the Intercepts section: each X row is a point (x, 0) where the parabola crosses the x axis. The Y row is where it crosses the y axis, which is always (0, c).
  4. For the vertex (turning point), choose Min / Max under Analysis.
  5. To practise, press Random problem under Practice and help. Problems such as marking the x-intercepts come with a hint and the quadratic formula worked out step by step.

The calculator gives the roots as decimals and looks for them between x = −20 and 20. For an exact answer with a square root (a surd, or radical in the US), or for roots further out, use the formula by hand as shown below and use the graph to check it. When the parabola never touches the x axis, the Intercepts section says there are no roots: the equation has no real solutions.

The quadratic formula

x = \frac{-b \pm \sqrt{b^2 - 4ac}}{2a}The solutions of ax² + bx + c = 0, where a is not 0

The ± means there are two answers, one with + and one with −. a is the number in front of x², b is the number in front of x, and c is the number on its own. If there is no x term, b = 0, and if there is no number on its own, c = 0.

The discriminant: how many solutions?

The part under the square root, b² − 4ac, is called the discriminant. Work it out first: it tells you what kind of answer to expect, and the graph shows the same thing.

b² − 4acSolutionsWhat the parabola does
PositiveTwo different real rootsCrosses the x axis twice
ZeroOne repeated rootTouches the x axis at its vertex
NegativeNo real roots (two complex roots)Never meets the x axis

If the discriminant is a perfect square, such as 25 or 49, the roots are whole numbers or fractions and the quadratic can be factored as well. The factoring calculator factors it for you.

Worked examples you can check in the calculator

Example 1: two roots

Solve 2x² − 7x + 3 = 0. Here a = 2, b = −7 and c = 3.

b^2 - 4ac = (-7)^2 - 4(2)(3) = 49 - 24 = 25
x = \frac{7 \pm \sqrt{25}}{2 \times 2} = \frac{7 \pm 5}{4}

So x = 12 ÷ 4 = 3 or x = 2 ÷ 4 = 0.5. Type 2, −7 and 3 into the calculator and the Intercepts section shows (0.5, 0) and (3, 0).

y = 2{ x}^{2}-7 x+3
-1-0.50.511.522.533.544.5-551015x = 0.5x = 3
Drag to pan, scroll to zoom. x from -1 to 4.5, y from -6.15 to 15.

The two places the curve crosses the x axis are the two solutions.

Example 2: roots with a square root

Solve x² + 2x − 1 = 0, the equation the calculator opens on. a = 1, b = 2, c = −1.

b^2 - 4ac = 2^2 - 4(1)(-1) = 4 + 4 = 8
x = \frac{-2 \pm \sqrt{8}}{2} = \frac{-2 \pm 2\sqrt{2}}{2} = -1 \pm \sqrt{2}

The exact answers are x = −1 + √2 and x = −1 − √2, which are 0.414 and −2.414 to 3 decimal places. The calculator shows the decimals. Simplifying √8 = 2√2 is what lets the 2 cancel.

Example 3: one repeated root

Solve 4x² + 12x + 9 = 0. The discriminant is 12² − 4(4)(9) = 144 − 144 = 0, so the ± adds nothing and there is one root: x = −12 ÷ 8 = −1.5. On the graph, the parabola just touches the x axis at its vertex, (−1.5, 0). The quadratic is a perfect square, (2x + 3)².

Example 4: no real roots

Solve x² − 4x + 13 = 0. The discriminant is (−4)² − 4(1)(13) = 16 − 52 = −36. You can't take the square root of a negative number in the real numbers, so there are no real solutions, and the calculator shows no x-intercepts. The parabola's lowest point is (2, 9), above the axis.

If your course uses complex numbers, write √−36 = 6i and carry on: x = (4 ± 6i) ÷ 2 = 2 ± 3i. In the US, the Common Core standards for high school algebra ask students to write complex solutions from the quadratic formula in the form a ± bi.

Example 5: rearrange first

Solve 3x² = 5x + 1. Move everything to one side first: 3x² − 5x − 1 = 0, so a = 3, b = −5 and c = −1.

x = \frac{5 \pm \sqrt{25 + 12}}{6} = \frac{5 \pm \sqrt{37}}{6}

So x = 1.847 or x = −0.180 to 3 decimal places. Typing 3, 5 and 1 without rearranging would solve a different equation.

Example 6: a word problem

A rectangle is 3 m longer than it is wide, and its area is 50 m². How wide is it? If the width is x, the length is x + 3, so x(x + 3) = 50, which gives x² + 3x − 50 = 0.

x = \frac{-3 \pm \sqrt{9 + 200}}{2} = \frac{-3 \pm \sqrt{209}}{2}

This gives x = 5.728 or x = −8.728. A width can't be negative, so reject that one: the rectangle is 5.73 m wide. Always check both roots against the question.

Try one

Use the quadratic formula on this equation, then press Mark to check your answer in the Algebra course.

Use the quadratic formula to find both roots.

Press Mark to have your answer marked in the Algebra course.

The vertex and the line of symmetry

The two roots sit the same distance either side of the line of symmetry, x = −b ÷ 2a. That is the first part of the quadratic formula on its own, and the ± √ part says how far each root is from it. The vertex is on this line: in example 1, x = 7 ÷ 4 = 1.75, and putting it back in gives y = −3.125, so the vertex is (1.75, −3.125). Min / Max in the calculator gives the same point.

Where the quadratic formula comes from

It comes from completing the square on ax² + bx + c = 0. Divide by a, move c/a across, then add (b/2a)² to both sides:

x^2 + \frac{b}{a}x + \left(\frac{b}{2a}\right)^2 = \left(\frac{b}{2a}\right)^2 - \frac{c}{a}
\left(x + \frac{b}{2a}\right)^2 = \frac{b^2 - 4ac}{4a^2}
x + \frac{b}{2a} = \pm\frac{\sqrt{b^2 - 4ac}}{2a}

Subtract b/2a from both sides and you have the quadratic formula. The Algebra course covers factoring, completing the square and the formula in order.

Common mistakes

  • Not rearranging to = 0 first. a, b and c only mean anything when one side is 0.
  • Losing the sign of b. −b means the opposite of b. If b = −7, then −b = 7.
  • Squaring a negative b wrongly. (−7)² = 49, not −49. Use brackets (parentheses) on your calculator.
  • Dividing only part of the top by 2a. The whole of −b ± √(b² − 4ac) goes over 2a.
  • Writing 2 × a as 2 + a, or forgetting the 2 altogether.
  • Keeping a root the question can't use, such as a negative length or time.

Common questions

What is the quadratic formula?
x = (−b ± √(b² − 4ac)) / 2a. It gives the solutions of any quadratic equation written as ax² + bx + c = 0, where a is not 0.
When should I use the quadratic formula instead of factoring?
When the quadratic doesn't factor easily, which is most of the time. If b² − 4ac is not a perfect square, the roots are irrational and factoring with whole numbers won't work. The formula always works.
What does it mean when the discriminant is negative?
There are no real solutions, and the parabola never crosses the x axis. With complex numbers there are two solutions of the form p ± qi.
Can a be 0?
No. If a = 0 there is no x² term, so the equation is linear (bx + c = 0), and the formula would divide by zero.
Why does the calculator show long decimals?
Most roots are irrational, so they never end. Round to what the question asks for, or give the exact answer with a square root by using the formula by hand.
What are the roots of a quadratic?
The roots, also called zeros or solutions, are the x values that make ax² + bx + c equal 0. On the graph of y = ax² + bx + c they are the x-intercepts, which is why the calculator lists them in the Intercepts section.

Revision cards

Read the front, say your answer, then flip to check.

Where to go next

  • Solve it

    Quadratic Graph

    Plot and analyse quadratic functions

    Open the tool
  • Learn it

    Algebra

    Master equations, inequalities and the language of abstract mathematics

    Start the course
  • Test it

    Geometry, Algebra 2 & SAT Math

    A new exam-style paper every day, with instant marking and a mark scheme

    Start today's paper
Read next
Maths · AlgebraQuadratic equation: what it is and 4 ways to solve itWhat a quadratic equation is, standard, vertex and factored form, and how to solve one by factoring, square roots, completing the square or the formula.