Quadratic equation solver, step by step

A quadratic equation has the form ax² + bx + c = 0, where a is not 0. Below you’ll find the three standard ways to solve one, each with a fully worked example, and a free box where Algegram solves your own equation and explains every step.

Which method should you use?

Before you start, always rearrange so one side is 0. For example, x² = 3x + 4 becomes x² − 3x − 4 = 0. Then read off a, b and c, including their signs. Sign mistakes with b and c cause most wrong answers.

Three worked examples

Example 1: Solve by factoring

x² + 5x + 6 = 0

  1. Find two numbers that multiply to 6 and add to 5: 2 and 3
    For x² + bx + c, we need numbers whose product is c and whose sum is b. 2 × 3 = 6 and 2 + 3 = 5.
  2. (x + 2)(x + 3) = 0
    Write the quadratic as a product of two brackets.
  3. x + 2 = 0 or x + 3 = 0
    If two things multiply to 0, at least one of them must be 0.
  4. x = −2 or x = −3
    Solve each small equation.

Answer: x = −2 or x = −3

Check: (−2)² + 5(−2) + 6 = 4 − 10 + 6 = 0 ✓ and (−3)² + 5(−3) + 6 = 9 − 15 + 6 = 0 ✓

Example 2: Solve with the quadratic formula

2x² + 5x − 3 = 0

  1. a = 2, b = 5, c = −3
    Match the equation to ax² + bx + c = 0.
  2. b² − 4ac = 5² − 4(2)(−3) = 25 + 24 = 49
    Work out the discriminant first. It is positive, so there are two real solutions.
  3. x = (−5 ± √49) / (2 × 2) = (−5 ± 7) / 4
    Substitute into x = (−b ± √(b² − 4ac)) / 2a. √49 = 7.
  4. x = (−5 + 7)/4 = 2/4 = 1/2
    Take the + sign.
  5. x = (−5 − 7)/4 = −12/4 = −3
    Take the − sign.

Answer: x = 1/2 or x = −3

Check: 2(1/2)² + 5(1/2) − 3 = 0.5 + 2.5 − 3 = 0 ✓ and 2(−3)² + 5(−3) − 3 = 18 − 15 − 3 = 0 ✓

Example 3: Solve by completing the square

x² − 6x + 2 = 0

  1. x² − 6x = −2
    Move the constant to the right side.
  2. x² − 6x + 9 = −2 + 9
    Half of −6 is −3, and (−3)² = 9. Add 9 to both sides.
  3. (x − 3)² = 7
    The left side is now a perfect square.
  4. x − 3 = ±√7
    Take the square root of both sides, remembering ±.
  5. x = 3 + √7 or x = 3 − √7
    Add 3 to both sides. As decimals, about 5.646 and 0.354.

Answer: x = 3 ± √7

Check: (3 + √7)² − 6(3 + √7) + 2 = (16 + 6√7) − (18 + 6√7) + 2 = 0 ✓ (the − case works the same way)

The quadratic formula

For any equation ax² + bx + c = 0, the solutions are x = (−b ± √(b² − 4ac)) / 2a. The part under the square root, b² − 4ac, is called the discriminant, and it tells you what kind of answers to expect:

How to check your answer

Substitute each solution back into the original equation. If the left side comes out to exactly 0, the solution is correct. This takes under a minute and catches almost every arithmetic slip. Each example above ends with this check. A second quick test: for ax² + bx + c = 0, the two solutions always add to −b/a and multiply to c/a. In Example 2, 1/2 + (−3) = −5/2 and (1/2)(−3) = −3/2, which match −5/2 and −3/2.

Common mistakes

Solve your own quadratic with steps

Type your equation exactly as it appears in your homework, for example “solve 3x² − 2x − 8 = 0”. Algegram shows each step and the reason for it, so you can follow the method rather than just copy an answer. You can also ask it to use a specific method, like “solve by completing the square”. Working on simpler equations first? See the fraction calculator with steps.