Hi,
I think you want to have the derivative of your model function you have used for fitting. Is it with respect to the observables x or the parameters ?
If the function is represented as TF1 object, you can do as in this tutorial example. https://root.cern.ch/doc/master/exampleFunctor_8C.html
In this case you need the derivative of the objective function, the chi2 or the likelihood function.
You can get these functions from the Fitter class and if you have built them with gradient support they provide a method to compute the gradient. See for example ROOT: ROOT::Fit::Chi2FCN< DerivFunType, ModelFunType > Class Template Reference.
The tutorial ROOT: tutorials/fit/combinedFit.C File Reference showns an example on how to create the objective function and used it for fitting.
I can provide you an example where the gradient is used, but it is better you send me your code and I can modify to show how to get it in your code.