I am writing a computer program where I have $x$ real positive varying in the domain $[\sqrt{U}, U]$. I want the value of $x$ which maximizes:
$$ (1+ \sqrt{U}) - \frac{\sqrt{U}-1}{U-\sqrt{U}} x - \frac{U}{x} $$
("visually", it seems to be a bit above $2\sqrt{U}$) what is the best way to find it exactly?
$ax+\frac bx$ is minimized when $x=\sqrt{b/a}$, and equals $2\sqrt{ ab}$ at that point.