$P=x^3 + x^2 + ax + 1$, what is $a$ when $ P$ is a rational numbers, also satisfies $ 0= x^2+2x-2$ $x^3 + x^2 + ax + 1 $

$0= x^2+2x-2$

$x= - 1 \pm \sqrt 3$

$x^3 + x^2 + ax + 1 = x^3 + 2 - 2x + ax + 1  $
 Or $x(x^2 + x) + ax + 1 = x(2-x) + ax + 1 = 2x + 2x - 2 + ax + 1 =4x+ax-1$

If i sub $x= 1 \pm \sqrt 3$ into $4x+ax-1$
 I got wrong answer. Where am i wrong?
$0=x^2+2x-2$, so $$0=(x-1)(x^2+2x-2)=x^3+x^2-4x+2$$

If we subtract this from $P=x^3+x^2+ax+1$, we get $$P=(a+4)x-1$$

As you note, $x$ is an irrational number, so $P$ is only rational if $a=-4$.
$0=x^2+2x-2$, so $$0=(x-1)(x^2+2x-2)=x^3+x^2-4x+2$$

If we subtract this from $P=x^3+x^2+ax+1$, we get $$P=(a+4)x-1$$

As you note, $x$ is an irrational number, so $P$ is only rational if $a=-4$.