2. Find all functions from the positive integers to the positive integers such that for all $x, y$ we have:
$$
2 y f\left(f\left(x^{2}\right)+x\right)=f(x+1) f(2 x y) \text {. }
$$
SOLUTION
First substitute $x=1$ to see that $f(2 y)=k y$ for all positive integers $y$, where $k=\frac{2 f(f(1)+1)}{f(2)}$ is a positive integer (since $k=f(2)$ ). Next substitute $x=2 z$ and $y=1$ to see that $f(2 z+1)=k z+1$ for all positive integers $z$. Then substitute $x=2 z+1$ and $y=1$ to find that $k=2$. So $f(x)=x$ for all integers $x \geq 2$. Using $k=\frac{2 f(f(1)+1)}{f(2)}$ we find that $f(1)=1$, and so $f$ is the identity. This is easily checked to satisfy the functional equation.