Integral expression $P=x^3+x^2+ax+1$, ... I am trying to solve the following problem: Consider the integral expression $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$ is ?
I have the key with the answers -4 and -1 but am wondering which steps do I take to get to that answer? So far I have only concluded that for $x^2+2x-2=0, x_1=-1+\sqrt3,x_2=-1-\sqrt3)$
 A: If $x^2 + 2x - 2 = 0$ then $$P-(x^2+2x-2)=P-0=P$$ which tells us that $$P = x^3 + (a-2)x +3$$
Now we need to plug in $x_1$ and $x_2$ in order to solve for $a$.
$$P=(-1+\sqrt{3})^3 + (a-2)(-1+\sqrt{3}) + 3 = (-1+3\sqrt{3}-9+3\sqrt{3})+(a-2)(-1+\sqrt{3}) + 3$$
$$=(-5) + 4\sqrt{3} + a(-1 + \sqrt{3})$$
$$=(-5) + (4+a)\sqrt{3} - a$$
Notice that we need to get rid of the $\sqrt{3}$ term in order to make $P$ rational. Thus the choice of $a=-4$ will work, since that zeros out the term with $\sqrt{3}$.
Apply the same idea with $x_2$ and that will give you your answer.
Note that we didn't have to subtract by $x^2+2x-2$ in the beginning, but by doing so we were able to get rid of the $x^2$ term, and thus allowed us to avoid doing a foil and a cube.
A: If $x^2+2x-2=0$, then $$ P=x^3+x^2+ax+1=(x-1)\cdot(x^2+2x-2)+(4+a)x-1=(4+a)x-1$$
So at least if $a=-4$ we obtain $P=-1$ for all (i.e. both) such $x$.
In principle, some other $a$ might work as well, but even without computing $x_1,x_2$ explicitly, we know that $x_1+x_2=-2$, hence $P(x_1)+P(x_2) = -2(a+4)-2$, i.e. $a$ must be rational; and then $(4+a)x$ is irrational if $x$ is irrational - and $x^2+2x-2$ has no rational roots ...
