We consider the solution to a stochastic differential equation with a drift function which depends smoothly on some real parameter $$\lambda $$ λ , and admitting a unique invariant measure for any value of $$\lambda $$ λ around $$\lambda =0$$ λ=0 . Our aim is to compute the derivative with respect to $$\lambda $$ λ of averages with respect to the invariant measure, at $$\lambda =0$$ λ=0 . We analyze a numerical method which consists in simulating the process at $$\lambda =0$$ λ=0 together with its derivative with respect to $$\lambda $$ λ on a long time horizon. We give sufficient conditions implying uniform-in-time square integrability of this derivative. This allows in particular to compute efficiently the derivative with respect to $$\lambda $$ λ of the mean of an observable through Monte Carlo simulations.