P(x)=x4+3x3−4x2+6x−31.
The Remainder Theorem tells us that if we divide P(x), by x−c, then the remainder is P(c).
So we'll divide P(x) by x−2. You could use long division, but synthetic division requires less writing and we can use it for any linear divisor with leading coefficient 1, so:
2∣∣ 1 3 -4 6 −31
+ 2 10 12 36
−−−−−−−−−
1 5 6 18 || 5
The remainder is 5, so P(2)=5
If you use long division, it will look something like:
x3 +5x2+6x +18
−−−−−−−−−−−
x−2) x4 +3x3 −4x2 +6x −31
x4 −2x3
−−−−−−−−−−−
5x3 −4x2 +6x −31
5x3 −10x2
−−−−−−−−−−−
6x2 +6x −31
6x2 −12x
−−−−−−−−−−−
18x −31
18x −36
−−−−−−−−−−−
5
Again, the remainder is 5, so P(2)=5