f(x)=ax2+bx+c
g(x)=a1x2+b1x+c1
and p(x)=f(x)-g(x) = (ax2+bx+c) - (a1x2+b1x+c1)
p(x) = (a-a1)x2 + (b-b1)x + c - c1
Now, p(-1) = 0
i.e. a-a1 -(b-b1) + c-c1 = 0
Hence, (b-b1) = a-a1 + c-c1
Also, p(-2) = 2
(a-a1)(-2)^2 + (b-b1)*(-2) + c-c1 = 2
4(a-a1) -2(b-b1) + c-c1 = 2
4(a-a1) - 2(a-a1 + c-c1) + c-c1 = 2
2(a-a1) - (c-c1) = 2
Now, p(2) = (a-a1)(2)^2 + (b-b1)*(2) + c-c1
= 4(a-a1) + 2(a-a1 + c-c1) + c-c1
= 6(a-a1) + 3(c-c1)
= 3(2(a-a1) + (c-c1))
= 3(2+c-c1 + c-c1)
= 3(2+ 2(c-c1))
= 6(1+ c-c1)
Now, since, c-c1 is not equal to zero, so, 1+ c-c1 > 1 and p(2) is a multiple of 6
so p(2)= 6or12or18