Deriving the Quadratic Formula

Complete the square on the general case.

Completing the square, done once with letters

The quadratic formula says that the solutions of ax² + bx + c = 0 are x = (−b ± √(b² − 4ac))/2a. It comes from completing the square on the general equation, with the letters a, b and c in place of numbers.

Each step below is made twice: first on the equation 2x² + 8x − 10 = 0, then on ax² + bx + c = 0. The letters go through exactly the same moves as the numbers.

Make x² stand alone

Completing the square is easiest when x² has no number in front of it, so divide every term by the leading coefficient. With numbers: dividing 2x² + 8x − 10 = 0 by 2 gives x² + 4x − 5 = 0.

With letters: dividing ax² + bx + c = 0 by a gives x² + (b/a)x + c/a = 0. Dividing by a is allowed because a is not 0: if a were 0, there would be no x² term, and the equation would not be a quadratic at all.

Move the constant across

Subtract the constant term from both sides, so that only the x² and x terms are left on the left. With numbers: x² + 4x = 5. With letters: x² + (b/a)x = −c/a.

Complete the square

Recall that (x + p)² = x² + 2px + p². The coefficient of x is 2p, so p is half the coefficient of x. With numbers: half of 4 is 2, and (x + 2)² = x² + 4x + 4. That is x² + 4x with an extra 4, so add 4 to both sides of x² + 4x = 5: (x + 2)² = 9.

With letters, the coefficient of x is b/a, and half of it is b/2a. Squaring the bracket gives (x + b/2a)² = x² + (b/a)x + b²/4a², because (b/2a)² = b²/4a². So add b²/4a² to both sides of x² + (b/a)x = −c/a: (x + b/2a)² = b²/4a² − c/a.

Whatever is added to the left side must be added to the right side too, or the two sides are no longer equal.

x²3x3x(3)²x + 3

half of bx along each of two sides leaves a corner of side b/2 unfilled, which is why (b/2)² is added and then subtracted; the corner is 9

Make x² + 4x a square: how big is the missing corner?

The x term is split into two equal strips, one along each of two sides of the x² square. The corner that is still missing is a square whose side is half the coefficient of x. Drag the edge until the x term is 4x, as in x² + 4x = 5: the corner is 2² = 4, the number added to both sides. For x² + (b/a)x the corner is (b/2a)² = b²/4a².

Put the right side over one denominator

The right side, b²/4a² − c/a, is two fractions with different denominators. Their common denominator is 4a²: multiply the top and bottom of c/a by 4a to get 4ac/4a². Then b²/4a² − 4ac/4a² = (b² − 4ac)/4a², so the equation is now (x + b/2a)² = (b² − 4ac)/4a².

The top of that fraction, b² − 4ac, is the discriminant. With numbers, a = 2, b = 8 and c = −10, so b² − 4ac = 64 − 4 × 2 × (−10) = 64 + 80 = 144, and 4a² = 4 × 4 = 16. The right side is 144/16 = 9, which matches (x + 2)² = 9.

Take the square root of both sides

Two numbers square to 9: 3² = 9 and (−3)² = 9. So when you take the square root of both sides, write ± in front. With numbers: (x + 2)² = 9 gives x + 2 = ±3.

With letters, the square root of the top is √(b² − 4ac), and the square root of the bottom, 4a², is 2a. So x + b/2a = ±√(b² − 4ac)/2a. Strictly, √(4a²) is 2a only when a is positive; when a is negative it is −2a. The ± already covers both signs, so writing 2a loses nothing.

This step also shows why the discriminant decides how many real solutions there are. If b² − 4ac is negative, it has no real square root, and the equation has no real solutions. If it is 0, adding 0 and subtracting 0 give the same x, so there is one repeated root.

Move b/2a across

Subtract b/2a from both sides: x = −b/2a ± √(b² − 4ac)/2a. Both parts are over 2a, so write them as one fraction: x = (−b ± √(b² − 4ac))/2a. That is the quadratic formula.

With numbers: x + 2 = ±3 gives x = −2 + 3 = 1 or x = −2 − 3 = −5. The formula gives the same answers. With a = 2, b = 8 and c = −10, the discriminant is 144 and √144 = 12, so x = (−8 ± 12)/4. That is 4/4 = 1 or −20/4 = −5.

Because every step was made on the letters, the formula works for every quadratic equation. You never have to complete the square again to solve one; the formula has done it already.

The usual mistakes

Adding b²/4a² to the left side only. The bracket (x + b/2a)² brings in b²/4a², so the same amount must be added to the right side.

