# 2014 USAJMO Problems/Problem 3

## Problem

Let $\mathbb{Z}$ be the set of integers. Find all functions $f : \mathbb{Z} \rightarrow \mathbb{Z}$ such that $$xf(2f(y)-x)+y^2f(2x-f(y))=\frac{f(x)^2}{x}+f(yf(y))$$ for all $x, y \in \mathbb{Z}$ with $x \neq 0$.

## Solution

Let's assume $f(0)\neq 0.$ Substitute $(x,y)=(2f(0),0)$ to get $$2f(0)^2=f(2f(0))^2/2f(0)+f(0)$$ $$2f(0)^2(2f(0)-1)=f(2f(0))^2$$

This means that $2(2f(0)-1)$ is a perfect square. However, this is impossible, as it is equivalent to $2\pmod{4}.$ Therefore, $f(0)=0.$ Now substitute $x\neq 0, y=0$ to get $$xf(-x)=\frac{f(x)^2}{x} \implies x^2f(-x)=f(x)^2.$$ Similarly, $$x^2f(x)=f(-x)^2.$$ From these two equations, we can find either $f(x)=f(-x)=0,$ or $f(x)=f(-x)=x^2.$ Both of these are valid solutions on their own, so let's see if there are any solutions combining the two.

Let's say we can find $f(x)=x^2, f(y)=0,$ and $x,y\neq 0.$ Then $$xf(-x)+y^2f(2x)=f(x)^2/x.$$ $$y^2f(2x)=x-x^3.$$

If $f(2x)=4x^2,$ then $y^2=\frac{x-x^3}{4x^2}=\frac{1-x^2}{4x},$ which is only possible when $y=0.$ This contradicts our assumption. Therefore, $f(2x)=0.$ This forces $x=\pm 1$ due to the right side of the equation. Let's consider the possibility $f(2)=0, f(1)=1.$ Substituting $(x,y)=(2,1)$ into the original equation yields $$0=2f(0)+1f(2)=0+f(1)=1,$$ which is impossible. So $f(2)=f(-2)=4$ and there are no solutions "combining" $f(x)=x^2$ and $f(x)=0.$

Therefore our only solutions are $\boxed{f(x)=0}$ and $\boxed{f(x)=x^2.}$