Suppose I define $x(b) = \arg \max (-x^2/2+bx)$. I'd like to find the values of $b$ such that $x(b) = 0$. I tried running the code
x[b_] := x /. FindMaximum[-x^2/2 + b x, x][[2]]
FindRoot[x[b] == 0, {b, 0}]
but I get an error, even though the function x seems to work. I know this is a somewhat trivial example (since $x(b) = b$), but in the application I have in mind the maximizer may not have a closed form expression.
Thanks!


_?NumericQ:x[b_?NumericQ] := x /. FindMaximum[-x^2/2 + b x, x][[2]];– Michael E2 Oct 11 '16 at 19:41