Solution by AIME4096.
We claim that the complete solution set is characterized as follows. For x=0, define q(x)=xf(x). Then f is a solution if and only if q:R×→R satisfies
(q(x)+q(y))q(xy(q(x)+q(y)))=1+q(xy)
whenever q(x)+q(y)=0, while q(xy)=−1 whenever q(x)+q(y)=0. Equivalently, every solution is obtained uniquely from such a function q by setting f(0)=0 and f(x)=xq(x) for x=0. Among these solutions are the following explicit families: f(x)=−2x; f(x)=χ(x)x, where χ:R×→{1,−1} is multiplicative, χ(2)=1, and χ(−1)=−1; and f(x)=−21+χ(x)x, where χ:R×→{1,−1} is multiplicative, χ(2)=1, and χ(−1)=−1. In particular, f(x)=x, f(x)=∣x∣, and f(x)=−2x are examples of non-pathological solutions, but the solution set is obviously substantially larger than these three functions. Let P(x,y) denote the assertion f(xf(y)+yf(x))=xy+f(xy). We now prove our desired characterization.
Lemma 1. f(0)=0.
Proof. Let c=f(0). Assertion P(x,0) gives f(xc)=c for every x∈R. Suppose that c=0. Since multiplication by the nonzero number c is a bijection of R, the numbers xc range over all real numbers. Hence f(t)=c for every t∈R, so f is constant. But if f≡c, the original equation becomes c=xy+c for every x,y∈R, which is impossible. □
Lemma 2. For every x=0, defining q(x)=xf(x) gives the original equation as
f(xy(q(x)+q(y)))=xy(1+q(xy)).
Proof. For x,y=0, we have xf(y)+yf(x)=xyq(y)+xyq(x)=xy(q(x)+q(y)). Moreover, xy+f(xy)=xy+xyq(xy)=xy(1+q(xy)). Substitution into P(x,y) finishes the lemma. Conversely, reversing these calculations recovers P(x,y) whenever x,y=0. □
Lemma 3. Let x,y=0. If q(x)+q(y)=0, then q(xy)=−1. If q(x)+q(y)=0, then
q(xy(q(x)+q(y)))=q(x)+q(y)1+q(xy).
Proof. Suppose first that q(x)+q(y)=0. Lemma 2 gives f(0)=xy(1+q(xy)). By Lemma 1, the left-hand side is 0. Since xy=0, we obtain 1+q(xy)=0, hence q(xy)=−1. Now suppose that q(x)+q(y)=0. Lemma 2 gives f(xy(q(x)+q(y)))=xy(1+q(xy)). The argument of f is nonzero, so by definition of q,
f(xy(q(x)+q(y)))=xy(q(x)+q(y))q(xy(q(x)+q(y))).
Dividing by the nonzero number xy(q(x)+q(y)) yields
q(xy(q(x)+q(y)))=q(x)+q(y)1+q(xy).
This proves the lemma. □
Lemma 4. Conversely, let q:R×→R satisfy the two conditions in Lemma 3. Define f(0)=0 and f(x)=xq(x) for x=0. Then f satisfies the original functional equation.
Proof. Let x,y∈R. If x=0 or y=0, then xf(y)+yf(x)=0 and xy+f(xy)=0, so the equation holds. It remains to consider x,y=0. Put s=q(x)+q(y). If s=0, then xf(y)+yf(x)=xy(q(x)+q(y))=0, so the left-hand side is f(0)=0. By the first condition of Lemma 3, q(xy)=−1, and therefore xy+f(xy)=xy+xyq(xy)=0. Thus the equation holds. If s=0, then Lemma 3 gives q(xys)=s1+q(xy). Consequently,
f(xf(y)+yf(x))=f(xys)=xysq(xys)=xy(1+q(xy))=xy+f(xy).
Thus the original equation holds for every x,y∈R. □
Lemma 5. Every solution of the original functional equation is obtained uniquely from a function q satisfying the conditions of Lemma 3.
Proof. Lemma 1 gives f(0)=0. For every nonzero x, define q(x)=xf(x). Lemma 3 follows directly from the original equation by Lemmas 2 and 3. Conversely, Lemma 4 shows that every such q produces a solution. Note that the correspondence is unique because q(x)=xf(x) is uniquely determined by f for every x=0. Therefore the characterization is both necessary and sufficient. □
We next record several concrete families of solutions.
Lemma 6. The function f(x)=−2x is a solution.
Proof. For arbitrary x,y∈R, xf(y)+yf(x)=−2xy−2xy=−xy. Hence f(xf(y)+yf(x))=f(−xy)=2xy, while xy+f(xy)=xy−2xy=2xy. Thus P(x,y) holds. □
Lemma 7. Let χ:R×→{1,−1} be multiplicative and satisfy χ(2)=1 and χ(−1)=−1. Then f(0)=0, f(x)=χ(x)⋅x for x=0 is a solution.
Proof. Fix x,y=0 and write a=χ(x) and b=χ(y). If a=−b, then xf(y)+yf(x)=xy(a+b)=0, so the left-hand side is 0. Since χ(xy)=ab=−1, xy+f(xy)=xy(1+χ(xy))=0. Suppose now that a=b. Then a+b=2a, and multiplicativity gives χ(xy)=a2=1. Therefore
f(xf(y)+yf(x))=f(2axy)=2axyχ(2axy).
Since χ(2)=1, χ(a)=a, and χ(xy)=1, we have χ(2axy)=a. Hence f(xf(y)+yf(x))=2a2xy=2xy. On the other hand, xy+f(xy)=xy+xyχ(xy)=2xy. The cases involving x=0 or y=0 follow from f(0)=0. Hence f is a solution. □
Lemma 8. Let χ:R×→{1,−1} be multiplicative and satisfy χ(2)=1 and χ(−1)=−1. Then f(0)=0,
f(x)=−21+χ(x)⋅x
for x=0 is a solution.
Proof. Put q(x)=−21+χ(x). Thus q(x) equals −1 when χ(x)=1 and 0 when χ(x)=−1. Let x,y=0. If χ(x)=χ(y)=−1, then q(x)=q(y)=0, so the left-hand argument is 0. Since χ(xy)=1, we have q(xy)=−1, and therefore the right-hand side is also 0. If χ(x)=χ(y)=1, then q(x)=q(y)=−1, so the left-hand argument is −2xy. Since χ(−1)=−1, χ(2)=1, and χ(xy)=1, we have χ(−2xy)=−1, hence q(−2xy)=0. Thus the left-hand side is 0. Since q(xy)=−1, the right-hand side is also 0. Finally, suppose χ(x)=χ(y). Then exactly one of q(x),q(y) equals −1, so xf(y)+yf(x)=−xy. Moreover χ(xy)=−1, so q(xy)=0. Since χ(−1)=−1, we have χ(−xy)=1, and hence q(−xy)=−1. Therefore f(−xy)=xy=xy+f(xy). Thus the equation holds in every case. □
Lemma 9. The characterization above contains the familiar solutions f(x)=x and f(x)=∣x∣.
Proof. The identity solution comes from taking q≡1 in Lemmas 3 and 4. Take χ(x)=sgn(x) in Lemma 7. Since sgn(2)=1 and sgn(−1)=−1, this gives f(x)=sgn(x)x=∣x∣. The same sign character in Lemma 8 gives f(x)=−x for x>0, f(x)=0 for x<0, together with f(0)=0. □
Therefore the complete solution set, without any regularity hypothesis, is the class described in Lemmas 3 and 4. This characterization is necessary and sufficient, so it gives every solution and no others. In particular, the equation has many non-linear solutions; the three elementary functions x, ∣x∣, and −2x are only special cases. ■