How-to guides · 3 min read

Quadratic Formula Step by Step: Worked Examples

Quadratic Formula Step by Step: Worked Examples — illustration
In short: The quadratic formula x = (−b ± √(b² − 4ac)) ÷ 2a solves any equation of the form ax² + bx + c = 0. For x² − 3x − 4 = 0 it gives x = 4 or x = −1.

The formula and when to use it

A quadratic equation has an x² term and can be written as ax² + bx + c = 0, with a ≠ 0. The quadratic formula gives the solutions directly from the three coefficients: x = (−b ± √(b² − 4ac)) ÷ (2a). The ± sign means you work out two answers, one with plus and one with minus.

Use it whenever factoring is not obvious. It always works, which makes it the safest choice. If you are curious where it comes from, read the quadratic formula: where it comes from, and for the wider picture see the guide to solving quadratic equations.

Five steps every time

  • 1. Rearrange the equation so one side is zero: ax² + bx + c = 0.
  • 2. Identify a, b and c, including their signs.
  • 3. Compute the discriminant D = b² − 4ac.
  • 4. Substitute into x = (−b ± √D) ÷ 2a.
  • 5. Simplify and check each answer in the original equation.

The discriminant D tells you what to expect before you go further. If D is positive there are two real solutions. If D is zero there is one repeated solution. If D is negative there are no real solutions, only complex ones.

Discriminant D = b² − 4acNumber of real solutionsGraph
D > 0TwoCrosses the x-axis twice
D = 0One (repeated)Touches the x-axis once
D < 0NoneDoes not reach the x-axis

Example 1: two solutions

Solve x² − 3x − 4 = 0. Here a = 1, b = −3 and c = −4.

  • D = (−3)² − 4(1)(−4) = 9 + 16 = 25
  • x = (3 ± √25) ÷ 2 = (3 ± 5) ÷ 2
  • x = 8 ÷ 2 = 4, or x = −2 ÷ 2 = −1
Live solver: x² − 3x − 4 = 0
Answer x = 4 or x = −1
  • Factored form: (x − 4)(x + 1)
  • Discriminant D = 25
  • Vertex: (1.5, −6.25)
Step-by-step working 6 steps
  1. 1
    Identify a, b and c
    x² − 3x − 4 = 0
    a = 1,  b = −3,  c = −4
  2. 2
    Calculate the discriminant
    D = b² − 4ac = (−3)² − 4(1)(−4) = 25

    D is positive: two different real roots.

  3. 3
    Apply the quadratic formula
    x = (−b ± √D) / 2a = (3 ± √25) / 2 = (3 ± 5) / 2
  4. 4
    Solve for both roots
    x₁ = 4
    x₂ = −1
  5. 5
    Check by substitution
    f(4) = 0
    f(−1) = 0

    Both should be 0 (allowing for tiny rounding).

  6. 6
    Vertex of the parabola
    x = −b / 2a = 1.5,  y = −6.25  →  vertex (1.5, −6.25)

    The parabola opens upward, so the vertex is the minimum point.

Check x = 4: 16 − 12 − 4 = 0 ✓. Check x = −1: 1 + 3 − 4 = 0 ✓. Because D = 25 is a perfect square, the answers are whole numbers, which also means this one could have been factored as (x − 4)(x + 1).

Example 2: a leading coefficient other than 1

Solve 2x² + 3x − 2 = 0. Now a = 2, b = 3, c = −2.

  • D = 3² − 4(2)(−2) = 9 + 16 = 25
  • x = (−3 ± 5) ÷ 4
  • x = 2 ÷ 4 = 1/2, or x = −8 ÷ 4 = −2
Live solver: 2x² + 3x − 2 = 0
Answer x = 0.5 or x = −2
  • Factored form: 2(x − 0.5)(x + 2)
  • Discriminant D = 25
  • Vertex: (−0.75, −3.125)
Step-by-step working 6 steps
  1. 1
    Identify a, b and c
    2x² + 3x − 2 = 0
    a = 2,  b = 3,  c = −2
  2. 2
    Calculate the discriminant
    D = b² − 4ac = (3)² − 4(2)(−2) = 25

    D is positive: two different real roots.

  3. 3
    Apply the quadratic formula
    x = (−b ± √D) / 2a = (−3 ± √25) / 4 = (−3 ± 5) / 4
  4. 4
    Solve for both roots
    x₁ = 0.5
    x₂ = −2
  5. 5
    Check by substitution
    f(0.5) = 0
    f(−2) = 0

    Both should be 0 (allowing for tiny rounding).

  6. 6
    Vertex of the parabola
    x = −b / 2a = −0.75,  y = −3.125  →  vertex (−0.75, −3.125)

    The parabola opens upward, so the vertex is the minimum point.

Do not forget that the denominator is 2a = 4, not just a. A frequent error is dividing only the square root by 2a.

