How to solve a given differential equation of form $\frac{d}{dx}\left(f(x)^n\right)$? We have a differential equation of the form $$\frac{d}{dx}\left(f(x)^n\right)=f(nx).$$ By inspection we have $f(x)=\sin(x)$ for $n=2$. Are there any other solution?

After some trial and error I found that $f(x) = a x^b$ can be solved, when $n\neq1$, namely
$$
f'(x) = a b x^{b-1},
$$
$$
\frac{f(nx)}{nf(x)^{n-1}} = \frac{a n^b x^b}{n a^{n-1} x^{b(n-1)}} = a^{2-n} n^{b-1} x^{b(2-n)}.
$$
The powers of $x$ and the gains have to be the same, so
$$
b-1 = b(2-n) \to b = \frac{1}{n-1}
$$
$$
a b = a^{2-n} n^{b-1} \to a = \sqrt[n-1]{(n-1) n^{\frac{2-n}{n-1}}}.
$$
Thus the function as a function of $n$ can be written as
$$
f_n(x) = \sqrt[n-1]{(n-1)n^{\frac{2-n}{n-1}}x},
$$
but note that for this general solution I only used the "first" solution for $a$, when taking the $(n-1)$th root.
This general formula for the function gives $f_2(x) = x$, which differs from the OP solution of $f_2(x) = \sin{x}$, but that is probably because the differential equation is not causal, such that the initial conditions is not enough to find a particular solution also some information from the "future" is required.
