How do I determine A polynomial "P" that has a degree equal or inferior to $3$ that has these properties

Solution 1:

It is $R(X)=0$. In second case it is $cX+d$ and not $aX+b$ .

Then write $P(X) = P(X)$:

$$(X-1)^2(aX+b) =(X^2+1)(cX+d) + 6X+2$$ and do the comparing of coefficents.