Leaving out the ±. Taking the square root of both sides gives two possibilities, + and −, and dropping one loses a solution.

Putting only the square root over 2a, as in −b ± √(b² − 4ac)/2a. The −b is divided by 2a as well, so the whole top, −b ± √(b² − 4ac), sits over 2a.

Writing an area as an equation

The application below starts from a sheet of paper with a margin of the same width, x cm, all the way around the printing. The margin takes x off each end of every side, so each side of the printing is 2x shorter than the side of the sheet. On a sheet 60 cm by 40 cm, the printing is (60 − 2x) cm by (40 − 2x) cm.

Its area is length times width, (60 − 2x)(40 − 2x). Setting that equal to the area the printing must have gives an equation, and expanding the brackets turns it into a quadratic equation. Part (b) then makes the same moves with the letters L, W and A in place of the numbers.

Worked example: Equal Margins Around a Poster with Half the Sheet Printed, and a Formula for Any Sheet

Question A designer lays out a poster on a sheet 60 cm long and 40 cm wide. The printing fills a rectangle in the middle, with a blank margin of the same width, x cm, all the way around it, and the printing must cover exactly half of the sheet. (a) Complete the square to find the width of the margin, correct to 2 decimal places. (b) The designer wants one formula for every job. For a sheet L cm long and W cm wide with a printed area of A cm2, complete the square to find x in terms of L, W and A, and say which of the two roots is the margin.

  1. 1.Let the margin be x cm. It runs along both ends of each side, so the printed rectangle is (60 − 2x) cm by (40 − 2x) cm. The sheet covers 60 × 40 = 2400 cm2, and half of it is 1200 cm2, so (60 − 2x)(40 − 2x) = 1200.

    printed1200 cm260 cm40 cmx(60 − 2x)(40 − 2x)=1200
    printed1200 cm260 cm40 cmx(60 − 2x)(40 − 2x)=1200
    The margin takes 2x cm off each side, and half of 60 × 40 = 2400 cm2 is printed: (60 − 2x)(40 − 2x) = 1200.
  2. 2.Expand: 2400 − 120x − 80x + 4x2 = 1200, which is 4x2 − 200x + 2400 = 1200. Subtract 1200 from both sides and divide both sides by 4: x2 − 50x + 300 = 0. Then move the constant across: x2 − 50x = −300.

    printed1200 cm260 cm40 cmx(60 − 2x)(40 − 2x)=12004x2− 200x + 2400=1200expand the bracketsx2− 50x + 300=0subtract 1200, then divide by 4x2− 50x=−300subtract 300 from both sides
    printed1200 cm260 cm40 cmx(60 − 2x)(40 − 2x)=1200expand the brackets4x2− 200x + 2400=1200subtract 1200, then divide by 4x2− 50x + 300=0subtract 300 from both sidesx2− 50x=−300
    Expand, subtract 1200, divide both sides by 4, then move the constant across: x2 − 50x = −300.
  3. 3.Complete the square. Half of 50 is 25, and (x − 25)2 = x2 − 50x + 625, so add 625 to both sides: (x − 25)2 = 325. Take the square root of both sides, with both signs: x − 25 = ±√325, so x = 25 ± √325, and √325 ≈ 18.028.

    printed1200 cm260 cm40 cmx(60 − 2x)(40 − 2x)=12004x2− 200x + 2400=1200expand the bracketsx2− 50x + 300=0subtract 1200, then divide by 4x2− 50x=−300subtract 300 from both sides(x − 25)2=325add 625 to both sidesx − 25=±√325take the square rootx = 25 ± 18.028
    printed1200 cm260 cm40 cmx(60 − 2x)(40 − 2x)=1200expand the brackets4x2− 200x + 2400=1200subtract 1200, then divide by 4x2− 50x + 300=0subtract 300 from both sidesx2− 50x=−300add 625 to both sides(x − 25)2=325take the square rootx − 25=±√325x = 25 ± 18.028
    Half of 50 is 25, so add 252 = 625 to both sides: (x − 25)2 = 325, and x = 25 ± √325.
  4. 4.This gives x ≈ 6.972 or x ≈ 43.028. Two margins of 43.028 cm cannot fit across a sheet only 40 cm wide, so that root is rejected. (a) The margin is 6.97 cm wide, correct to 2 decimal places. Check: 60 − 2x = 10 + 2√325 and 40 − 2x = 2√325 − 10, and their product is 4 × 325 − 100 = 1200.

    printed1200 cm260 cm40 cmx = 6.97 cm(60 − 2x)(40 − 2x)=12004x2− 200x + 2400=1200expand the bracketsx2− 50x + 300=0subtract 1200, then divide by 4x2− 50x=−300subtract 300 from both sides(x − 25)2=325add 625 to both sidesx − 25=±√325take the square rootx ≈ 6.972 or x ≈ 43.028x ≈ 43.028 is rejected: wider than the sheetthe margin is 6.97 cm
    printed1200 cm260 cm40 cmx = 6.97 cm(60 − 2x)(40 − 2x)=1200expand the brackets4x2− 200x + 2400=1200subtract 1200, then divide by 4x2− 50x + 300=0subtract 300 from both sidesx2− 50x=−300add 625 to both sides(x − 25)2=325take the square rootx − 25=±√325x ≈ 6.972 or x ≈ 43.028x ≈ 43.028 is rejected: wider than the sheetthe margin is 6.97 cm
    (a) x ≈ 6.972 or x ≈ 43.028. Two margins of 43.028 cm do not fit on a sheet 40 cm wide, so the margin is 6.97 cm.
  5. 5.(b) Make the same moves with letters. (L − 2x)(W − 2x) = A expands to 4x2 − 2(L + W)x + LW − A = 0. Divide both sides by 4 and move the constant across: x2 − L + W2x = A − LW4. Half of L + W2 is L + W4, so add its square, (L + W)216, to both sides: (x − L + W4)2 = (L + W)2 − 4LW + 4A16 = (L − W)2 + 4A16.

    printedA cm2L cmW cmx(L − 2x)(W − 2x)=A4x2− 2(L + W)x + LW − A=0expand, then subtract Ax2− (L + W)x/2=(A − LW)/4divide by 4, move the constant(x − (L + W)/4)2=((L − W)2+ 4A)/16add the square of (L + W)/4
    printedA cm2L cmW cmx(L − 2x)(W − 2x)=Aexpand, then subtract A4x2− 2(L + W)x + LW − A=0divide by 4, move the constantx2− (L + W)x/2=(A − LW)/4add the square of (L + W)/4(x − (L + W)/4)2=((L − W)2+ 4A)/16
    The same moves with letters: divide by 4, move the constant across, then add (L + W4)2 to both sides.
  6. 6.Take the square root of both sides: x = L + W ± √(L − W)2 + 4A4. Because 4A is positive, the square root is more than W − L, so the root with + is more than L + W + W − L4 = W2, and two margins that wide are wider than the sheet. (b) The margin is x = L + W − √(L − W)2 + 4A4, the root with the minus sign. Check: with L = 60, W = 40 and A = 1200 it gives 100 − √52004 ≈ 6.97 cm, as in (a).

    printedA cm2L cmW cmx(L − 2x)(W − 2x)=A4x2− 2(L + W)x + LW − A=0expand, then subtract Ax2− (L + W)x/2=(A − LW)/4divide by 4, move the constant(x − (L + W)/4)2=((L − W)2+ 4A)/16add the square of (L + W)/4x=(L + W ± r)/4take the square rootwhere r2= (L − W)2+ 4A and r > 0x = (L + W + r)/4 is rejected: more than W/2x = (L + W − r)/4check: r =√5200≈ 72.11, x ≈ 6.97
    printedA cm2L cmW cmx(L − 2x)(W − 2x)=Aexpand, then subtract A4x2− 2(L + W)x + LW − A=0divide by 4, move the constantx2− (L + W)x/2=(A − LW)/4add the square of (L + W)/4(x − (L + W)/4)2=((L − W)2+ 4A)/16take the square rootx=(L + W ± r)/4where r2= (L − W)2+ 4A and r > 0x = (L + W + r)/4 is rejected: more than W/2x = (L + W − r)/4check: r =√5200≈ 72.11, x ≈ 6.97
    (b) x = L + W − √(L − W)2 + 4A4. The root with + is more than W2, so its two margins are wider than the sheet.

Answer: (a) 6.97 cm; (b) x = L + W − √(L − W)2 + 4A4, the root with the minus sign

Common mistakes

  • Writing the printed rectangle as (60 − x) cm by (40 − x) cm. The margin runs along both ends of each side, so each side of the printing is 2x shorter than the sheet.
  • Adding 25, or adding 625 to the left-hand side only. Completing the square adds the square of half the coefficient of x, which is 252 = 625, and whatever is added to one side must be added to the other.

More quadratic equations problems, worked step by step →

Practice Deriving the Quadratic Formula in the app