Ask Your Question

Revision history [back]

well, as simple as it could be:

a,b,c = var('a,b,c')
c = 1
f = c*a*b
monte_carlo_integral(lambda new_a,new_b: f.subs({a: new_a, b: new_b}), [0,0], [3,3], 1000)

just replacing the old a,b with the new variables for the integral. (idk if its efficient or not)