Completing the square is quite simply ingenious and you'll find it incredibly useful later on in your studies.
Again, we're just going to be changing the form of an expression, this time
from \(~x^2+bx+c~\) to \(~(x+p)^2+q~\). If you're thinking
of taking advanced level maths, you want to be able to do this in your sleep!

SECTION A

Let's say you're asked to write \(~x^2+10x+22~\) in the form \(~(x+p)^2+q~\).

The method

You need three values:

\(⊘~\) Half the coefficient of \(~x~\) ⇒ \(~+5~\)

\(■~\) \(~(+5)^2=25~\)

\(□~\) The constant term ⇒ \(~+22~\)

Which you arrange like this:

\(~(x~~~~~~⊘)^2-■~~~~~~□\)

In this case, \(~(x+5)^2-25+22~\)

Which simplifies to \(~(x+5)^2-3~\) so \(~p=5~\) and \(~q=-3~\)

Important

The sign in front of \(~■~\) is ALWAYS a minus sign.

Either sign in the final answer can turn out to be positive or negative.

Sometimes you're asked to state the values of \(~p~\) and \(~q~\) with your answer.
We'll do that here just to get you into the habit! They're quite special values actually
when it comes to sketching graphs. Anyway, back to it ...

Another example

Express \(~x^2-8x+21~\) in the form \(~(x+p)^2+q~\)

Half the coefficient of \(~x~\) is \(~-4~\)

\(~(-4)^2=16~\)

The constant term is \(~+21~\)

So we have \(~(x-4)^2-16+21~\)

Which simplifies to \(~(x-4)^2+5~\) where \(~p=-4~\) and \(~q=5~\)

The following questions should help you to grasp this method.

Practise to master

SECTION A

Write these expressions in the form \(~(x+p)^2+q~\) and state the values of \(~p~\) and \(~q~\).

01) \(~x^2+2x+9~\)

Half the coefficient of \(~x~\) is \(~+1~\)
\(~(+1)^2=1~\)
The constant term is \(~+9~\)
So we have \(~(x+1)^2-1+9~\)
Which simplifies to \(~(x+1)^2+8~\) so \(~p=1~\) and \(~q=8~\)

02) \(~x^2+6x+7~\)

Half the coefficient of \(~x~\) is \(~+3~\)
\(~(+3)^2=9~\)
The constant term is \(~+7~\)
So we have \(~(x+3)^2-9+7~\)
Which simplifies to \(~(x+3)^2-2~\) so \(~p=3~\) and \(~q=-2~\)

03) \(~x^2+8x+10~\)

Half the coefficient of \(~x~\) is \(~+4~\)
\(~(+4)^2=16~\)
The constant term is \(~+10~\)
So we have \(~(x+4)^2-16+10~\)
Which simplifies to \(~(x+4)^2-6~\) so \(~p=4~\) and \(~q=-6~\)

04) \(~x^2+4x+15~\)

Half the coefficient of \(~x~\) is \(~+2~\)
\(~(+2)^2=4~\)
The constant term is \(~+15~\)
So we have \(~(x+2)^2-4+15~\)
Which simplifies to \(~(x+2)^2+11~\) so \(~p=2~\) and \(~q=11~\)

05) \(~x^2+6x+12~\)

Half the coefficient of \(~x~\) is \(~+3~\)
\(~(+3)^2=9~\)
The constant term is \(~+12~\)
So we have \(~(x+3)^2-9+12~\)
Which simplifies to \(~(x+3)^2+3~\) so \(~p=3~\) and \(~q=3~\)

06) \(~x^2-8x+5~\)

Half the coefficient of \(~x~\) is \(~-4~\)
\(~(-4)^2=16~\)
The constant term is \(~+5~\)
So we have \(~(x-4)^2-16+5~\)
Which simplifies to \(~(x-4)^2-11~\) so \(~p=-4~\) and \(~q=-11~\)

07) \(~x^2+2x-6~\)

