# Defining derivatives of integrals

I am trying to define a derivative of a function which is itself an integral. The function GaussInt[f_,x_] is the integral over f (a function of x) with respect to the measure $\exp(-x^2/2)/\sqrt{2\pi}$. I prefer to use the function GaussInt rather than write out the integral to prevent mathematica from attempting to solve the integral (which it can't do, but it spends a lot of time trying). The problem is that GaussInt doesn't satisfy the usual chain rule. That is

D[GaussInt[f_,x_], z_]:= GaussInt[D[f,z], z]


but Mathematica uses the chain rule to decide

D[GaussInt[f_,x_], z_] := GaussInt'[f,x] D[f,z]


which usually leads to the wrong answer.

I can get around this by defining my own differentiation operator

Dd[GaussInt[a_,z_],x_] := GaussInt[Dd[a,x], z]


I then have to define all the usual rules for Dd. Although this works its is rather inelegant. My problem is I don't know how to robustly switch off the chain rule for differentiation when applied to my function GaussInt . Any ideas?

• What exactly is the input and output when you ask for the derivative of GaussInt? Are you doing D[GaussInt[f,x],x]? Because this evaluates to Derivative[0, 1][GaussInt][f, x] (which displays as $\mathrm{GaussInt}^{(0,1)}[f,x]$), not GaussInt'[f,x] (the latter doesn't make sense, as prime is only used for a single-variable function). – jjc385 Sep 8 '17 at 16:16
• Note that it would be better for you to post the actual input or output rather than putting them in a := form (unless, of course, your input was in the form of a := statement). – jjc385 Sep 8 '17 at 16:19

You could use Inactive :
Inactive[Integrate][f[x] Exp[-x^2/2]/Sqrt[2 π], x]

D[%, x]