Well actually, z- i is a factor, not x-i!
Given that z-i is a factor we can divide by it:
z-i divides into z2
+ az+ (1+i)
z+ (a+i) times with a remainder of (1+a)i . If i really is a root of the equation, then that remainder must be 0. So a must be ____.