How did you get a= -2? If a= -2, so that , then dividing by x- 1 gives with remainder 2 but dividing by x-2 gives with remainder -8, not 2.

Do you know the "remainder theorem": If polynomial p(x) is divided by x- a, then the remainder is p(a). With a= 1, the remainder is and with a= 2, the remainder is . To have the same remainder when divided by x-1 and x- 2, a must satisfy a+ 4= 8a+ 8.