Is this just trial and error

Two methods I can think of. Expanding the right hand side terms or completing the square on the left. After that you compare

Expanding the term:

x^2 - 6x + 1 = (x-a)^2 - b = x^2 - 2ax + a^2 - b

x^2 - 6x + 1 = x^2 - 2a(x) + (a^2 - b)

Look at the coefficients on the x terms. -6 and -2a. They must be equal, so a=3. Similarly look at the constant. 1 and (a^2 - b) which is nothing but (9-b). They must be equal again, so b=8

Completing the square:

x^2 - 6x + 1 = [x^2 - 2(3)x + 3^(2)] - 3^2 + 1 = (x-3)^2 - 8

(x-3)^2 - 8 = (x-a)^2 - b

Simple comparison will get you the answers here
Not at all. Expanding (x-a)\^2 gives you a term with x which must match with the term on the LHS. There is no trial and error - expand and match coefficients.
Another method: complete the square on the LHS

x^2 -6x+(-3)^2 -(-3)^2 +1

(x-3)^2 -8
No, you should not need any trial-and-error here at all.

Expand the right-hand side and equate the coefficients of each power of x with those on the left-hand side.

0 like 0 dislike