Half the coefficient of \(~x~\) is \(~+1~\)
\(~(+1)^2=1~\)
The constant term is \(~-6~\)
So we have \(~(x+1)^2-1-6~\)
Which simplifies to \(~(x+1)^2-7~\) so \(~p=1~\) and \(~q=-7~\)

08) \(~x^2-4x-8~\)

Half the coefficient of \(~x~\) is \(~-2~\)
\(~(-2)^2=4~\)
The constant term is \(~-8~\)
So we have \(~(x-2)^2-4-8~\)
Which simplifies to \(~(x-2)^2-12~\) so \(~p=-2~\) and \(~q=-12~\)

09) \(~x^2-6x+13~\)

Half the coefficient of \(~x~\) is \(~-3~\)
\(~(-3)^2=9~\)
The constant term is \(~+13~\)
So we have \(~(x-3)^2-9+13~\)
Which simplifies to \(~(x-3)^2+4~\) so \(~p=-3~\) and \(~q=4~\)

10) \(~x^2+2x-1~\)

Half the coefficient of \(~x~\) is \(~+1~\)
\(~(+1)^2=1~\)
The constant term is \(~-1~\)
So we have \(~(x+1)^2-1-1~\)
Which simplifies to \(~(x+1)^2-2~\) so \(~p=1~\) and \(~q=-2~\)

11) \(~x^2-4x-18~\)

Half the coefficient of \(~x~\) is \(~-2~\)
\(~(-2)^2=4~\)
The constant term is \(~-18~\)
So we have \(~(x-2)^2-4-18~\)
Which simplifies to \(~(x-2)^2-22~\) so \(~p=-2~\) and \(~q=-22~\)

12) \(~x^2+8x+3~\)

Half the coefficient of \(~x~\) is \(~+4~\)
\(~(+4)^2=16~\)
The constant term is \(~+3~\)
So we have \(~(x+4)^2-16+3~\)
Which simplifies to \(~(x+4)^2-13~\) so \(~p=4~\) and \(~q=-13~\)

13) \(~x^2+2x-4~\)

Half the coefficient of \(~x~\) is \(~+1~\)
\(~(+1)^2=1~\)
The constant term is \(~-4~\)
So we have \(~(x+1)^2-1-4~\)
Which simplifies to \(~(x+1)^2-5~\) so \(~p=1~\) and \(~q=-5~\)

14) \(~x^2-4x-2~\)

Half the coefficient of \(~x~\) is \(~-2~\)
\(~(-2)^2=4~\)
The constant term is \(~-2~\)
So we have \(~(x-2)^2-4-2~\)
Which simplifies to \(~(x-2)^2-6~\) so \(~p=-2~\) and \(~q=-6~\)

15) \(~x^2+6x+11~\)

Half the coefficient of \(~x~\) is \(~+3~\)
\(~(+3)^2=9~\)
The constant term is \(~+11~\)
So we have \(~(x+3)^2-9+11~\)
Which simplifies to \(~(x+3)^2+2~\) so \(~p=3~\) and \(~q=2~\)

16) \(~x^2-8x+14~\)

Half the coefficient of \(~x~\) is \(~-4~\)
\(~(-4)^2=16~\)
The constant term is \(~+14~\)
So we have \(~(x-4)^2-16+14~\)
Which simplifies to \(~(x-4)^2-2~\) so \(~p=-4~\) and \(~q=-2~\)

17) \(~x^2-2x-1~\)

Half the coefficient of \(~x~\) is \(~-1~\)
\(~(-1)^2=1~\)
The constant term is \(~-1~\)
So we have \(~(x-1)^2-1-1~\)
Which simplifies to \(~(x-1)^2-2~\) so \(~p=-1~\) and \(~q=-2~\)

18) \(~x^2+6x+3~\)

Half the coefficient of \(~x~\) is \(~+3~\)
\(~(+3)^2=9~\)
The constant term is \(~+3~\)
So we have \(~(x+3)^2-9+3~\)
Which simplifies to \(~(x+3)^2-6~\) so \(~p=3~\) and \(~q=-6~\)

