This one is tricky because there are no "numbers"....but....no problem !!!!
a^2 - ap + p^2 - 3q assuming "a" is the variable and p, q are constants
Write
a^2 - pa + p^2 - 3q
Take (1/2)p ..... square it = p^2 / 4 .....add and subtract it
( a^2 - pa + p^2/4 ) + p^2 - 3q - p^2/4
Factor the 1st three terms....simplify the rest
(a - p/2)^2 + (3/4)p^2 - 3q
The vertex is (p/2 , (3/4)p^2 - 3q )