Subfield: Algebra


Question: Denote by $\mathbb{R}^{+}$ the set of all positive real numbers. Find all functions $f: \mathbb{R}^{+} \rightarrow \mathbb{R}^{+}$ such that

$$
x f\left(x^{2}\right) f(f(y))+f(y f(x))=f(x y)\left(f\left(f\left(x^{2}\right)\right)+f\left(f\left(y^{2}\right)\right)\right)
\tag{1}
$$

for all positive real numbers $x$ and $y$.

Solution:
Taking $x=y=1$ in (1), we get $f(1) f(f(1))+f(f(1))=2 f(1) f(f(1))$ and hence $f(1)=1$. Swapping $x$ and $y$ in (1) and comparing with (1) again, we find

$$
x f\left(x^{2}\right) f(f(y))+f(y f(x))=y f\left(y^{2}\right) f(f(x))+f(x f(y)) .
\tag{2}
$$

Taking $y=1$ in (2), we have $x f\left(x^{2}\right)+f(f(x))=f(f(x))+f(x)$, that is,

$$
f\left(x^{2}\right)=\frac{f(x)}{x}
\tag{3}
$$

Take $y=1$ in (1) and apply (3) to $x f\left(x^{2}\right)$. We get $f(x)+f(f(x))=f(x)\left(f\left(f\left(x^{2}\right)\right)+1\right)$, which implies

$$
f\left(f\left(x^{2}\right)\right)=\frac{f(f(x))}{f(x)}
\tag{4}
$$

For any $x \in \mathbb{R}^{+}$, we find that

$$
f\left(f(x)^{2}\right) \stackrel{(3)}{=} \frac{f(f(x))}{f(x)} \stackrel{(4)}{=} f\left(f\left(x^{2}\right)\right) \stackrel{(3)}{=} f\left(\frac{f(x)}{x}\right)
\tag{5}
$$

It remains to show the following key step.

- Claim. The function $f$ is injective.

Proof. Using (3) and (4), we rewrite (1) as

$$
f(x) f(f(y))+f(y f(x))=f(x y)\left(\frac{f(f(x))}{f(x)}+\frac{f(f(y))}{f(y)}\right) .
\tag{6}
$$

Take $x=y$ in (6) and apply (3). This gives $f(x) f(f(x))+f(x f(x))=2 \frac{f(f(x))}{x}$, which means

$$
f(x f(x))=f(f(x))\left(\frac{2}{x}-f(x)\right)
\tag{7}
$$

Using (3), equation (2) can be rewritten as

$$
f(x) f(f(y))+f(y f(x))=f(y) f(f(x))+f(x f(y)) .
\tag{8}
$$

Suppose $f(x)=f(y)$ for some $x, y \in \mathbb{R}^{+}$. Then (8) implies

$$
f(y f(y))=f(y f(x))=f(x f(y))=f(x f(x)) .
$$

Using (7), this gives

$$
f(f(y))\left(\frac{2}{y}-f(y)\right)=f(f(x))\left(\frac{2}{x}-f(x)\right)
$$

Noting $f(x)=f(y)$, we find $x=y$. This establishes the injectivity.



By the Claim and (5), we get the only possible solution $f(x)=\frac{1}{x}$. It suffices to check that this is a solution. Indeed, the left-hand side of (1) becomes

$$
x \cdot \frac{1}{x^{2}} \cdot y+\frac{x}{y}=\frac{y}{x}+\frac{x}{y}
$$

while the right-hand side becomes

$$
\frac{1}{x y}\left(x^{2}+y^{2}\right)=\frac{x}{y}+\frac{y}{x}
$$

The two sides agree with each other.
Taking $x=y=1$ in (1), we get $f(1) f(f(1))+f(f(1))=2 f(1) f(f(1))$ and hence $f(1)=1$. Putting $x=1$ in (1), we have $f(f(y))+f(y)=f(y)\left(1+f\left(f\left(y^{2}\right)\right)\right)$ so that

$$
f(f(y))=f(y) f\left(f\left(y^{2}\right)\right) .
\tag{9}
$$

Putting $y=1$ in (1), we get $x f\left(x^{2}\right)+f(f(x))=f(x)\left(f\left(f\left(x^{2}\right)\right)+1\right)$. Using (9), this gives

$$
x f\left(x^{2}\right)=f(x)
\tag{10}
$$

Replace $y$ by $\frac{1}{x}$ in (1). Then we have

$$
x f\left(x^{2}\right) f\left(f\left(\frac{1}{x}\right)\right)+f\left(\frac{f(x)}{x}\right)=f\left(f\left(x^{2}\right)\right)+f\left(f\left(\frac{1}{x^{2}}\right)\right) .
$$

The relation (10) shows $f\left(\frac{f(x)}{x}\right)=f\left(f\left(x^{2}\right)\right)$. Also, using (9) with $y=\frac{1}{x}$ and using (10) again, the last equation reduces to

$$
f(x) f\left(\frac{1}{x}\right)=1
\tag{11}
$$

Replace $x$ by $\frac{1}{x}$ and $y$ by $\frac{1}{y}$ in (1) and apply (11). We get

$$
\frac{1}{x f\left(x^{2}\right) f(f(y))}+\frac{1}{f(y f(x))}=\frac{1}{f(x y)}\left(\frac{1}{f\left(f\left(x^{2}\right)\right)}+\frac{1}{f\left(f\left(y^{2}\right)\right)}\right) .
$$

Clearing denominators, we can use (1) to simplify the numerators and obtain

$$
f(x y)^{2} f\left(f\left(x^{2}\right)\right) f\left(f\left(y^{2}\right)\right)=x f\left(x^{2}\right) f(f(y)) f(y f(x)) .
$$

Using (9) and (10), this is the same as

$$
f(x y)^{2} f(f(x))=f(x)^{2} f(y) f(y f(x)) .
\tag{12}
$$

Substitute $y=f(x)$ in (12) and apply (10) (with $x$ replaced by $f(x)$ ). We have

$$
f(x f(x))^{2}=f(x) f(f(x)) .\tag{13}
$$

Taking $y=x$ in (12), squaring both sides, and using (10) and (13), we find that

$$
f(f(x))=x^{4} f(x)^{3}\tag{14}
$$

Finally, we combine (9), (10) and (14) to get

$$
y^{4} f(y)^{3} \stackrel{(14)}{=} f(f(y)) \stackrel{(9)}{=} f(y) f\left(f\left(y^{2}\right)\right) \stackrel{(14)}{=} f(y) y^{8} f\left(y^{2}\right)^{3} \stackrel{(10)}{=} y^{5} f(y)^{4},
$$

which implies $f(y)=\frac{1}{y}$.

Final answer: $f(x)=\frac{1}{x}$ for any $x \in \mathbb{R}^{+}$