19) \(~x^2-8x+6~\)

Half the coefficient of \(~x~\) is \(~-4~\)
\(~(-4)^2=16~\)
The constant term is \(~+6~\)
So we have \(~(x-4)^2-16+6~\)
Which simplifies to \(~(x-4)^2-10~\) so \(~p=-4~\) and \(~q=-10~\)

20) \(~x^2+4x-10~\)

Half the coefficient of \(~x~\) is \(~+2~\)
\(~(+2)^2=4~\)
The constant term is \(~-10~\)
So we have \(~(x+2)^2-4-10~\)
Which simplifies to \(~(x+2)^2-14~\) so \(~p=2~\) and \(~q=-14~\)

SECTION B

It goes without saying that this is going to get a bit tougher.
Having said that, if your fraction skills are up to scratch, you'll hardly
notice a difference.

Example

Express \(~x^2-3x+1~\) in the form \(~(x+p)^2+q~\)

Half the coefficient of \(~x~\) is \(~-\frac{3}{2}~\)

\(~\Big(-\frac{3}{2}~\Big)^2=\frac{9}{4}~\)

The constant term is \(~+1~\)

So we have \(~\Big(x-\frac{3}{2}~\Big)^2-\frac{9}{4}~+1~\)

Even better \(~\Big(x-\frac{3}{2}~\Big)^2-\frac{9}{4}~+\frac{4}{4}~\)

Which simplifies to \(~\Big(x-\frac{3}{2}~\Big)^2-\frac{5}{4}~\) where \(~p=-\frac{3}{2}~\) and \(~q=-\frac{5}{4}~\)

Important!

Write half the coefficient of \(~x~\) as a fraction, NOT a decimal.
Fractions are easy to square ...

... To square a fraction, square the numerator and square the denominator.

In the second-to-last line of my workings, I've turned the integer 1 into
a fraction with the same denominator as the fraction next to it.
This makes them easier to add together or subtract. BUT this denominator will
always be 4, if you think about it. So in the solutions to the practice questions,
I've converted the constant term to a fraction sooner and saved a line of workings!

Before you go any further...

If the fraction stuff is making you uneasy, you need to revise fractions!
I've given you a couple of pointers here but this is an algebra lesson and it
assumes that your number skills are pretty good.

If you're comfortable with fractions, the method is exactly the same as in
Section A. You just need to concentrate a bit harder
as they're more fiddly. And all because the coefficient of \(~x~\) is now odd - crazy!

Practise to master

SECTION B

Write these expressions in the form \(~(x+p)^2+q~\) and state the values of \(~p~\) and \(~q~\).

01) \(~x^2+3x+1~\)

Half the coefficient of \(~x~\) is \(~+\frac{3}{2}~\)
\(~\Big(+\frac{3}{2}~\Big)^2=\frac{9}{4}~\)
The constant term is \(~+1~=~+\frac{4}{4}\)
So we have \(~\Big(x+\frac{3}{2}~\Big)^2-\frac{9}{4}~+\frac{4}{4}~\)
Which simplifies to \(~\Big(x+\frac{3}{2}~\Big)^2-\frac{5}{4}~\) where \(~p=\frac{3}{2}~\) and \(~q=-\frac{5}{4}~\)

02) \(~x^2+9x+7~\)

Half the coefficient of \(~x~\) is \(~+\frac{9}{2}~\)
\(~\Big(+\frac{9}{2}~\Big)^2=\frac{81}{4}~\)
The constant term is \(~+7~=~+\frac{28}{4}\)
So we have \(~\Big(x+\frac{9}{2}~\Big)^2-\frac{81}{4}~+\frac{28}{4}~\)
Which simplifies to \(~\Big(x+\frac{9}{2}~\Big)^2-\frac{53}{4}~\) where \(~p=\frac{9}{2}~\) and \(~q=-\frac{53}{4}~\)

03) \(~x^2+7x+2~\)

