Skip to main content
1 of 2
xzczd
  • 68.4k
  • 9
  • 174
  • 489

NIntegrate evaluates its 1st argument while it has the attribute HoldAll?

NIntegrate owns the attribute HoldAll:

Attributes@NIntegrate
(* {HoldAll, Protected} *)

However, when reading this answer, I surprisingly noticed that at least in the following case the 1st argument of NIntegrate is actually evaluated!:

NIntegrate[BesselJ[9/2, x], {x, 1, 2}] // Trace

enter image description here

So my question is, does NIntegrate always evaluates its 1st argument? If the answer is Yes, what's the meaning of this design, why not simply use HoldRest?

xzczd
  • 68.4k
  • 9
  • 174
  • 489