3 ms·
then you need to know the first principle, sometime aka the definition of slope/rate/change, and limits/infinitesimals, which first principle is lim h->0{ (f(x+
by stevefan1999 5y ago
then you need to know the first principle, sometime aka the definition of slope/rate/change, and limits/infinitesimals, which first principle is lim h->0{ (f(x+h)-f(x))/((x+h)-x) }, but since computers cannot express them exactly -- due to it being a discrete system, computers can only approximate infinitesimals to some extent, if symbolic algebra systems (e.g. SageMath/SymPy) are not involved. You can still try to implement it as a real computer function such as `var dydx = (f: (x) => number, h: number = 0.00000001) => x => (f(x+h)-f(x))/h` by putting an extremely small value of h to get a pretty good result.