I don't understand the source of the failure of the following attempts to solve an equation involving the following very simple BezierFunction.
f = BezierFunction[{{0, 0}, {0, 0.8}, {1, 1}}];
The following three approaches fail, but in what I find to be a very odd way: the returned solution is 0.5, with no warning.
Solve[0.5 == Last[f[x]], x]
NSolve[0.5 == Last[f[x]], x]
Reduce[0.5 == Last[f[x]], x]
The following approach is successful (but produces a warning):
FindRoot[0.5 == f[x][[2]], {x, 0.5}]
To see what I find mysterious, consider the following trace.
Trace@NSolve[0.5 == Last[f[x]], x]
In particular, I would like to understand why Last[BezierFunction[{{0, 0}, {0, 0.8}, {1, 1}}][x]]
evaluates to x
within this trace. This is certainly not the behavior we get from ordinary functions (thank goodness):
h = t |-> {t + 1, t + 2};
Last[h[x]] (* x+2 *)
Instead, it behaves like an undefined symbol:
Clear[h]
Last[h[x]] (* x *)