I used the Tag Set Delayed to set

F /: D[F[f_], x_] := F[D[f, x]]

It works if I give as input a single F:

D[F[g[x]],x] = F[g'[x]]

the result is as expected. However if I insert a linear combination of Fs

D[F[g[x]] + F[h[x]], x] = F'[g[x]]g'[x]+F'[h[x]]h'[x]

instead of

D[F[g[x]] + F[h[x]], x] = F[g'[x]] + F[h'[x]]

I was expecting the last result since I thought that first the D would distribute on Fs

D[F[g[x]],x] + D[F[h[x]],x]

and then my Tag Set Delayed would have applied.



d[a_ + b_] := d[a] + d[b];

I gat the expected result

d[F[g[x]]+F[h[x]],x] = F[d[g[x],x]]+F[d[h[x],x]]

Which is what I would like to have with D.


How can I get the same behavior with D?

  • $\begingroup$ Can you provide a MWE? $\endgroup$
    – MaPo
    Feb 11, 2019 at 14:09
  • $\begingroup$ I was thinking F as an operator. Imagine F = Sum. It is linear and a derivative can be moved inside. $\endgroup$
    – MaPo
    Feb 11, 2019 at 14:26
  • $\begingroup$ With F = Sum there is no contradiction in D[Sum[f[x] , ...], x]. How can I have a similar structure with a generic F? $\endgroup$
    – MaPo
    Feb 11, 2019 at 14:33

1 Answer 1


You need to turn off automatic handling of derivatives for your function by adjusting the system options:

With[{old = OptionValue[SystemOptions["DifferentiationOptions"],"DifferentiationOptions"->"ExcludedFunctions"]},
    SetSystemOptions["DifferentiationOptions" -> "ExcludedFunctions" -> DeleteDuplicates[Append[old, F]]]

D[F[a_], r__] ^:= F[D[a, r]]


D[F[g[x]] + F[h[x]], x]

F[g'[x]] + F[h'[x]]


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.