<s>[INST] Can $(x+y)^2$ be written in the form $f(x) g(y) + g(x)f(y)$? Are there functions $f$ and $g$ such that $f(x)g(y) + g(x)f(y) = (x+y)^2$. I'm asking this because in quantum mechanics, the symmetric wavefunction of two identical particles is written as $\psi(x_1, x_2) =\frac{1}{\sqrt{2}}[ f(x_1) g(x_2) + g(x_1) f(x_2) ]$.
 [/INST] There are no functions $f,g$ defined on $\{0,1,2\}$ so that $f(x)g(y) + g(x)f(y) = (x+y)^2$ for all $x,y \in \{0,1,2\}$.
Proof.  Assume such $f,g$ exist.
Take $x=y=0$,
$$
2f(0)g(0) = 0 .
$$
At least one of $f(0), g(0)$ is $0$.  WLOG assume $f(0)=0$.  Write
$a = g(0)$.
Take $x=0$,
$$
f(0)g(y)+g(0)f(y) = y^2\\
af(y) = y^2
$$
Now $y \ne 0$ sometimes, so $a \ne 0$ and $f(y) = y^2/a$ for all $y$.
Take $x=1,y=1$,
$$
2f(1)g(1) = 4\\
\frac{2g(1)}{a} = 4\\
g(1)=2a
$$
Take $x=1,y=2$,
$$
f(1)g(2)+g(1)f(2)=9
\\
\frac{g(2)+8a}{a} = 9
\\
g(2) = a
$$
Take $x=2, y=2$,
$$
2f(2)g(2) = 16\\
\frac{8a}{a}=16\\
8=16
$$
Contradiction.
</s>