So we have a function $f(x) = g(x)h(y(x))$ that is convex in $y$ which we want to optimize by choosing the appropriate $y(x)$. I have seen the following done in engineering books, but it just looks so cheesy and pitfall-y.
$\frac{\partial f(x)}{\partial [y(x)]} = g(x)h'(y(x)) = 0$. Solve for $y(x)$ and we are done.
But when taking the partial, aren't we assuming $x$ is fixed? But if $x$ is fixed, so is $y(x)$ and so the partial should be zero! Is this all engineering type handwaving? Why does it work at all?