Answer:
a = -2; b = 5
Explanation:
Expanding the right side of the given equation, we have ...
x^2 -4x +9 = x^2 +2ax +a^2 +b
Comparing coefficients, we see ...
-4 = 2a . . . . . coefficient of x term
9 = a^2 +b . . . constant term
The first of these tells us ...
-2 = a . . . . divide by 2
The second of these tells us ...
9 = (-2)^2 +b . . . substitute for a
5 = b . . . . subtract 4
The values of a and b are (a, b) = (-2, 5).