Half the coefficient of \(~x~\) is \(~+\frac{7}{2}~\)
\(~\Big(+\frac{7}{2}~\Big)^2=\frac{49}{4}~\)
The constant term is \(~+2~=~+\frac{8}{4}\)
So we have \(~\Big(x+\frac{7}{2}~\Big)^2-\frac{49}{4}~+\frac{8}{4}~\)
Which simplifies to \(~\Big(x+\frac{7}{2}~\Big)^2-\frac{41}{4}~\) where \(~p=\frac{7}{2}~\) and \(~q=-\frac{41}{4}~\)

04) \(~x^2+5x+5~\)

Half the coefficient of \(~x~\) is \(~+\frac{5}{2}~\)
\(~\Big(+\frac{5}{2}~\Big)^2=\frac{25}{4}~\)
The constant term is \(~+5~=~+\frac{20}{4}\)
So we have \(~\Big(x+\frac{5}{2}~\Big)^2-\frac{25}{4}~+\frac{20}{4}~\)
Which simplifies to \(~\Big(x+\frac{5}{2}~\Big)^2-\frac{5}{4}~\) where \(~p=\frac{5}{2}~\) and \(~q=-\frac{5}{4}~\)

05) \(~x^2-x+8~\)

Half the coefficient of \(~x~\) is \(~-\frac{1}{2}~\)
\(~\Big(-\frac{1}{2}~\Big)^2=\frac{1}{4}~\)
The constant term is \(~+8~=~+\frac{32}{4}\)
So we have \(~\Big(x-\frac{1}{2}~\Big)^2-\frac{1}{4}~+\frac{32}{4}~\)
Which simplifies to \(~\Big(x-\frac{1}{2}~\Big)^2+\frac{31}{4}~\) where \(~p=-\frac{1}{2}~\) and \(~q=\frac{31}{4}~\)

06) \(~x^2+3x-3~\)

Half the coefficient of \(~x~\) is \(~+\frac{3}{2}~\)
\(~\Big(+\frac{3}{2}~\Big)^2=\frac{9}{4}~\)
The constant term is \(~-3~=~-\frac{12}{4}\)
So we have \(~\Big(x+\frac{3}{2}~\Big)^2-\frac{9}{4}~-\frac{12}{4}~\)
Which simplifies to \(~\Big(x+\frac{3}{2}~\Big)^2-\frac{21}{4}~\) where \(~p=\frac{3}{2}~\) and \(~q=-\frac{21}{4}~\)

07) \(~x^2-9x-9~\)

Half the coefficient of \(~x~\) is \(~-\frac{9}{2}~\)
\(~\Big(-\frac{9}{2}~\Big)^2=\frac{81}{4}~\)
The constant term is \(~-9~=~-\frac{36}{4}\)
So we have \(~\Big(x-\frac{9}{2}~\Big)^2-\frac{81}{4}~-\frac{36}{4}~\)
Which simplifies to \(~\Big(x-\frac{9}{2}~\Big)^2-\frac{117}{4}~\) where \(~p=-\frac{9}{2}~\) and \(~q=-\frac{117}{4}~\)

08) \(~x^2+7x+4~\)

Half the coefficient of \(~x~\) is \(~+\frac{7}{2}~\)
\(~\Big(+\frac{7}{2}~\Big)^2=\frac{49}{4}~\)
The constant term is \(~+4~=~+\frac{16}{4}\)
So we have \(~\Big(x+\frac{7}{2}~\Big)^2-\frac{49}{4}~+\frac{16}{4}~\)
Which simplifies to \(~\Big(x+\frac{7}{2}~\Big)^2-\frac{33}{4}~\) where \(~p=\frac{7}{2}~\) and \(~q=-\frac{33}{4}~\)

09) \(~x^2-5x+11~\)

Half the coefficient of \(~x~\) is \(~-\frac{5}{2}~\)
\(~\Big(-\frac{5}{2}~\Big)^2=\frac{25}{4}~\)
The constant term is \(~+11~=~+\frac{44}{4}\)
So we have \(~\Big(x-\frac{5}{2}~\Big)^2-\frac{25}{4}~+\frac{44}{4}~\)
Which simplifies to \(~\Big(x-\frac{5}{2}~\Big)^2+\frac{19}{4}~\) where \(~p=-\frac{5}{2}~\) and \(~q=\frac{19}{4}~\)

