In some sense the question is a combination of defining an operator and defining numerical integration with parameters. For example, I want to define $I[f] = \int_0^1 f(x)dx$. and tried
I[f_?NumericQ] = NIntegrate[f[x], {x, 0, 1}]
but it returns the error Nintegrate: ... non-numerical values for all sampling points ...
What's the right way to do that?
SetDelayed :=instead ofSet =. Otherwise the integral will be evaluated at define time. – Daniel Huber Nov 17 '21 at 21:08Iis a protected symbol and represents the imaginary unit. – Roman Nov 17 '21 at 21:10