I want to create a computational rule like, $ \frac{\partial}{\partial h_{i}}\int f\left(h_{i}\right)di:=\frac{\partial f\left(h_{i}\right)}{\partial h_{i}}$ . This rule is somehow useful when doing models of heterogeneous agents. To achieve this, I use the code, Unprotect[D] D[Integrate[x_, i_], p_] := D[x, p] /; ! FreeQ[p, i] This works for codes like, D[Integrate[f[h[i]/p a], i], h[i]] which returns,Read more