My teacher gave me this functional equation as an excercise $$f(x+f(y))=x+f(f(y))\,\, \forall\,\, x,y \in \mathbb{R}$$ If $f(2)=8$, calculate $f(2005)$

So my solution was

For every $y$, let $f(y)=c$ and $f(f(y))=d$ (just for simplicity)

Then $$f(x+c)=x+d$$ Replacing $x=k-c\,\forall k\in \mathbb{R}$

Then \begin{align*}f(k)&=k-c+d\\f(2)&=2-c+d=8\\d-c&=6\\f(x)&=x+6\\f(2005)&=2011\end{align*} But I was doubting there was a flaw in my reasoning, and after showing my teacher my solution I doubted it even more(He was not so sure about it). After some thought I came up with a more formal proof that would be \begin{align*}f(x+f(y))&=x+f(f(y))\\f(n+x+f(y))&=n+x+f(f(y))\\f(n+x+f(y))-f(x+f(y))&=n\end{align*} Setting $x=2-f(y)$, $n=2003$

\begin{align*}f(2003+2)-f(2)=2003\\f(2005)=2011\end{align*} The question is: was there something wrong about the first proof?

• your first solution is fine, but all you needed to write is "let $x+c=k$" rather than "Replacing $x=k-c\forall k\in\mathbb{R}$" (which doesn't make sense) Sep 5 '13 at 2:01
• First proof looks basically fine. It is essentially the same as the second proof, which is written up in a clearer way. Sep 5 '13 at 2:02
• @AndréNicolas The main difference is that the first actually shows $f(x)=x+6$(I was not sure that this was the only solution), but the second one just says $f(2005)=2011$, that is less prone to errors due to being significantly weaker. Sep 5 '13 at 2:09
• I think you need to explicitly state in both proofs that you're fixing some $y$ and then taking $f(y)$. Otherwise in the first proof it seems like your assuming $f$ is constant ("For every $y$, let $f(y) = c$") which is not the case.
– 6005
Sep 5 '13 at 2:19
• Similarly where you state, "Let $x = 2 - f(y)$", you should say you are fixing some particular $y$.
– 6005
Sep 5 '13 at 2:19

Another approach: I want to simplify the equations to get rid of $f$s where possible, so I've got to make the argument equal to $2$. So immediately substitute $y = 2$ to get $f(x + f(2)) = x + f(f(2)),$ and use $f(2) = 8$ to get $f(x + 8) = x + f(8),$ and substitute $z = x + 8$ to get $f(z) = z - 8 + f(8)$
Now I can compute $f$ of anything in terms of $f(8)$. But that's no good because I don't know what $f(8)$ is. However, I can compute $f(2)$ in terms of $f(8)$, and I already know $f(2)$, so maybe that will help! $f(2) = -6 + f(8)$
In other words $f(8) = f(2) + 6$, so $f(8) = 14$, so $f(x) = x + 6$.