Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

You could try with numerical_integral. You didn't provide definition of B(), so here is example with simpler function:

sage: var('d h')
  (d, h)
sage:  integral(integral(exp(-(h-1)^2-(d-2)^2), d, 0,Infinity), h, 0, Infinity)
  1/4*pi + 1/4*(pi + pi*erf(1))*erf(2) + 1/4*pi*erf(1)
sage: n(_)
sage: numerical_integral(lambda h: numerical_integral(lambda d:exp(-(h-1)^2-(d-2)^2), 0,Infinity)[0], 0, Infinity)
  (2.8877377671374997, 2.8275945874944256e-06)

BTW: I'd like to know how to do the above without 'lambda'.

BTW2: Are you sure your integral converges at d=0?