Find the functions from $\mathbb{R}$ to $\mathbb{R}$ such that:

$$
f(x+f(x+y))+f(x y)=x+f(x+y)+y f(x)
$$
Let $P(x, y)$ be the property of the statement.

\[
\begin{aligned}
& P(x, 0) \Longleftrightarrow f(x+f(x))+f(0)=x+f(x) \\
& P(0, y) \Longleftrightarrow f(f(y))+f(0)=f(y)+y f(0)
\end{aligned}
\]

$P(x, 1) \Longleftrightarrow f(x+f(x+1))+f(x)=x+f(x+1)+f(x) \Longleftrightarrow x+f(x+1)$ Fixed point

Let $y$ be a fixed point. From (2), we have $f(0)=y f(0)$, so either $f(0)=0$ or the only fixed point is 1.

In the second case, (3) implies $x+f(x+1)=1$, so $f(x+1)=1-x$ and thus $f(x)=2-x$ for all $x$, which works.

Now take $f(0)=0$, and substitute back into (1):

\[
\begin{aligned}
& f(f(y))=f(y) \Longrightarrow f(y) \text{ is a fixed point} \\
& \left\{\begin{aligned}
P(x,-x) & \Longleftrightarrow f(x)+f\left(-x^{2}\right)=x-x f(x) \\
P(-x, x) & \Longleftrightarrow f(-x)+f\left(-x^{2}\right)=-x+x f(-x)
\end{aligned}\right. \\
& \Longrightarrow f(x)-f(-x)=x(2-f(x)-f(-x)) \quad(P(x,-x)-P(-x, x)) \\
& \Longrightarrow (x \text{ is a fixed point} \Longrightarrow -x \text{ is a fixed point})
\end{aligned}
\]

We cannot conclude for $x=1$, but we know that -1 is a fixed point because $(-1)+f(-1+1)=-1$ is a fixed point from (3), and $P(-1,1)$ gives $f(1)=1$.

Substituting $f(0)=0$ into (1), we also have:

\[
f(x+f(x))=x+f(x) \Longrightarrow x+f(x) \text{ is a fixed point}
\]

We want to find $x$ and $y$ such that $x+y$ and $2x+y$ are fixed points, so as to eliminate two terms in the equation. We know that $f(z)$ and $z+f(z)$ are fixed points from (4) and (6), so we can naturally try $x+y=f(z)$ and $2x+y=z+f(z)$, which gives $x=z$ and $y=f(z)-z$. This results in:

\[
\begin{gathered}
z+f(z)+f(z(f(z)-z))=z+f(z)+(f(z)-z) f(z) \\
\Longrightarrow f(z(f(z)-z))=(f(z)-z) f(z) \quad(7)
\end{gathered}
\]

The term in $xy$ is symmetric, but not the term in $y f(x)$. Therefore, it is beneficial to do the same in the other direction ($y=z$ and $x=f(z)-z$). This gives:

\[
f(z(f(z)-z))=z f(f(z)-z)
\]

Using everything at our disposal, we also know that $-f(z)$ and $-z-f(z)$ are fixed points, so we can replace $x$ by $-x$ and $y$ by $-y$ in what we did previously. This gives, similarly:

\[
\begin{gathered}
f(z(f(z)-z))=-z f(z-f(z)) \\
f(z(f(z)-z))=-(f(z)-z) f(-z)
\end{gathered}
\]

We obtain, among other things, by combining (8) and (10) for example, that $f$ is odd on non-fixed points, and also on fixed points as shown. We can now use (5) which gives:

\[
2 f(x)=2 x \Longrightarrow f(x)=x
\]

This concludes the proof.

## 5 Generating Functions (Timothée Rocquet)

The course was mainly inspired by http://www.math.ens.fr/ budzinski/ polys/Combinatoire/Avanc\%C3\%A9/2013_courstd.pdf