Finding a function $f:(0, \infty) \to(0, \infty)$ satisfying the differential equation ${f}'\left( \frac{a}{x} \right)=\frac{x}{f\left( x \right)}$ 
Let $f:(0, \infty) \to(0, \infty)$ be a differentiable function such that ${f}'\left( \frac{a}{x} \right)=\frac{x}{f\left( x \right)}$ where $a$ is positive constant and $f'(1) = 1$, $f'(2) = 2$, then find the value of $f(5)$.

Since the arguments of $f$ and $f'$ are different, it is not possible for me to solve the differential equation directly. By hit and trial, I got the function as $\frac{x^2}2$, but cannot solve it mathematically. Can someone please provide me some hints for this?
 A: Let $\varphi(x) := f(x) f\left(\frac{a}{x}\right)$. Differentiating we get, for every $x > 0$,
$$
\varphi'(x) = f'(x) f\left(\frac{a}{x}\right)+f(x) \left[f\left(\frac{a}{x}\right)\right]'
= \frac{a}{x f\left(\frac{a}{x}\right)} f\left(\frac{a}{x}\right)- \frac{a}{x^2} f(x) \frac{x}{f(x)} = 0.
$$
Hence there exists $c > 0$ such that $\varphi(x) = c$ for every $x > 0$.
Since
$$
f'(x) = \frac{a}{x f(a/x)} = \frac{a}{c} \cdot \frac{f(x)}{x}
$$
integrating we get
$$
f(x) = f(1) x^{a/c}.
$$
Substituting in $f'(x) = \frac{a}{c} f(1) x^{a/c - 1}$ the values $x=1$ and $x=2$ we finally get $a/c = 2$ and $f(1) = 1/2$, so that $a=2$ and
$f(x) = x^2/2$.
A: Using $f'\left(\dfrac{a}{x}\right)=\dfrac{x}{f(x)}$, and performing the substitution $x \to \dfrac{a}{x}$, we get $f'(x)=\dfrac{a}{xf\left(\dfrac{a}{x}\right)}$, Now differentiating both sides yields $$f''(x)=\dfrac{-a\left(f\left(\dfrac{a}{x}\right)-\dfrac{a}{f(x)}\right)}{x^2f^2\left(\dfrac{a}{x}\right)}$$ Now substituting the value of $f\left(\dfrac{a}{x}\right)$, we get our final DE as $$\dfrac{f''(x)}{f'(x)}=\dfrac{1}{x}-\dfrac{f'(x)}{f(x)}$$Now integrating this, and using initial conditions, one finds out that $f'(x)=\dfrac{x}{f(x)}$, which implies $f(x)=\dfrac{x^2}{2} \implies f(5)=12.5.$
