The expression
Integrate[x^2, Flatten[{{x},{1,2}}]]
evaluates properly, to $\frac{7}{3}$. However,
NIntegrate[x^2, Flatten[{{x},{1,2}}]]
returns
NIntegrate::vars: Integration range specification Flatten[{{x},{1,2}}] is not of the form {x, xmin, ..., xmax}. >>
An explicit Evaluate
is required on the second parameter to make this work. So I assume that NIntegrate has a HoldAll
on its second parameter.
Did I have any way of knowing this before hand? That is, is this behavior documented? And, if it is (or even if it is not), why do the two functions behave differently?
NIntegrate
(and for other functions, too). Try also executingAttributes[NIntegrate]
. $\endgroup$NIntegrate
has aHoldAll
on its second parameter…" - well,HoldAll
does mean what it says; all inputs given are held. $\endgroup$