Solve the functional equation $f(xf(y)+yf(x))=yf(x)+xf(y)$

Let $f:\mathbb{R}\to \mathbb{R}$ and such for any real numbers $x,y$ we have $$f(xf(y)+yf(x))=yf(x)+xf(y)$$ Find $f(x)$.

I have let $x=y=0$ have $$f(0)=2f(0)\Longrightarrow f(0)=0$$

and I guess the solution is $f(x)=x$ or $f(x)=0$, but I can't prove it.


There are many such functions $f$, probably too many to classify in any useful way.

First, if $A\subseteq \mathbb{R}$ and $f:A\to\mathbb{R}$, say that $f$ is good if it satisfies the following property:

  • For all $x,y\in A$, $xf(y)+yf(x)\in A$ and $f(xf(y)+yf(x))=xf(y)+yf(x)$.

The following lemma gives one way to construct many such functions.

Lemma: Let $A\subseteq\mathbb{R}$ with $0\in A$, let $f:A\to\mathbb{R}$ be good, let $a\in \mathbb{R}\setminus A$, and let $b\in\mathbb{R}$ be transcendental over the field generated by $A\cup f(A)\cup\{a\}$. Then there exists $B\subseteq\mathbb{R}$ such that $A\cup\{a\}\subseteq B$ and $|B|\leq |A|+\aleph_0$ and a good function $g:B\to\mathbb{R}$ which extends $f$ such that $g(a)=b$.

Proof: Let $B_0=\{2ab\}\cup\{af(x)+bx:x\in A\}$. Let $B_1$ be the closure of the set $B_0$ under the following operations:

  • multiplication by $x+f(x)$ for any $x\in A$

  • multiplication by $a+b$

  • the binary operation $(x,y)\mapsto 2xy$.

Let $K$ be the subfield of $\mathbb{R}$ generated by $A\cup f(A)\cup\{a\}$; then clearly $B_1\subseteq K[b]$ (so in particular $|B_1|\leq |A|+\aleph_0$). Moreover, $B_1$ contains no nonzero elements of $K$, since $B_0$ contains no nonzero elements of $K$ and $K[b]\setminus K$ is closed under all of these operations except when we multiply by $0$.

Now let $B=B_1\cup A\cup\{a\}$ and define $g:B\to\mathbb{R}$ by $g(x)=f(x)$ for $x\in A$, $g(a)=b$, and $g(x)=x$ if $x\in B_1$. Note that $g$ is well-defined, since $B_1\cap A=\{0\}$ and we must already have $f(0)=0$ since $f$ is good.

I claim that $g$ is good; to prove this, suppose $x,y\in B$. If $x,y\in A$, then we are done since $f$ is good. In all other cases, we will show that $xg(y)+yg(x)\in B_1$ and so $g(xg(y)+yg(x))=xg(y)+yg(x)$. Here are all the cases (with cases which are equivalent to these by swapping $x$ and $y$ omitted):

  • If $x\in A$ and $y=a$, then $xg(y)+yg(x)=xb+af(x)\in B_0$.
  • If $x\in A$ and $y\in B_1$, then $xg(y)+yg(x)=xy+yf(x)=y(x+f(x))\in B_1$ since $B_1$ is closed under multiplication by $x+f(x)$.
  • If $x=y=a$, then $xg(y)+yg(x)=2ab\in B_0$.
  • If $x=a$ and $y\in B_1$, then $xg(y)+yg(x)=ay+yb=y(a+b)\in B_1$ since $B_1$ is closed under multiplication by $a+b$.
  • If $x,y\in B_1$, then $xg(y)+yg(x)=xy+yx=2xy\in B_1$ since $B_1$ is closed under $(x,y)\mapsto 2xy$.

Now here's how you can use the lemma to construct good functions on all of $\mathbb{R}$. Fix an enumeration $(r_\alpha)_{\alpha<\mathfrak{c}}$ of the real numbers. We construct our function $f$ by transfinite recursion as a limit of good partial functions $f_\alpha:A_\alpha\to\mathbb{R}$, starting with $A_0=\{0\}$ and $f_0:A_0\to\mathbb{R}$ given by $f_0(0)=0$. At limit steps, we just take unions. At successor steps, we use the Lemma to extend $f_\alpha$ to a larger domain. More precisely, let $a$ be the first number in our enumeration of the reals which is not in $A_\alpha$, and let $b$ be some real number that is transcendental over the field generated by $A_\alpha\cup f(A_\alpha)\cup\{a\}$. (We can do this since by induction, $|A_\alpha|\leq |\alpha|+\aleph_0<\mathfrak{c}$.) We then let $A_{\alpha+1}$ and $f_{\alpha+1}$ be $B$ and $g$ as given by the lemma.

In the end, this gives a function $f=\bigcup_{\alpha<\mathfrak{c}} f_\alpha$ which is defined on all of $\mathbb{R}$ and good, so it is a solution to your problem. Moreover, by varying the choice of $b$ used in each successor step, we can get many different such functions ($2^{\mathfrak{c}}$ of them, though this takes a bit of work to prove).


Most compactly written, part of the solution set is $$\{x\mapsto x\cdot\mathbb{1}_A(x):A\subseteq\mathbb{R},2\cdot A\cdot A\subseteq A,A\cdot(\mathbb{R}\backslash A)\subseteq A\}$$ where $\mathbb{1}_A$ is the indicator function on the set $A$. (Three such sets $A$ include $\varnothing$, $\{0\}$ (both giving $f(x)=0$), and $\mathbb{R}$ (which gives $f(x)=x$)) Now, consider the function $f(x)=x\cdot\mathbb{1}_A(x)$ where $A$ is such subset of $\mathbb{R}$. Take $x,y \in \mathbb{R}$. Assume that $x,y \in A$. Then, we have $$\begin{split} f(xf(y)+yf(x))&=f(xy+yx)\\&=f(\underbrace{2xy}_{\in A})\\&=2xy\\&=yx+xy\\&=yf(x)+xf(y). \end{split}$$ Now, assume that $x,y \notin A$. Then, we have $$\begin{split} f(xf(y)+yf(x))&=f(0+0)\\&=f(0)\\&=0\\&=0+0\\&=y\underbrace{f(x)}_{0}+x \underbrace{f(y)}_{0}. \end{split}$$ Finally, assume that $x \in A$ and $y \notin A$ (the fourth case follows by symmetry). Then, we have $$\begin{split} f(xf(y)+yf(x))&=f(\underbrace{y}_{\notin A}\underbrace{f(x)}_{\in A}) \\&=f(\underbrace{yf(x)}_{\in A})\\&=yf(x)\\&=yf(x)+x\underbrace{f(y)}_{0}. \end{split}$$ Now, let's attempt to show the converse. Suppose that a function $f$ satisfies $$f(xf(y)+yf(x))=yf(x)+xf(y)\text{ for all }x,y\in\mathbb{R}$$ and consider the set $$B=\{x\in\mathbb{R}:f(x)=x\}.$$ Now, take $x,y \in B$. Then, we have $$\begin{split} f(2xy)&=f(x\underbrace{y}_{\in B}+y\underbrace{x}_{\in B}) \\&=f(xf(y)+yf(x))\\&=xf(y)+yf(x)\\&=xy+yx\\&=2xy \end{split}$$ so $2xy\in B$ as well. Now, suppose that $x \in B$ but $y \notin B$. I would not have any idea how to prove that $xy \in B$ as well. The only thing I know is that taking $x=y=1/2$ leads to $f(f(1/2))=f(1/2)$ so $f(1/2) \in B$ as well...