I'm trying to find stationary points of a numeric function. Any help would be appreciated.
Assume I have a numeric function g(x). I'm attempting the following:
deriv:=(x)->fdiff(g(t),t=x); (I can't use the D operator as it doesn't like g(x))
Now deriv(x) <- Can be computed and computes the value quickly and easily. However plot and other functions require algebraic functions. I can plot this (with difficulty) via the following
plot(deriv,-10..10) <- This avoids converting to algebraic function and runs as a procedure.
I can't use convert(deriv,algebraic) as it fails.
I want to use the Student[NumericalAnalysis]Roots command, but it requires an algebraic function and I can't use the procedure trick which I did in the plot command.
Does anyone know a better way of doing this? or is there a way I can write the numerical differivative as an algebraic function. (I've tried fsolve <- But this guy doesn't give me the correct answers generally).