Determine all real polynomials $P$ satisfying, for all real numbers $a, b, c, P(a+b-2 c)+P(b+$ $c-2 a)+P(a+c-2 b)=3 P(a-b)+3 P(b-c)+3 P(c-a)$.

## Euclidean division



Translate the above text into English, please keep the original text's line breaks and format, and output the translation result directly.
As in a functional equation, we try particular values of $a, b, c$. For $a=b=c=0$, we get $3 P(0)=9 P(0)$, so $P(0)=0$.

For $b=c=0$, we get $P(a)+P(-2 a)+P(a)=3 P(a)+3 P(-a)$ for all real $a$, so by rigidity $P(X)+P(-2 X)+P(X)=3 P(X)+3 P(-X)$. Suppose $P$ is not zero, let $c$ be its leading coefficient and $n$ its degree. The term in $X^{n}$ of $P(X)+P(-2 X)+P(X)$ is $c \times (2+(-2)^{n})$ and that of $3 P(X)+3 P(-X)$ is $3 c (1+(-1)^{n})$. We then get $2+(-2)^{n}=1+(-1)^{n}$, so $(-2)^{n}=-1+3(-1)^{n}$, so $(-2)^{n}$ is 4 or -2. Thus $n=1$ or 2.

In all cases, $P$ is of the form $a X^{2}+b X$ with $a, b$ real numbers.

For verification, note that the set of solutions to the equation is stable under addition and multiplication by a scalar. In particular, if we show that $X^{2}$ and $X$ satisfy the equation, then any polynomial of the form $a X^{2}+b X$ will also be a solution. The verification for $X$ gives $0=0$ which is true. For $X^{2}$, expanding on the left we get $6(a^{2}+b^{2}+c^{2})-6(a b+b c+c a)$, and expanding on the right we get the same thing, so $X$ and $X^{2}$ satisfy the equation.

The set of solutions is the set of polynomials of the form $a X^{2}+b X$ for $a, b$ real numbers.