#457

solved

Find all functions f:R→Rf:\mathbb{R}\to\mathbb{R} such that

f(xf(x)+f(xy))=x2+f(x)f(y)f(xf(x) + f(xy)) = x^2 + f(x)f(y)

for any reals x,yx,y.

Solution

Solution by benjaminchew13.


Let P(x,y)P(x,y) denote the assertion

f(xf(x)+f(xy))=x2+f(x)f(y).f(xf(x)+f(xy))=x^2+f(x)f(y).

First, P(0,0)P(0,0) gives

f(f(0))=f(0)2,f(f(0))=f(0)^2,

while P(0,y)P(0,y) gives

f(f(0))=f(0)f(y).f(f(0))=f(0)f(y).

If f(0)≠0f(0)\ne0, then ff is constant, which is impossible because the term x2x^2 appears on the right-hand side. Hence

f(0)=0.f(0)=0.

Then P(x,0)P(x,0) gives

f(xf(x))=x2.(1)f(xf(x))=x^2. \tag{1}

In particular, if f(u)=0f(u)=0, then 0=f(uf(u))=u20=f(uf(u))=u^2, so

f(u)=0  ⟺  u=0.(2)f(u)=0\iff u=0. \tag{2}

Next,

P(−1,1):f(−f(−1)+f(−1))=1+f(−1)f(1),P(-1,1):\qquad f(-f(-1)+f(-1))=1+f(-1)f(1),

so, using f(0)=0f(0)=0,

f(−1)f(1)=−1.(3)f(-1)f(1)=-1. \tag{3}

Also,

P(1,−1):f(f(1)+f(−1))=1+f(1)f(−1)=0.P(1,-1):\qquad f(f(1)+f(-1))=1+f(1)f(-1)=0.

By (2),

f(1)+f(−1)=0.f(1)+f(-1)=0.

Together with (3), this gives

f(1)2=1.f(1)^2=1.

We split into two cases.

If f(1)=1f(1)=1, then f(−1)=−1f(-1)=-1. From P(1,y)P(1,y) we get

f(f(y)+1)=f(y)+1.(4)f(f(y)+1)=f(y)+1. \tag{4}

Also, comparing P(−1,y)P(-1,y) with P(1,−y)P(1,-y) gives

1−f(y)=f(f(−y)+1)=f(−y)+1,1-f(y)=f(f(-y)+1)=f(-y)+1,

so

f(−y)=−f(y).f(-y)=-f(y).

Thus ff is odd. From (1), every nonnegative real number lies in the range of ff, and by oddness every nonpositive real number also lies in the range. Hence ff is surjective. In (4), let f(y)+1f(y)+1 range over all real numbers. We get

f(x)=xf(x)=x

for all real xx.

If f(1)=−1f(1)=-1, then f(−1)=1f(-1)=1. From P(1,y)P(1,y) we get

f(f(y)−1)=1−f(y).(5)f(f(y)-1)=1-f(y). \tag{5}

Comparing P(−1,y)P(-1,y) with P(1,−y)P(1,-y) gives

1+f(y)=f(f(−y)−1)=1−f(−y),1+f(y)=f(f(-y)-1)=1-f(-y),

so again ff is odd. As before, (1) and oddness imply that ff is surjective. In (5), let f(y)−1f(y)-1 range over all real numbers. We get

f(x)=−xf(x)=-x

for all real xx.

Both functions are directly checked, so the solutions are

f(x)=xorf(x)=−x.\boxed{f(x)=x\quad\text{or}\quad f(x)=-x}.