# Matlab double integral

I'm trying to solve a nonlinear system of algebraic (not differential) equations which involves double integrals. I want to use Matlab. There seems to be two functions that can do double integration: dblquad and quad2d.

I noticed that the latter is much faster than the former (100+ times). But I don't know the accuracy. I used both functions to evaluate my integrals (which involves bivariate normal density) and got different answers. I chose a rectangular region around the mean in both cases, since Matlab (I think most numerical algorithms) seems to have difficulty finding the substantial values of the integrand if the region is too big and gives me 0.

My question is: does anyone know the difference of these two functions (in terms of integrating mechanism) as well as accuracy?

Thanks.

-
Did you make sure you exploited any symmetry in your integrands? The problem with the cubature of products of Gaussians is that if the peak is too small, sampling might miss it, which is supposed to contribute to the bulk of the integral. Could you maybe post the function you're trying to integrate? –  Guess who it is. May 3 '11 at 4:03
What I'm trying to integrate is $E[c((a_1X_1)^{\alpha_1}+(a_2X_2)^{\alpha_2})X_1^{\alpha_1}]$ where $(X_1,X_2)$ is bivariate normal (correlated) and $c$ is some piecewise linear/quadratic function. –  GWu May 3 '11 at 4:09
Note that dblquad is essentially a Cartesian product version of quad (i.e., think of computing the double integral by using quad with an integrand whose expression also involves quad), and thus is likely to be slow (due to the adaptive nature of quad) if the integrand has a lot of "features". –  Guess who it is. May 3 '11 at 4:10
Anything special about the $a_i$ and the $\alpha_i$? –  Guess who it is. May 3 '11 at 4:11
I double checked using Mathematica function NIntegrate[]. In that case, I simply integrate over the whole plane and don't have to choose a smaller integration region. It seems that Mathematica agrees with dblquad. But that too slow for solving my system because it calls the function many times. –  GWu May 3 '11 at 4:13