# Solving functional equation $f(x)^2+f(y)^2=f(x+y)(f(f(x))+f(y))$

I was trying to find functions $f:(0,+\infty)\to(0,+\infty)$ satisfying the following functional equation $$f(x)^2+f(y)^2=f(x+y)(f(f(x))+f(y))$$ The problem is that I can't find here any reasonable substitution. The only thing I've concluded is the following $$f(f(x))-f(x)=\mathrm{const}$$ It follows from the fact that lhs is invariant under transform $(x,y)\to(y,x)$. So how could I procced from here, or may be this is a wrong way?

-
Your observation definitely simplifies the problem, since you now can replace the troubling $f\bigl(f(x)\bigr)$ by $f(x)+c$ with a $c$ yet to be determined (maybe it's arbitrary). – Christian Blatter Aug 31 '12 at 8:46
I think $c=0$, because the only solution to this equation that I can see is constant functions – Norbert Aug 31 '12 at 8:49
How about setting $y=0$ in the simplified functional equation $f(x)^2+f(y)^2=f(x+y)(f(x)+f(y)+c)$. This will then lead to the equation $f(x)^2+f(0)^2= f(x)^2 + f(x)( f(0)+c)$ hence $f(x)= f(0)^2/(f(0)+c)$, i.e. $f$ has to be a constant. As noticed this then in turn entails that $c=0$. Or did I miss something? – newguy Aug 31 '12 at 13:03
You can't put $y=0$, as it's not in the domain. – Rijul Saini Aug 31 '12 at 13:12
Fair point. However assuming $f$ is continous (this is of course not part of the original set of assumptions, but since this is merely a comment anyway, lets impose this additional constraint) we note that if $\lim_{y\to 0}f(y)=\infty$ then we can rewrite the functional equation as $f(x)^2/f(y) + f(y) = f(x+y)(f(x)/f(y) + 1 + c/f(y))$ for $y$ small. But in this equality the left side will converge to $\infty$ for $y\to 0$ whereas the right side converges to $f(x)$. Hence $\lim_{y \to 0}f(y)<\infty$, and this should be enough for us to extend $f$ to a function $f:[0;\infty[ \to \[0;\infty[$. – newguy Aug 31 '12 at 13:28

Here is a solution which is not quite as elegant as I'd have liked, but requires a bit of algebraic computations: something I did in Maple.

As already noted, $$f(x+y)\Big(f\big(f(x)\big)+f(y)\Big)=f(x)^2+f(y)^2=f(x+y)\Big(f\big(f(y)\big)+f(x)\Big)$$ makes $f(f(x))-f(x)=f(f(y))-f(y)$ for all $x,y>0$ (since $f>0$), and so there is a constant $a=f(f(x))-f(x)$ for all $x$. Thus, we have $$f(x)^2+f(y)^2=f(x+y)\Big(f(x)+f(y)+a\Big).\tag{1}$$

If we set $f(x)=k\cdot g(x)$ for some constant $k>0$, we find that $g$ satisfies the same equation as $f$, but with $a$ replaced with $a/k$. Thus, by rescaling, we can without loss of generality assume that $a\in\{-1,0,1\}$.

Now comes the ugly bit. I won't include all the computations, just the main results and enough detail to explain how I got them.

Take some fixed $x$. Let $u=f(x)$. We can now use the formula $$f(x+y)=\frac{f(x)^2+f(y)^2}{f(x)+f(y)+a}\tag{2}$$ to compute $$v=f(2x)=\frac{2u^2}{2u+a}, w=f(3x)=\frac{u^2+v^2}{u+v+a}.$$ Now, we can express $f(4x)$ as either $f(2x+2x)$ or $f(x+3x)$ and require that these be equal. This gives $$\begin{split} 0=&f(x+3x)-f(2x+2x)\\ =& \frac {{u}^{2}a \left( {a}^{6}+10\,u{a}^{5}+42\,{u}^{2}{a}^{4}+100\,{ u}^{3}{a}^{3}+140\,{u}^{4}{a}^{2}+112\,{u}^{5}a+32\,{u}^{6} \right) }{ \left( 4\,{u}^{2}+2\,ua+{a}^{2} \right) \left( 16\,{u}^{4}+22\,{u}^{ 3}a+16\,{u}^{2}{a}^{2}+6\,u{a}^{3}+{a}^{4} \right) \left( 4\,{u}^{2}+ 3\,ua+{a}^{2} \right) } \end{split}$$ where we may focus on the big polynomial in the numerator which has to be zero when $u>0$ and $a\not=0$.

The big polynomial in the numerator is always positive if $a>0$: all the terms are positive. Thus, there is no possible value for $u=f(x)$. Hence, $a$ cannot be negative.

If $a<0$, as Harry Altman noted in a comment, $f(f(x))=f(x)+a$ can be iterated, replacing $x$ with $f(x)$, making $f^{n+1}(x)=f(x)+na$ ($f^k(x)$ is $f$ applied $k$ times). If $a<0$, starting with any $x$, applying $f$ enough times will make $f^{n+1}(x)=f(x)+na<0$.

My original proof was based on the same algebra as for $a>0$: have moved it to a comment at the end.

This leaves $a=0$ as the only option. We then have $f(f(x))=f(x)$, and $f(2x)=f(x+x)=f(x)$ from (2). Since $f(2x)=f(x)$, by (2) we must have $f(2x+y)=f(x+y)$ for all $x,y>0$. If we set $u=f(x)$, $v=f(y)$, this makes $$w=f(x+y)=\frac{u^2+v^2}{u+v},\quad f(2x+y)=f(x+(x+y))=\frac{u^2+w^2}{u+w},$$ which gives $$0=f(2x+y)-f(x+y)=\frac{uv(u-v)}{2u^2+uv+v^2}\implies u=v$$ which implies $f(x)=f(y)$ for all $x,y>0$.

So the only possible solution is $f(x)$ constant, which is easy to verify is a solution.

Original proof for the case $a<0$:

If $a<0$, let's assume $a=-1$, the same polynomial can be solved and has two real roots: found numerically to be $u_1=0.2580535\ldots$ and $u_2=1.887292\ldots$. Thus, for all $x$, $f(x)$ must take either of these two values. However, if we plug these values into (2), we find that if $f(x)$ and $f(y)$ takes values in $\{u_1,u_2\}$, then $f(x+y)$ does not: i.e. $f(x+y)$ then ends up taking a value other than $u_1$ or $u_2$, which is not possible.

-
If $u=f(x)$, and $u$ satisfies a polynomial $P(u)=P(f(x))=0$ for all $x$, doesn't that mean the range of $f(x)$ is finite? And if it is continuous, it must be a constant function. – nayrb Sep 1 '12 at 22:31
I can't figure out how f(2x+y)=f((x+y)+y) at that point. – Immanuel Weihnacht Sep 2 '12 at 2:28
@nayrb Not only is the range of $f$ finite, it's values have to be roots of $P(u)$. However, I'm not assuming that $f$ is continuous. F.ex. before finding this proof I knew that for $a=0$, $f(x)=f(rx)$ for any rational number $r$, which implies that either it is constant or everywhere discontinuous. – Einar Rødland Sep 2 '12 at 3:27
Note that there's an easy way to see that $a\ge 0$, without the messy algebra: If $a<0$, then iterating $f$ would eventually produce a negative number. – Harry Altman Sep 2 '12 at 5:19
@Harry Good point! Will incorporate this into the answer: will make things quite a bit easier. – Einar Rødland Sep 2 '12 at 5:33

Here's a proof that the only continuous solutions are constant. Suppose $f(x)$ were a nonconstant continuous solution; we will derive a contradiction. Since $f(x)$ is nonconstant and continuous, the range of $f(x)$ contains an interval $(a,b)$. As suggested by Norbert in the original question, we can take advantage of the $(x,y) \to (y,x)$ symmetry and we have two equations $$f(x)^2+f(y)^2=f(x+y)(f(f(x))+f(y))$$ $$f(x)^2+f(y)^2=f(x+y)(f(f(y))+f(x))$$ Hence we have $$f(f(x))+f(y) = f(f(y)) + f(x)$$ In particular, if $f(x) \neq f(y)$ are in $(a,b)$, we have $$\frac{f(f(y)) - f(f(x))}{f(y) - f(x)} = 1$$ Since $(a,b) \subset$ range$(f)$, we may take the limit of the above as $f(y)$ approaches $f(x)$, and get that $$f'(f(x)) = 1$$ This is true for any $f(x) \in (a,b)$, so we have that $f'(y) = 1$ for all $y \in (a,b)$. Hence there is a constant $c$ such that $f(y) = y + c$ on $(a,b)$. As Norbert also pointed out in his original question, there is also a constant $a$ such that we have $$f(x)^2+f(y)^2=f(x+y)(f(y)+f(x) + a)$$ So for $x,y \in (a,b)$ we have $$(x + c)^2 + (y + c)^2 = f(x + y)(x + y + 2c + a)$$ In particular, this is true for $x,y \in (a,b)$ with $x + y = a + b$, for which we have $$(x + c)^2 + (a + b - x + c)^2 = f(a + b)( a + b + 2c + a)$$ However, the left-hand side of the above is not a constant function of $x$, and the right-hand side is. This gives a contradiction and we are done.

Note that this shows that any solution whose range contains an interval is constant. So if any nonconstant $f(x)$ solves this, it will be a rather weird function.

-

Why not say that $$f(x) = 1$$ For all x,y

$$1^2+1^2=1*(1+1)=2$$

-
Any constant function works. The question is whether any others do. – Karolis Juodelė Aug 31 '12 at 16:28

This is not yet a complete answer, but comes forth with less effort than that of Einar. I do not know, whether the last move with the derivative can really be done.

We go back to the original form and use symmetry: $$\tag{1} f(x)^2+f(y)^2 = f(x+y)(f(f(x))+f(y))$$ $$\tag{2} f(x)^2+f(y)^2 = f(x+y)(f(x)+f(f(y)))$$ Subtracting and reorganizing gives (let's write $ff(x)$ for $f(f(x))$ $$\tag{3} 0 = f(x+y)(ff(x)-ff(y) -f(x)+f(y))$$ It was assumed in the definition, that $f(x)$ and thus $f(x+y)$ is not zero, so we can divide by $f(x+y)$ and rearrange $$\tag{4} f(y)-f(x) = ff(y)-ff(x)$$ Let's write $X$ for $f(x)$ now, we get $$\tag{5} Y-X = f(Y)-f(X)$$

Now we assume, $Y = X+h$ where $h \gt 0$ and write $$\tag{6} h = f(X+h)-f(X)$$ and [update] that following move was wrong $$\tag{7 wrong} 0 = {f(X+h)-f(X) \over h}$$ it must be $$\tag{7} 1 = {f(X+h)-f(X) \over h}$$

and I don't see something useful in this now....[/update].

-
If $f(x)=c$, a constant, then $Y-X = f(Y)-f(X)$ only makes sense for $X=Y=c$. Thus your trick with setting $Y=X+h$ won't work, because $Y$ can only assume one value. At any rate, you could use contradiction, but the point is you need to pay attention to what are allowed values for $X$ and $Y$. – nayrb Sep 1 '12 at 22:03
upps, my editing of the answer crossed with your comment. I'll see whether I've even messed up... – Gottfried Helms Sep 1 '12 at 22:04
Hmm, I'm also speculating, whether using the floor, fraction function or in general taking the residue modulo something is an interesting variant because it becomes constant after the first iteration... – Gottfried Helms Sep 1 '12 at 22:29
Wouldn't (6) imply that the limit is 1, not 0 as in (7)? – timur Sep 2 '12 at 1:35
(+1) arrgh. True, what a mess. That idea was too hypnotizing, sorry... My first version of this answer was even more wrong; pehaps I should delete that whole answer... – Gottfried Helms Sep 2 '12 at 7:07