Edited after
Ya, factorising to find a,b like ngai did, rather than the reverse, is probably the best way to go. You must've solved P(1-i) = 0, or P(1+i) = 0, for a,b, equating real and imaginary parts, to have found a,b before factorising.
Also, to build on ngai's use of root-coeff...