Given:
[tex]x^2+2x-7=(x+a)^2+b[/tex]
To find:
The values of a and b.
Solution:
We have,
[tex]x^2+2x-7=(x+a)^2+b[/tex]
It can be written as
[tex](x^2+2x)-7=(x+a)^2+b[/tex]
Add and subtract square of half of coefficient of x in the parenthesis.
[tex](x^2+2x+(\dfrac{2}{2})^2-(\dfrac{2}{2})^2)-7=(x+a)^2+b[/tex]
[tex](x^2+2x+1^2)-1-7=(x+a)^2+b[/tex]
[tex](x+1)^2-8=(x+a)^2+b[/tex] [tex][\because (x+y)^2=x^2+2xy+y^2][/tex]
[tex](x+1)^2+(-8)=(x+a)^2+b[/tex]
On comparing both sides, we get
[tex]a=1[/tex]
[tex]b=-8[/tex]
Therefore, the value of a is 1 and the value of b is -8.