Example 3: one repeated solution

Solve x² − 6x + 9 = 0. Here D = (−6)² − 4(1)(9) = 36 − 36 = 0, so the square root term disappears.

Live solver: x² − 6x + 9 = 0
Answer x = 3 (double root)
  • Discriminant D = 0
  • Vertex: (3, 0)
Step-by-step working 4 steps
  1. 1
    Identify a, b and c
    x² − 6x + 9 = 0
    a = 1,  b = −6,  c = 9
  2. 2
    Calculate the discriminant
    D = b² − 4ac = (−6)² − 4(1)(9) = 0

    D is zero: one repeated real root.

  3. 3
    One repeated root
    x = −b / 2a = 6 / 2 = 3
  4. 4
    Vertex of the parabola
    x = −b / 2a = 3,  y = 0  →  vertex (3, 0)

    The parabola opens upward, so the vertex is the minimum point.

The only solution is x = 6 ÷ 2 = 3. This equation is a perfect square, (x − 3)² = 0, and its graph just touches the x-axis at x = 3.

Example 4: no real solutions

Solve x² + 2x + 5 = 0. D = 2² − 4(1)(5) = 4 − 20 = −16, which is negative.

Live solver: x² + 2x + 5 = 0
Answer x = −1 ± 2i
  • No real x-intercepts: the parabola never crosses the x-axis.
  • Discriminant D = −16
  • Vertex: (−1, 4)
Step-by-step working 4 steps
  1. 1
    Identify a, b and c
    x² + 2x + 5 = 0
    a = 1,  b = 2,  c = 5
  2. 2
    Calculate the discriminant
    D = b² − 4ac = (2)² − 4(1)(5) = −16

    D is negative: no real roots — two complex roots.

  3. 3
    Complex roots
    x = (−2 ± √16·i) / 2
    x = −1 ± 2i

    The square root of a negative number introduces i, where i² = −1.

  4. 4
    Vertex of the parabola
    x = −b / 2a = −1,  y = 4  →  vertex (−1, 4)

    The parabola opens upward, so the vertex is the minimum point.

You cannot take the square root of a negative number within the real numbers, so there are no real solutions. In courses that include complex numbers, the answers are written as x = −1 ± 2i.

−105203550−0.50.51.52.53.5x² − 3x − 4x² + 2x + 5x
x² − 3x − 4 crosses the x-axis (two solutions); x² + 2x + 5 stays above it (none).

Putting the equation in standard form first

The formula needs the equation set equal to zero. Solve x² + 4x = 5: subtract 5 from both sides to get x² + 4x − 5 = 0, so a = 1, b = 4, c = −5. Then D = 16 + 20 = 36, and x = (−4 ± 6) ÷ 2, which gives x = 1 or x = −5.

The "plus" solution of x² + 4x − 5 = 0
Answer1
Order-of-operations steps 4 steps

Start: (−4 + √(36)) ÷ 2

  1. Square root
    √(36) = 6→ (−4 + 6) ÷ 2
  2. Negate
    −4 = −4→ (−4 + 6) ÷ 2
  3. Add
    −4 + 6 = 2→ 2 ÷ 2
  4. Divide
    2 ÷ 2 = 1→ 1

If a term is missing, its coefficient is 0. For 3x² − 12 = 0, b = 0, so D = 0 − 4(3)(−12) = 144 and x = ±12 ÷ 6 = ±2.

Common mistakes and how to avoid them

  • Sign of b. If b is −3, then −b is +3, and b² is +9, not −9.
  • Dropping a negative c. With c = −4, the term −4ac becomes +16 when a = 1.
  • Dividing wrongly. The whole numerator (−b ± √D) is divided by 2a.
  • Forgetting the second root. The ± means two solutions unless D = 0.
  • Not rearranging to zero first.

You can check every step of your own examples in the quadratic equation solver, which also shows the factored form and the vertex. When the equation factors easily, factoring trinomials can be quicker, and the algebra formulas cheat sheet keeps the formula handy.

Frequently asked questions

When should I use the quadratic formula instead of factoring?

Use it whenever factoring is not obvious or the numbers are awkward. It works for every quadratic equation.

What is the discriminant?

It is the expression b² − 4ac under the square root. It tells you whether there are two, one or no real solutions.

Can a quadratic have only one solution?

Yes, when the discriminant is zero. The graph touches the x-axis at a single point.

What if a = 0?

Then the equation is not quadratic; it is linear and can be solved with simple inverse operations.

Written and reviewed by Mateuss M.

Mateuss M. writes and reviews mathematical content for CalcSolver, focusing on online calculators, formulas, equations, and practical math tools. He reviews calculator functionality, calculation methods, formulas, examples, and explanations to help ensure that each tool is clear, useful, and easy to understand.

Keep reading