I have a long analytical process where I have defined a stand in function Int[]
to act as a placeholder for either NIntegrate[]
or Integrate[]
. This way I can do algebra on equations that involve integrals without having Mathematica try to actually do the integration. However, at the end when I place in some numbers and leave some parameters to be defied later I always get a warning messages. Below is a very simple example that demos the issue:
After the analytical work say I'm left with:
fun = 42 Int[Exp[-(x/a)^2] + b, {x, 0, 5}]
I now want to create a function with the parameters a
and b
NewFun[a_, b_] := Evaluate[fun /. {Int -> NIntegrate}]
I get the warning: NIntegrate::inumr
Is there a better way to replace Int
with NIntegrate
then define my function?
I realize I could just turn off the message but that feels like cheating.