In: Advanced Math
if you have a numerically integrate an arithmetic function. What technique is considered to be the most efficient in terms of accuracy versus effort? Is this always so? explain.
When it comes to the general case, there is really no "best method" for calculating numerically an integral. Such a method, if it existed, would be both reliable and efficient in solving a problem for which the exact result is not known a priority. In other words, it would be able to achieve a user-defined precision while minimizing the number of function calls and would be able to do all that for any class of integrand and any dimension of the problem. This is simply not possible.
In the case of a one-dimensional integrand without singularities, methods of Adaptive Quadrature (AQ), without being necessarily the best, may still be considered as standard general-purpose methods that are reasonably simple, reliable and efficient . They use internally (as a workhorse) one or more routines based on either Gaussian, Simpson or even trapezoidal rules. They do not subdivide uniformly the interval of integration but rather choose selectively where to evaluate the integrand, placing more/less points in high/low oscillatory regions, so as to achieve a predefined precision at a significantly reduced cost. Global AQ methods may be considered also. They usually are more reliable but are also more difficult to implement.
For high-dimension problems, the cost of deterministic methods increases exponentially with the dimension. Here again, reduced cost can be achieved using a stochastic AQ strategy via the use of, for example, a Monte Carlo integration with recursive stratified sampling.