Consider the integral expression in $x$ $$P=x^3+x^2+ax+1,$$ where $a$ is a rational number. At $a= ?$ the value of $P$ is a rational number for any $x$ which satisfies the equation $x^2+2x−2=0$, and in this case the value of $P=?$
I don't know how the answer came key $P= -1$, $A=-4$.
What I did is I tried to find the second equation roots but it is irrational. I don't know how to get the answer.