x^2 + 6x - 3 = (x+a)^2 + b
x^2 + 6x - 3 + 9 - 9 = (x+a)^2 + b
[By adding and subtracting 9 on left hand side of equation to make perfect square.]
(x^2 + 6x + 9) -3 - 9 = (x+a)^2 + b
(x + 3)^2 - 12 = (x+a)^2 + b
Comparing both the sides of equation we get,
(x+3)^2 = (x+a)^2
ie, x+3 = x+a
Therefore, a = 3
and b = -12
Its a cake walk!
You must know that in a square
last term = (middle term)^2 - 4(first term) in that order.
So x^2 +6x becomes a perfect square when 9 is added so
it is x^2 +6x+9 -12 = (x+3)^2 - 12.
hence a = 3 and b = -12.
Now solve 15 problems of this type to get a hold on the use of this.