Skip to main content

plotting - error with NIntegrate and RegionPlot


Bug introduced in 10.2 or earlier and persisting through 11.0.1 or later





Here's a simplified example of what I'm trying to do:


RegionPlot[
NIntegrate[PDF[NormalDistribution[0, 1], a], {a, 0, y}] >= 0.2,
{x, -1, 1}, {y, 0.1, 0.7}]

(yes, it doesn't depend on x)


This returns an inscrutable error:


Throw::nocatch: "Uncaught \!\(Throw[\(-Holonomic`DifferentialRootReduceDump`y[NIntegrate`LevinRuleDump`x]\)
+ \*SuperscriptBox[\"Holonomic`DifferentialRootReduceDump`y\", \"\[Prime]\",

MultilineFunction->None][NIntegrate`LevinRuleDump`x],
NIntegrate`LevinRuleDump`FastLookupHolonomicDifferentialEquation]\) returned to top level."

I'm using Mathematica 10.2. Any ideas what's wrong?


EDIT: I'm not looking for algebraic simplifications or substituting Integrate for NIntegrate. The above code is just an example to reproduce the error. In the code I actually want to run, NIntegrate is the only option.



Answer



This is a bug in RegionPlot. For a possible workaround, try the following undocumented option


RegionPlot[NIntegrate[PDF[NormalDistribution[0, 1], a], {a, 0, y}] >= 0.2, 
{x, -1, 1}, {y, 0.1, 0.7}, "NumericalFunction" -> False]


Mathematica graphics


Comments