Solution by jasperE3.
f(xf(x)+xy)=x2+f(x)f(y).
P(0,x)⇒f(0)=f(0)f(x), since there are no constant solutions we must have f(0)=0.
P(1,0)⇒f(f(1))=1.
P(f(1),0)⇒f(1)2=1.
If f(1)=−1 then P(1,1)⇒0=2, so we have to have f(1)=1.
P(1,x)⇒f(x+1)=f(x)+1.
P(x,y+1)⇒f(xf(x)+xy+x)=x2+f(x)f(y)+f(x)=f(xf(x)+xy)+f(x).
For x=0, xf(x)+xy can take any value and so f(y+x)=f(y)+f(x) for all x=0. Since it’s also true for x=0, f is additive.
The equation now becomes:
f(xf(x))+f(xy)=x2+f(x)f(y).
P(x,0)⇒f(xf(x))=x2, so substituting this back into the equation, f is multiplicative as well. Well-known that the only additive and multiplicative functions are f(x)=0 (which doesn’t satisfy P(x,y)) and f(x)=x.