x-a=0
x=a
and,
p(x) = x^3-ax^2+x+2
substituting x=a in p(x) we get,
a^3-a*a^2+a+2=0
a^3-a^3+a+2=0
a+2=0
a=-2