Completing the Square, Quadratic Formula and Discriminant

Completing the square rewrites ax2 + bx + c as a perfect square plus a constant, and applying it to the general equation gives the quadratic formula x = (−b ± √(b2 − 4ac))/(2a). In brief: the expression D = b2 − 4ac is the discriminant. If D > 0 there are two real solutions, if D = 0 there is one, and if D < 0 there is no real solution. For x2 − 4x − 5 = 0, D = 36 and x = (4 ± 6)/2, so x = 5 or −1.

These methods solve every quadratic equation, including those that do not factor with integers. The quadratic formula is a ready-made recipe, while completing the square explains where it comes from and gives the vertex form of a parabola. This guide shows both methods step by step, derives the formula, explains the discriminant and gives a table with solved examples.

How do you complete the square?

The identity (x + p)2 = x2 + 2px + p2 shows that x2 + bx becomes a perfect square after adding (b/2)2.

  1. Divide the equation by a so that the coefficient of x2 is 1.
  2. Move the constant term to the right side.
  3. Add (b/2)2 to both sides.
  4. Write the left side as a square and take square roots.
  5. Solve for x.

Example 1: x2 + 6x − 7 = 0

x2 + 6x = 7. Add (6/2)2 = 9: x2 + 6x + 9 = 16, so (x + 3)2 = 16. Then x + 3 = ±4, so x = 1 or x = −7.

Example 2: 2x2 − 8x + 3 = 0

Divide by 2: x2 − 4x + 3/2 = 0, so x2 − 4x = −3/2. Add 4: (x − 2)2 = 5/2. Then x = 2 ± √(5/2) = 2 ± √10/2. Numerically x ≈ 3.58 or 0.42.

What is the quadratic formula and where does it come from?

Apply the steps to ax2 + bx + c = 0. Divide by a: x2 + (b/a)x = −c/a. Add (b/(2a))2: (x + b/(2a))2 = b2/(4a2) − c/a = (b2 − 4ac)/(4a2). Take square roots: x + b/(2a) = ±√(b2 − 4ac)/(2a). Therefore

x = (−b ± √(b2 − 4ac)) / (2a)

To use it, first write the equation in standard form and identify a, b and c with their signs. The sum of the two solutions is −b/a and their product is c/a.

What does the discriminant tell you?

The expression D = b2 − 4ac under the root decides the type of the solutions.

On the graph, D > 0 means that the parabola crosses the x-axis twice, D = 0 means that its vertex touches the axis and D < 0 means that it does not meet it.

Worked examples

Example 3: x2 − 4x − 5 = 0

a = 1, b = −4, c = −5. D = 16 + 20 = 36. x = (4 ± 6)/2, so x = 5 or x = −1. Check: 25 − 20 − 5 = 0 ✓.

Example 4: 3x2 + 2x − 4 = 0

D = 4 + 48 = 52. x = (−2 ± √52)/6 = (−2 ± 2√13)/6 = (−1 ± √13)/3. Numerically x ≈ 0.869 or −1.535.

Example 5: 4x2 − 12x + 9 = 0

D = 144 − 144 = 0. x = 12/8 = 3/2, a double root. Indeed, 4x2 − 12x + 9 = (2x − 3)2.

Example 6: x2 + 2x + 5 = 0

D = 4 − 20 = −16 < 0. There are no real solutions. The parabola has its minimum at (−1, 4), above the x-axis.

Example 7: with a parameter in the answer

For x2 − 6x + k = 0 to have a real solution, D = 36 − 4k ≥ 0, so k ≤ 9. For k = 9, the solution is x = 3 (double).

Discriminant table

Discriminant and solutions for sample quadratic equations
Equation a, b, c D Solutions
x2 − 4x − 5 = 01, −4, −5365 and −1
x2 − 6x + 9 = 01, −6, 903 (double)
x2 + 2x + 5 = 01, 2, 5−16none (real)
2x2 − 7x + 3 = 02, −7, 3253 and 1/2
x2 − 2x − 1 = 01, −2, −181 ± √2
3x2 + 2x − 4 = 03, 2, −452(−1 ± √13)/3

Where do these methods come from?

Babylonian scribes solved quadratic problems using the equivalent of completing the square. Al-Khwarizmi described the geometric version in the ninth century, drawing squares and rectangles. The Indian mathematician Brahmagupta stated a rule equivalent to the quadratic formula in the seventh century, and the modern symbolic form was established in Europe in the seventeenth century. The word “discriminant” was introduced by James Joseph Sylvester in the nineteenth century.

Where are they used today?

The time at which a ball thrown upward at 15 m/s from a height of 2 m hits the ground solves −4.9t2 + 15t + 2 = 0. The formula gives t = (−15 − √(225 + 39.2))/(−9.8) ≈ 3.19 s (the positive root). Computers use the formula for solving quadratic equations in graphics, physics engines and signal processing. Completing the square is also used to find the vertex of a parabola and in integration.

Which mistakes are common?

Sign errors with b

For b = −4, −b = 4. Write the values of a, b and c with their signs before substituting.

Forgetting that the denominator is 2a

The division by 2a applies to the whole numerator, not only to the root.

Wrong constant when completing the square

Add (b/2)2 to both sides, and make sure the coefficient of x2 is 1 first.

Treating D < 0 as an error

A negative discriminant is a valid result. It means there are no real solutions.