10) \(~x^2+x-7~\)

Half the coefficient of \(~x~\) is \(~+\frac{1}{2}~\)
\(~\Big(+\frac{1}{2}~\Big)^2=\frac{1}{4}~\)
The constant term is \(~-7~=~-\frac{28}{4}\)
So we have \(~\Big(x+\frac{1}{2}~\Big)^2-\frac{1}{4}~-\frac{28}{4}~\)
Which simplifies to \(~\Big(x+\frac{1}{2}~\Big)^2-\frac{29}{4}~\) where \(~p=\frac{1}{2}~\) and \(~q=-\frac{29}{4}~\)

11) \(~x^2-3x-6~\)

Half the coefficient of \(~x~\) is \(~-\frac{3}{2}~\)
\(~\Big(-\frac{3}{2}~\Big)^2=\frac{9}{4}~\)
The constant term is \(~-6~=~-\frac{24}{4}\)
So we have \(~\Big(x-\frac{3}{2}~\Big)^2-\frac{9}{4}~-\frac{24}{4}~\)
Which simplifies to \(~\Big(x-\frac{3}{2}~\Big)^2-\frac{33}{4}~\) where \(~p=-\frac{3}{2}~\) and \(~q=-\frac{33}{4}~\)

12) \(~x^2+9x+5~\)

Half the coefficient of \(~x~\) is \(~+\frac{9}{2}~\)
\(~\Big(+\frac{9}{2}~\Big)^2=\frac{81}{4}~\)
The constant term is \(~+5~=~+\frac{20}{4}\)
So we have \(~\Big(x+\frac{9}{2}~\Big)^2-\frac{81}{4}~+\frac{20}{4}~\)
Which simplifies to \(~\Big(x+\frac{9}{2}~\Big)^2-\frac{61}{4}~\) where \(~p=\frac{9}{2}~\) and \(~q=-\frac{61}{4}~\)

13) \(~x^2-7x+15~\)

Half the coefficient of \(~x~\) is \(~-\frac{7}{2}~\)
\(~\Big(-\frac{7}{2}~\Big)^2=\frac{49}{4}~\)
The constant term is \(~+15~=~+\frac{60}{4}\)
So we have \(~\Big(x-\frac{7}{2}~\Big)^2-\frac{49}{4}~+\frac{60}{4}~\)
Which simplifies to \(~\Big(x-\frac{7}{2}~\Big)^2+\frac{11}{4}~\) where \(~p=-\frac{7}{2}~\) and \(~q=\frac{11}{4}~\)

14) \(~x^2+5x-3~\)

Half the coefficient of \(~x~\) is \(~+\frac{5}{2}~\)
\(~\Big(+\frac{5}{2}~\Big)^2=\frac{25}{4}~\)
The constant term is \(~-3~=~-\frac{12}{4}\)
So we have \(~\Big(x+\frac{5}{2}~\Big)^2-\frac{25}{4}~-\frac{12}{4}~\)
Which simplifies to \(~\Big(x+\frac{5}{2}~\Big)^2-\frac{37}{4}~\) where \(~p=\frac{5}{2}~\) and \(~q=-\frac{37}{4}~\)

15) \(~x^2-x-13~\)

Half the coefficient of \(~x~\) is \(~-\frac{1}{2}~\)
\(~\Big(-\frac{1}{2}~\Big)^2=\frac{1}{4}~\)
The constant term is \(~-13~=~-\frac{52}{4}\)
So we have \(~\Big(x-\frac{1}{2}~\Big)^2-\frac{1}{4}~-\frac{52}{4}~\)
Which simplifies to \(~\Big(x-\frac{1}{2}~\Big)^2-\frac{53}{4}~\) where \(~p=-\frac{1}{2}~\) and \(~q=-\frac{53}{4}~\)