Value of a and P(x) when P(x) is a rational number when satisfies a certain equation This is the question as I still don't have permission to post picture, but it is basically when P(x) = x^3+x^2+ax+1, when a is a rational number, P(X) is also rational number for every x that satisfy x^2+2x-2=0

Consider the integral expression in $x$ $$ P= x^3 + x^2 + ax +1 $$ where $a$ is a rational number. At $a=a_0$ the value of $P$ is a rational number for any $x$ which satisfies the equation $x^2 + 2x -2 = 0$, and n this case the value of $P$ is $P_0$.
Find the values of $a_0$ and $P_0$


Hint: By a direct computation, $x^2+2x-2=0$ has two solutions, namely
$$
x=\pm \sqrt{3}-1.
$$
For $x=\sqrt{3}-1$ we have 
$$
P=x^3+x^2+ax+1=(a+4)\sqrt{3}-a-5.
$$
Hence for $a=-4$, this is rational. For $x=-\sqrt{3}-1$ we have 
$$
P=-(a+4)\sqrt{3}-a-5.
$$
