-0.5x2 + 5x + 20
Factor out the -0.5 from the first two terms:
-0.5(x2 - 10x) + 20
Complete the square: divide -10 by 2 and square the answer: (-10 ÷ 2)2 = 25
Add 25 inside the parantheses and add 12.5 at the end of the expression, so the value of the expression doesn't change (the reason that you add 12.5 is that you have entered -12.5 within the parantheses: -0.5 x 25 = -12.5):
-0.5(x2 - 10x + 25) + 20 + 12.5
-0.5(x - 5)2 + 32.5
Now, you can pick out p and q ...