Modern numeric compute frameworks provide automatic differentiation to calculate derivatives, including Tensorflow and Jax.