If P(x)=c for a constant c, then xyzc(x+y+z)=3c . We have 2c=3c. Therefore c=0.
Now consider the case of non-constant polynomials.
First we have xP(x)+yP(y)+zP(z)=xyz(P(x−y)+P(y−z)+P(z−x)) for all nonzero real numbers x,y,z satisfying 2xyz=x+y+z . Both sides of the equality are polynomials (of x,y,z ). They have the same values on the 2-dimensional surface 2xyz=x+y+z , except for some 1-dimensional curves in it. By continuity, the equality holds for all points on the surface, including those with z=0. Let z=0, we have y=−x and x(P(x)−P(−x))=0. Therefore P is an even function.
(Here is a sketch of an elementary proof. Let z=2xy−1x+y. We have xP(x)+yP(y)+2xy−1x+yP(2xy−1x+y)=xy2xy−1x+y(P(x−y)+P(y−2xy−1x+y)+P(2xy−1x+y−x)). This is an equality of rational expressions. By multiplying (2xy−1)N on both sides for a sufficiently large N , they become polynomials, say A(x,y)=B(x,y) for all real x,y with x=0,y=0,x+y=0 and 2xy−1=0. For a fixed x, we have two polynomials (of y ) having same values for infinitely many y . They must be identical. Let y=0, we have xN+1(P(x)−P(−x))=0. )
Notice that if P(x) is a solution, then is cP(x) for any constant c. For simplicity, we assume the leading coefficient of P is 1 : P(x)=xn+an−2xn−2+⋯+a2x2+a0, where n is a positive even number.
Let y=x1 , z=x+x1. we have xP(x)+x1P(x1)+(x+x1)P(x+x1)=(x+x1)(P(x−x1)+P(−x)+P(x1)).
Simplify using P(x)=P(−x), (x+x1)(P(x+x1)−P(x−x1))=x1P(x)+xP(x1).
Expand and combine like terms, both sides are of the form cn−1xn−1+cn−3xn−3+⋯+c1x+c−1x−1+⋯+c−n+1x−n+1.
They have the same values for infinitely many x. They must be identical. We just compare their leading terms. On the left hand side it is 2nxn−1 . There are two cases for the right hand sides: If n>2 , it is xn−1 ; If n=2 , it is (1+a0)x. It does not work for n>2. When n=2, we have 4=1+a0. therefore a0=3.
The solution: P(x)=c(x2+3) for any constant c.
-JZ