title: Quicker calculation of double integral in python (like MatLab's integral2)
body: <p>I'm needing to perform a 2D-integration (one dimension has an infinite bound). In MatLab, I have done it with integral2:</p>
  
  <pre><code>int_x = integral2(fun, 0, inf, 0, a, 'abstol', 0, 'reltol', 1e-6);
  </code></pre>
  
  <p>In Python, I've tried scipy's dblquad:</p>
  
  <pre><code>int_x = scipy.integrate.dblquad(fun, 0, numpy.inf, lambda x: 0, lambda x: a, epsabs=0, epsrel=1e-6)
  </code></pre>
  
  <p>and have also tried using nested single quads.  Unfortunately, both of the scipy options take ~80x longer than MatLab's.</p>
  
  <p>My question is: is there a different implementation of 2D integrals within Python that might be faster (I've tried "quadpy" without much benefit)?  Alternatively, could I compile MatLab's integral2 function and call it from python without needing the MatLab runtime (and is that even kosher)?</p>
  
  <p>Thanks in advance!
  Brad</p>
  
  <hr>
  
  <p>Update:</p>
  
  <p>Turns out that I don't have the "reputation" to post an image of the equation, so please bear with the formatting: fun(N,t) = P(N) N^2 S(N,t), where P(N) is a lognormal probability distribution and S(N,t) is fairly convoluted but is an exponential in its simplest form and a hypergeometric function (truncated series) in its most complex form.  N is integrated from 0 to infinity and t from 0 to pi. </p>