And I don't think that the common differential equation is the ideal form when dealing with that situation.
(Take for example g(x) = -f(-x), the gradients at x and -x are not equivalent for Δx, but would be for 𝛿x.)
Anyway,
(limit(h -> 0)((f(x + h) - f(x))/h)
Why do we even need h? It's just (the infinitesimal) 𝛿x multiplied by an arbitrary finite constant.(You're dealing with a linear equivalent infinitesimal subsection of the graph - so 𝛿x and 𝛿y scale linearly with each other.)
So remove h:
((f(x + 𝛿x) - f(x))/𝛿x)
Looks cleaner. (f(x + 𝛿x) - f(x))/𝛿x ≡ (f(x) - f(x - 𝛿x))/𝛿x ≡ (f(x + 𝛿x) - f(x - 𝛿x))/(2 * 𝛿x)
You can take the gradient from x to (x + 𝛿x) or from (x - 𝛿x) to x, or from (x - 𝛿x) to (x + 𝛿x).(The cube-root of the other three forms is also a valid differential equation, if you want to be evil about it.)
(f(x + 𝛿x) - f(x - 𝛿x))/(2 * 𝛿x)
(That's a nicer form for programmatic use; resolving the earlier mentioned gradient issue when dealing with finite deltas.)Another thing I noticed: the standard (h -> 0) form eliminates all parts of the gradient containing 𝛿x values - which is fine for infinitesimal 𝛿x, but is less ideal for finite Δx.