The idea of completing the square stems from the following result

x^{2} + bx = (x + b/2)^{2} - (b/2) ^{2}

The above could be applied to any quadratic expression such as

__Example 1__

x^{2} + 4x = (x + 4/2)^{2} - (4/2) ^{2} = (x + 2)^{2} - 4

__Example 2__

x^{2} + 2x + 5 = (x + 2/2)^{2} - (2/2) ^{2} + 5 = (x + 1)^{2} - 1 + 5 = (x + 1)^{2} + 4

When completing the square when the leading coefficient is not equal to 1, we factor out the leading coefficient and work inside the brackets.

__Example 3__

2x^{2} - 12x = 2[ x^{2} - 6x ]

= 2[ (x + (-6/2) )^{2} - (-6/2)^{2} ]

= 2[ (x - 3 )^{2} - 9 ]

= 2(x - 3 )^{2} - 18

__Example 4__

-x^{2} - 10x = - [ x^{2} + 10x ]

= -[ (x + 10/2)^{2} - (10/2)^{2} ]

= - [ (x + 5)^{2} - 25 ]

= -(x + 5)^{2} + 25

__Example 5__

-2x^{2} - 3x = -2 [ x^{2} + (3/2) x ]

= -2 [ (x + (3/4))^{2} - (3/4)^{2} ]

= -2 (x + (3/4))^{2} + 9/8

When completing the square, leave any constant term outside the brackets.

__Example 6__

-3x^{2} + 2x + 2 = -3 [ x^{2} - (2/3) x ] + 2

= -3 [ (x + (-2/6))^{2} - (-2/6)^{2} ] + 2

= -3 [ (x - 1/3))^{2} - (-1/3)^{2} ] + 2

= -3 [ (x - 1/3))^{2} - 1/9 ] + 2

= -3 (x - 1/3))^{2} + 1/3 + 2

= -3 (x - 1/3))^{2} + 7/3
**Exercise:**Complete the square for the follwoing quadratic expressions

(answers given below)

A) x^{2} + 4x

B) x^{2} + 6x - 3

C) -x^{2} - 4x + 2

D) -2x^{2} - 5x - 5

__Solutions to Exercises Above :__

A) x^{2} + 4x = (x + 2)^{2} - 4

B) x^{2} + 6x - 3 = (x + 3)^{2} - 12

C) -x^{2} - 4x + 2 = -(x + 2)^{2} + 6

D) -2x^{2} - 5x - 5 = -2(x + 5/4)^{2} - 15/8

More references and links on the quadratic functions in this website.