Mathematica tries to evaluate numerical functions symbolically.
Hi,
>>Mathematica tries to evaluate numerical functions symbolically.
Yes, but why would you use numerical functions with symbolic parameters?
If you define a numerical function, then protect it from being used with symbols.
f[a_] := NIntegrate[a x^2, {x, -1, 1}]
g[a_?NumericQ] := NIntegrate[a x^2, {x, -1, 1}]
f[2]
g[2]
f[a]
g[a]
I.M.
Same question, more replies, in http://community.wolfram.com/groups/-/m/t/205195 .
Best to keep things to a single thread so as to avoid fracturing a discussion… For future reference.