<?xml-stylesheet type="text/xsl" href="../styles/pmathml.xsl"?><html xmlns="http://www.w3.org/1999/xhtml" xmlns:h="http://www.w3.org/1999/xhtml" xmlns:dsi="http://www.w3.org/1999/xlink" xml:space="preserve"><head>
<!-- saved from url=(0014)about:internet -->
<title>
    NAG C Library Manual, Mark 8 : 
   d01 Chapter Introduction</title><link rel="stylesheet" href="../styles/libdoc.css" type="text/css"/><script type="text/javascript">
   function showLevel(_levelId){
    var thisLevel = document.getElementById(_levelId);
    var thisplus = document.getElementById( _levelId.concat('plus'));
    var thisminus = document.getElementById( _levelId.concat('minus'));
    if(thisLevel.style.display != "block"){
     thisLevel.style.display = "block";
     thisplus.style.display = "none";
     thisminus.style.display = "inline";
     }
    else{
     thisLevel.style.display = "none";
     thisminus.style.display = "none";
     thisplus.style.display = "inline";
     }
    }
  </script></head><body><hr/><div><a href="../../pdf/D01/d01_intro.pdf">d01 Chapter Introduction (pdf version)</a></div><div><a href="d01_conts.xml">Chapter Contents</a></div>
<div><a href="../mark8.xml">NAG C Library Manual</a></div><hr/><h1 class="libdoc">NAG C Library  Chapter Introduction<br/><br/>d01 &#8212; Quadrature</h1>
<div class="toc"><h3>Contents</h3>
<h2 class="toc"><a class="rtnref" href="#scope">1&#160;&#160;Scope of the Chapter</a></h2>
<h2 class="toc"><a class="rtnref" href="#background">2&#160;&#160;Background to the Problems</a></h2>
<h3 class="toc"><a class="rtnref" href="#intbackground1">2.1&#160;&#160;One-dimensional Integrals</a></h3>
<h3 class="toc"><a class="rtnref" href="#intbackground2">2.2&#160;&#160;Multi-dimensional Integrals</a></h3>
<h2 class="toc"><a class="rtnref" href="#available">3&#160;&#160;Recommendations on Choice and Use of Available Functions</a></h2>
<h3 class="toc"><a class="rtnref" href="#intrecomm_1">3.1&#160;&#160;One-dimensional Integrals over a Finite Interval</a></h3>
<h3 class="toc"><a class="rtnref" href="#intrecomm_2">3.2&#160;&#160;One-dimensional Integrals over a Semi-infinite or Infinite Interval</a></h3>
<h3 class="toc"><a class="rtnref" href="#intrecomm_3">3.3&#160;&#160;Multi-dimensional Integrals</a></h3>
<h2 class="toc"><a class="rtnref" href="#dtree">4&#160;&#160;Decision Trees</a></h2>
<h2 class="toc"><a class="rtnref" href="#index">5&#160;&#160;Index</a></h2>
<h2 class="toc"><a class="rtnref" href="#withdrawn">6&#160;&#160;Functions Withdrawn or Scheduled for Withdrawal</a></h2>
<h2 class="toc"><a class="rtnref" href="#references">7&#160;&#160;References</a></h2></div><h2><a name="scope" id="scope"/>1&#160;&#160;Scope of the Chapter</h2><div class="paramtext">This chapter provides functions for the numerical evaluation of definite integrals in one or more dimensions.</div><h2><a name="background" id="background"/>2&#160;&#160;Background to the Problems</h2><div class="paramtext">The functions in this chapter are designed to estimate:
</div><ol class="listalpha"><li class="listalpha">the value of a one-dimensional definite integral of the form

<div class="formula-eqn"><a name="eqn1" id="eqn1"/><table class="formula-eqn"><tr><td class="formula-eqn"><m:math xmlns:m="http://www.w3.org/1998/Math/MathML" display="block">
<m:munderover><m:mo>&#8747;</m:mo><m:mi>a</m:mi><m:mi>b</m:mi></m:munderover><m:mi>f</m:mi><m:mfenced separators=""><m:mi>x</m:mi></m:mfenced><m:mrow><m:mi>d</m:mi><m:mi>x</m:mi></m:mrow>
</m:math></td><td class="formula-eqn2">
      (1)
     </td></tr></table></div>

where <m:math xmlns:m="http://www.w3.org/1998/Math/MathML"><m:mi>f</m:mi><m:mfenced separators=""><m:mi>x</m:mi></m:mfenced></m:math>&#160;is defined by you, either at a set of points <m:math xmlns:m="http://www.w3.org/1998/Math/MathML"><m:mfenced separators=""><m:msub><m:mi>x</m:mi><m:mi>i</m:mi></m:msub><m:mo>,</m:mo><m:mrow><m:mi>f</m:mi><m:mfenced separators=""><m:msub><m:mi>x</m:mi><m:mi>i</m:mi></m:msub></m:mfenced></m:mrow></m:mfenced></m:math>, for <m:math xmlns:m="http://www.w3.org/1998/Math/MathML"><m:mi>i</m:mi><m:mo>=</m:mo><m:mn>1</m:mn><m:mo>,</m:mo><m:mn>2</m:mn><m:mo>,</m:mo><m:mo>&#8230;</m:mo><m:mo>,</m:mo><m:mi>n</m:mi></m:math>, where <m:math xmlns:m="http://www.w3.org/1998/Math/MathML"><m:mi>a</m:mi><m:mo>=</m:mo><m:msub><m:mi>x</m:mi><m:mn>1</m:mn></m:msub><m:mo>&lt;</m:mo><m:msub><m:mi>x</m:mi><m:mn>2</m:mn></m:msub><m:mo>&lt;</m:mo><m:mo>&#8943;</m:mo><m:mo>&lt;</m:mo><m:msub><m:mi>x</m:mi><m:mi>n</m:mi></m:msub><m:mo>=</m:mo><m:mi>b</m:mi></m:math>, or in the form of a function; and the limits of integration <m:math xmlns:m="http://www.w3.org/1998/Math/MathML"><m:mi>a</m:mi><m:mo>,</m:mo><m:mi>b</m:mi></m:math>&#160;may be finite or infinite.
 <div class="paramtext">Some methods are specially designed for integrands of the form
</div>
<div class="formula-eqn"><a name="eqn2" id="eqn2"/><table class="formula-eqn"><tr><td class="formula-eqn"><m:math xmlns:m="http://www.w3.org/1998/Math/MathML" display="block">
<m:mi>f</m:mi><m:mfenced separators=""><m:mi>x</m:mi></m:mfenced><m:mo>=</m:mo><m:mi>w</m:mi><m:mfenced separators=""><m:mi>x</m:mi></m:mfenced><m:mi>g</m:mi><m:mfenced separators=""><m:mi>x</m:mi></m:mfenced>
</m:math></td><td class="formula-eqn2">
      (2)
     </td></tr></table></div>
<div class="paramtext">
which contain a factor <m:math xmlns:m="http://www.w3.org/1998/Math/MathML"><m:mi>w</m:mi><m:mfenced separators=""><m:mi>x</m:mi></m:mfenced></m:math>, called the weight-function,  of a specific form.  These methods take full account of any peculiar behaviour attributable to the <m:math xmlns:m="http://www.w3.org/1998/Math/MathML"><m:mi>w</m:mi><m:mfenced separators=""><m:mi>x</m:mi></m:mfenced></m:math>&#160;factor.</div></li><li class="listalpha">the values of the one-dimensional indefinite integrals arising from  (<a class="eqnref" href="#eqn1">1</a>) where the ranges of integration are interior to the interval <m:math xmlns:m="http://www.w3.org/1998/Math/MathML"><m:mfenced separators="" open="[" close="]"><m:mi>a</m:mi><m:mo>,</m:mo><m:mi>b</m:mi></m:mfenced></m:math>.</li><li class="listalpha">the value of a multi-dimensional definite integral of the form

<div class="formula-eqn"><a name="eqn3" id="eqn3"/><table class="formula-eqn"><tr><td class="formula-eqn"><m:math xmlns:m="http://www.w3.org/1998/Math/MathML" display="block">
<m:msub><m:mo>&#8747;</m:mo><m:msub><m:mi>R</m:mi><m:mi>n</m:mi></m:msub></m:msub><m:mi>f</m:mi><m:mfenced separators=""><m:msub><m:mi>x</m:mi><m:mn>1</m:mn></m:msub><m:mo>,</m:mo><m:msub><m:mi>x</m:mi><m:mn>2</m:mn></m:msub><m:mo>,</m:mo><m:mo>&#8230;</m:mo><m:mo>,</m:mo><m:msub><m:mi>x</m:mi><m:mi>n</m:mi></m:msub></m:mfenced><m:mi>d</m:mi><m:msub><m:mi>x</m:mi><m:mi>n</m:mi></m:msub><m:mo>&#8943;</m:mo><m:mi>d</m:mi><m:msub><m:mi>x</m:mi><m:mn>2</m:mn></m:msub><m:mi>d</m:mi><m:msub><m:mi>x</m:mi><m:mn>1</m:mn></m:msub>
</m:math></td><td class="formula-eqn2">
      (3)
     </td></tr></table></div>

where <m:math xmlns:m="http://www.w3.org/1998/Math/MathML"><m:mi>f</m:mi><m:mfenced separators=""><m:msub><m:mi>x</m:mi><m:mn>1</m:mn></m:msub><m:mo>,</m:mo><m:msub><m:mi>x</m:mi><m:mn>2</m:mn></m:msub><m:mo>,</m:mo><m:mo>&#8230;</m:mo><m:mo>,</m:mo><m:msub><m:mi>x</m:mi><m:mi>n</m:mi></m:msub></m:mfenced></m:math>&#160;is a function defined by you and <m:math xmlns:m="http://www.w3.org/1998/Math/MathML"><m:msub><m:mi>R</m:mi><m:mi>n</m:mi></m:msub></m:math>&#160;is some region of <m:math xmlns:m="http://www.w3.org/1998/Math/MathML"><m:mi>n</m:mi></m:math>-dimensional space.
 <div class="paramtext">The simplest form of <m:math xmlns:m="http://www.w3.org/1998/Math/MathML"><m:msub><m:mi>R</m:mi><m:mi>n</m:mi></m:msub></m:math>&#160;is the <m:math xmlns:m="http://www.w3.org/1998/Math/MathML"><m:mi>n</m:mi></m:math>-rectangle defined by
</div>
<div class="formula-eqn"><a name="eqn4" id="eqn4"/><table class="formula-eqn"><tr><td class="formula-eqn"><m:math xmlns:m="http://www.w3.org/1998/Math/MathML" display="block">
<m:msub><m:mi>a</m:mi><m:mi>i</m:mi></m:msub><m:mo>&#8804;</m:mo><m:msub><m:mi>x</m:mi><m:mi>i</m:mi></m:msub><m:mo>&#8804;</m:mo><m:msub><m:mi>b</m:mi><m:mi>i</m:mi></m:msub><m:mtext>, &#8195;</m:mtext><m:mi>i</m:mi><m:mo>=</m:mo><m:mn>1</m:mn><m:mo>,</m:mo><m:mn>2</m:mn><m:mo>,</m:mo><m:mo>&#8230;</m:mo><m:mo>,</m:mo><m:mi>n</m:mi>
</m:math></td><td class="formula-eqn2">
      (4)
     </td></tr></table></div>
<div class="paramtext">
where <m:math xmlns:m="http://www.w3.org/1998/Math/MathML"><m:msub><m:mi>a</m:mi><m:mi>i</m:mi></m:msub></m:math>&#160;and <m:math xmlns:m="http://www.w3.org/1998/Math/MathML"><m:msub><m:mi>b</m:mi><m:mi>i</m:mi></m:msub></m:math>&#160;are constants.  When <m:math xmlns:m="http://www.w3.org/1998/Math/MathML"><m:msub><m:mi>a</m:mi><m:mi>i</m:mi></m:msub></m:math>&#160;and <m:math xmlns:m="http://www.w3.org/1998/Math/MathML"><m:msub><m:mi>b</m:mi><m:mi>i</m:mi></m:msub></m:math>&#160;are functions of  <m:math xmlns:m="http://www.w3.org/1998/Math/MathML"><m:msub><m:mi>x</m:mi><m:mi>j</m:mi></m:msub></m:math>&#160;(<m:math xmlns:m="http://www.w3.org/1998/Math/MathML"><m:mi>j</m:mi><m:mo>&lt;</m:mo><m:mi>i</m:mi></m:math>), the region can easily be transformed to the rectangular form (see page 266 of <a class="litref" href="#ref201">Davis  and Rabinowitz (1975)</a>).  Some of the methods described incorporate the transformation procedure.</div></li></ol><div class="paramtext">
</div><h3><a name="intbackground1" id="intbackground1"/>2.1&#160;&#160;One-dimensional Integrals</h3><div class="paramtext">To estimate the value of a one-dimensional integral, a quadrature rule uses an approximation in the form of a weighted sum of integrand values, i.e.,
</div>
<div class="formula-eqn"><a name="eqn5" id="eqn5"/><table class="formula-eqn"><tr><td class="formula-eqn"><m:math xmlns:m="http://www.w3.org/1998/Math/MathML" display="block">
<m:munderover><m:mo>&#8747;</m:mo><m:mi>a</m:mi><m:mi>b</m:mi></m:munderover><m:mi>f</m:mi><m:mfenced separators=""><m:mi>x</m:mi></m:mfenced><m:mrow><m:mi>d</m:mi><m:mi>x</m:mi></m:mrow><m:mo>&#8771;</m:mo><m:munderover><m:mo>&#8721;</m:mo><m:mrow><m:mi>i</m:mi><m:mo>=</m:mo><m:mn>1</m:mn></m:mrow><m:mi>N</m:mi></m:munderover><m:msub><m:mi>w</m:mi><m:mi>i</m:mi></m:msub><m:mi>f</m:mi><m:mfenced separators=""><m:msub><m:mi>x</m:mi><m:mi>i</m:mi></m:msub></m:mfenced><m:mtext>.</m:mtext>
</m:math></td><td class="formula-eqn2">
      (5)
     </td></tr></table></div>
<div class="paramtext">
The points <m:math xmlns:m="http://www.w3.org/1998/Math/MathML"><m:msub><m:mi>x</m:mi><m:mi>i</m:mi></m:msub></m:math>&#160;within the interval <m:math xmlns:m="http://www.w3.org/1998/Math/MathML"><m:mfenced separators="" open="[" close="]"><m:mi>a</m:mi><m:mo>,</m:mo><m:mi>b</m:mi></m:mfenced></m:math>&#160; are known as the abscissae, and the <m:math xmlns:m="http://www.w3.org/1998/Math/MathML"><m:msub><m:mi>w</m:mi><m:mi>i</m:mi></m:msub></m:math>&#160;are known as the weights.</div>
<div class="paramtext">More generally, if the integrand has the form (<a class="eqnref" href="#eqn2">2</a>),  the corresponding formula is
</div>
<div class="formula-eqn"><a name="eqn6" id="eqn6"/><table class="formula-eqn"><tr><td class="formula-eqn"><m:math xmlns:m="http://www.w3.org/1998/Math/MathML" display="block">
<m:munderover><m:mo>&#8747;</m:mo><m:mi>a</m:mi><m:mi>b</m:mi></m:munderover><m:mi>w</m:mi><m:mfenced separators=""><m:mi>x</m:mi></m:mfenced><m:mi>g</m:mi><m:mfenced separators=""><m:mi>x</m:mi></m:mfenced><m:mrow><m:mi>d</m:mi><m:mi>x</m:mi></m:mrow><m:mo>&#8771;</m:mo><m:munderover><m:mo>&#8721;</m:mo><m:mrow><m:mi>i</m:mi><m:mo>=</m:mo><m:mn>1</m:mn></m:mrow><m:mi>N</m:mi></m:munderover><m:msub><m:mi>w</m:mi><m:mi>i</m:mi></m:msub><m:mi>g</m:mi><m:mfenced separators=""><m:msub><m:mi>x</m:mi><m:mi>i</m:mi></m:msub></m:mfenced><m:mtext>.</m:mtext>
</m:math></td><td class="formula-eqn2">
      (6)
     </td></tr></table></div>
<div class="paramtext">
If the integrand is known only at a fixed set of points, these points must be used as the abscissae, and the weighted sum is calculated using finite-difference methods.  However, if the functional form of the integrand is known, so that its value at any abscissa is easily obtained, then a wide variety of quadrature rules are available, each characterised by its choice of abscissae and the corresponding weights.</div>
<div class="paramtext">The appropriate rule to use will depend on the interval <m:math xmlns:m="http://www.w3.org/1998/Math/MathML"><m:mfenced separators="" open="[" close="]"><m:mi>a</m:mi><m:mo>,</m:mo><m:mi>b</m:mi></m:mfenced></m:math>&#160; &#8211; whether finite or otherwise &#8211; and on the form of any <m:math xmlns:m="http://www.w3.org/1998/Math/MathML"><m:mi>w</m:mi><m:mfenced separators=""><m:mi>x</m:mi></m:mfenced></m:math>&#160;factor in the integrand.  A suitable value of <m:math xmlns:m="http://www.w3.org/1998/Math/MathML"><m:mi>N</m:mi></m:math>&#160;depends on the general behaviour of <m:math xmlns:m="http://www.w3.org/1998/Math/MathML"><m:mi>f</m:mi><m:mfenced separators=""><m:mi>x</m:mi></m:mfenced></m:math>;  or of <m:math xmlns:m="http://www.w3.org/1998/Math/MathML"><m:mi>g</m:mi><m:mfenced separators=""><m:mi>x</m:mi></m:mfenced></m:math>, if there is a <m:math xmlns:m="http://www.w3.org/1998/Math/MathML"><m:mi>w</m:mi><m:mfenced separators=""><m:mi>x</m:mi></m:mfenced></m:math>&#160;factor present.</div>
<div class="paramtext">Among possible rules, we mention particularly the Gaussian formulae, which employ a distribution of abscissae which is optimal for <m:math xmlns:m="http://www.w3.org/1998/Math/MathML"><m:mi>f</m:mi><m:mfenced separators=""><m:mi>x</m:mi></m:mfenced></m:math>&#160; or <m:math xmlns:m="http://www.w3.org/1998/Math/MathML"><m:mi>g</m:mi><m:mfenced separators=""><m:mi>x</m:mi></m:mfenced></m:math>&#160;of polynomial form.</div>
<div class="paramtext">The choice of basic rules constitutes one of the principles on which methods for one-dimensional integrals may be classified.  The other major basis of classification is the implementation strategy, of which some types are now presented.
</div><ol class="listalpha"><li class="listalpha">Single rule evaluation procedures
 <div class="paramtext">A fixed number of abscissae, <m:math xmlns:m="http://www.w3.org/1998/Math/MathML"><m:mi>N</m:mi></m:math>, is used.  This number and the particular rule chosen uniquely determine the weights and abscissae.  No estimate is made of the accuracy of the result.</div></li><li class="listalpha">Automatic procedures
 <div class="paramtext">The number of abscissae, <m:math xmlns:m="http://www.w3.org/1998/Math/MathML"><m:mi>N</m:mi></m:math>, within <m:math xmlns:m="http://www.w3.org/1998/Math/MathML"><m:mfenced separators="" open="[" close="]"><m:mi>a</m:mi><m:mo>,</m:mo><m:mi>b</m:mi></m:mfenced></m:math>&#160;is gradually increased until consistency is achieved to within a level of accuracy (absolute or relative) requested by you.  There are essentially two ways of doing this; hybrid forms of these two methods are also possible:
 </div><ol class="listroman"><li class="listroman">whole interval procedures (non-adaptive)
  <div class="paramtext">A series of rules using increasing values of <m:math xmlns:m="http://www.w3.org/1998/Math/MathML"><m:mi>N</m:mi></m:math>&#160;are successively applied over the whole interval <m:math xmlns:m="http://www.w3.org/1998/Math/MathML"><m:mfenced separators="" open="[" close="]"><m:mi>a</m:mi><m:mo>,</m:mo><m:mi>b</m:mi></m:mfenced></m:math>.  It is clearly more economical if abscissae already used for a lower value of <m:math xmlns:m="http://www.w3.org/1998/Math/MathML"><m:mi>N</m:mi></m:math>&#160;can be used again as part of a higher-order formula.  This principle is known as <b>optimal extension</b>.  There is no overlap between the abscissae used in Gaussian formulae of different orders.  However, the Kronrod formulae are designed to give an optimal  <m:math xmlns:m="http://www.w3.org/1998/Math/MathML"><m:mfenced separators=""><m:mn>2</m:mn><m:mi>N</m:mi><m:mo>+</m:mo><m:mn>1</m:mn></m:mfenced></m:math>-point formula by adding <m:math xmlns:m="http://www.w3.org/1998/Math/MathML"><m:mfenced separators=""><m:mi>N</m:mi><m:mo>+</m:mo><m:mn>1</m:mn></m:mfenced></m:math>&#160; points to an <m:math xmlns:m="http://www.w3.org/1998/Math/MathML"><m:mi>N</m:mi></m:math>-point Gauss formula.  Further extensions have been developed by Patterson.</div></li><li class="listroman">adaptive procedures
  <div class="paramtext">The interval <m:math xmlns:m="http://www.w3.org/1998/Math/MathML"><m:mfenced separators="" open="[" close="]"><m:mi>a</m:mi><m:mo>,</m:mo><m:mi>b</m:mi></m:mfenced></m:math>&#160;is repeatedly divided into a number of sub-intervals, and integration rules are applied separately to each sub-interval.  Typically, the subdivision process will be carried further in the neighbourhood of a sharp peak in the integrand than where the curve is smooth.  Thus, the distribution of abscissae is adapted to the shape of the integrand.</div>
  <div class="paramtext">Subdivision raises the problem of what constitutes an acceptable accuracy in each sub-interval.  The usual <b>global acceptability criterion</b> demands that the sum of the absolute values of the error estimates in the sub-intervals should meet the conditions required of the error over the whole interval.  Automatic extrapolation over several levels of subdivision may eliminate the effects of some types of singularities.</div></li></ol><div class="paramtext">
 </div></li></ol><div class="paramtext">
An ideal general-purpose method would be an automatic method which could be used for a wide variety of integrands, was efficient (i.e., required the use of as few abscissae as possible), and was reliable (i.e., always gave results to within the requested accuracy).  Complete reliability is unobtainable, and generally higher reliability is obtained at the expense of efficiency, and vice versa.  <b>It must therefore be emphasised that the automatic functions in this chapter cannot be assumed to be 100% reliable.  In general, however, the reliability is very high.</b></div><h3><a name="intbackground2" id="intbackground2"/>2.2&#160;&#160;Multi-dimensional Integrals</h3><div class="paramtext">A distinction must be made between cases of moderately low dimensionality  (say, up to 4 or 5 dimensions), and those of higher dimensionality.  Where the number of dimensions is limited, a one-dimensional method may be applied to each dimension, according to some suitable strategy, and high accuracy may be obtainable (using product rules).  However, the number of integrand evaluations rises very rapidly with the number of dimensions,  so that the accuracy obtainable with an acceptable amount of computational labour is limited; for example a product of 3-point rules in 20 dimensions would require more than <m:math xmlns:m="http://www.w3.org/1998/Math/MathML"><m:msup><m:mn>10</m:mn><m:mn>9</m:mn></m:msup></m:math>&#160;integrand evaluations.  Special techniques such as the Monte Carlo methods can be used to deal with high dimensions.

</div><ol class="listalpha"><li class="listalpha">Products of one-dimensional rules
 <div class="paramtext">Using a two-dimensional integral as an example, we have
</div>
<div class="formula-eqn"><a name="eqn7" id="eqn7"/><table class="formula-eqn"><tr><td class="formula-eqn"><m:math xmlns:m="http://www.w3.org/1998/Math/MathML" display="block">
<m:munderover><m:mo>&#8747;</m:mo><m:msub><m:mi>a</m:mi><m:mn>1</m:mn></m:msub><m:msub><m:mi>b</m:mi><m:mn>1</m:mn></m:msub></m:munderover><m:munderover><m:mo>&#8747;</m:mo><m:msub><m:mi>a</m:mi><m:mn>2</m:mn></m:msub><m:msub><m:mi>b</m:mi><m:mn>2</m:mn></m:msub></m:munderover><m:mi>f</m:mi><m:mfenced separators=""><m:mi>x</m:mi><m:mo>,</m:mo><m:mi>y</m:mi></m:mfenced><m:mrow><m:mi>d</m:mi><m:mi>y</m:mi></m:mrow>
  <m:mrow><m:mi>d</m:mi><m:mi>x</m:mi></m:mrow><m:mo>&#8771;</m:mo><m:munderover><m:mo>&#8721;</m:mo><m:mrow><m:mi>i</m:mi><m:mo>=</m:mo><m:mn>1</m:mn></m:mrow><m:mi>N</m:mi></m:munderover><m:msub><m:mi>w</m:mi><m:mi>i</m:mi></m:msub>
<m:mfenced open="[" close="]" separators=""><m:munderover><m:mo>&#8747;</m:mo><m:msub><m:mi>a</m:mi><m:mn>2</m:mn></m:msub><m:msub><m:mi>b</m:mi><m:mn>2</m:mn></m:msub></m:munderover><m:mi>f</m:mi><m:mfenced separators=""><m:msub><m:mi>x</m:mi><m:mi>i</m:mi></m:msub><m:mo>,</m:mo><m:mi>y</m:mi></m:mfenced><m:mrow><m:mi>d</m:mi><m:mi>y</m:mi></m:mrow></m:mfenced>
</m:math></td><td class="formula-eqn2">
      (7)
     </td></tr></table></div>
<div class="paramtext">
</div>
<div class="formula-eqn"><a name="eqn8" id="eqn8"/><table class="formula-eqn"><tr><td class="formula-eqn"><m:math xmlns:m="http://www.w3.org/1998/Math/MathML" display="block">
<m:munderover><m:mo>&#8747;</m:mo><m:msub><m:mi>a</m:mi><m:mn>1</m:mn></m:msub><m:msub><m:mi>b</m:mi><m:mn>1</m:mn></m:msub></m:munderover><m:munderover><m:mo>&#8747;</m:mo><m:msub><m:mi>a</m:mi><m:mn>2</m:mn></m:msub><m:msub><m:mi>b</m:mi><m:mn>2</m:mn></m:msub></m:munderover><m:mi>f</m:mi><m:mfenced separators=""><m:mi>x</m:mi><m:mo>,</m:mo><m:mi>y</m:mi></m:mfenced><m:mrow><m:mi>d</m:mi><m:mi>y</m:mi></m:mrow>
  <m:mrow><m:mi>d</m:mi><m:mi>x</m:mi></m:mrow><m:mo>&#8771;</m:mo><m:munderover><m:mo>&#8721;</m:mo><m:mrow><m:mi>i</m:mi><m:mo>=</m:mo><m:mn>1</m:mn></m:mrow><m:mi>N</m:mi></m:munderover><m:munderover><m:mo>&#8721;</m:mo><m:mrow><m:mi>j</m:mi><m:mo>=</m:mo><m:mn>1</m:mn></m:mrow><m:mi>N</m:mi></m:munderover><m:msub><m:mi>w</m:mi><m:mi>i</m:mi></m:msub><m:msub><m:mi>v</m:mi><m:mi>j</m:mi></m:msub><m:mi>f</m:mi><m:mfenced separators=""><m:msub><m:mi>x</m:mi><m:mi>i</m:mi></m:msub><m:mo>,</m:mo><m:msub><m:mi>y</m:mi><m:mi>j</m:mi></m:msub></m:mfenced>
</m:math></td><td class="formula-eqn2">
      (8)
     </td></tr></table></div>
<div class="paramtext">
where <m:math xmlns:m="http://www.w3.org/1998/Math/MathML"><m:mfenced separators=""><m:msub><m:mi>w</m:mi><m:mi>i</m:mi></m:msub><m:mo>,</m:mo><m:msub><m:mi>x</m:mi><m:mi>i</m:mi></m:msub></m:mfenced></m:math>&#160;and <m:math xmlns:m="http://www.w3.org/1998/Math/MathML"><m:mfenced separators=""><m:msub><m:mi>v</m:mi><m:mi>i</m:mi></m:msub><m:mo>,</m:mo><m:msub><m:mi>y</m:mi><m:mi>i</m:mi></m:msub></m:mfenced></m:math>&#160;are the weights and abscissae of the rules used in the respective dimensions.</div>
 <div class="paramtext">A different one-dimensional rule may be used for each dimension, as appropriate to the range and any weight function present, and a different strategy may be used, as appropriate to the integrand behaviour as a function of each independent variable.</div>
 <div class="paramtext">For a rule-evaluation strategy in all dimensions, the formula  (<a class="eqnref" href="#eqn8">8</a>) is applied in a straightforward manner.  For automatic strategies (i.e., attempting to attain a requested accuracy),  there is a problem in deciding what accuracy must be requested in the inner integral(s).  Reference to formula (<a class="eqnref" href="#eqn7">7</a>) shows that the presence of a limited but random error in the <m:math xmlns:m="http://www.w3.org/1998/Math/MathML"><m:mi>y</m:mi></m:math>-integration for different values of <m:math xmlns:m="http://www.w3.org/1998/Math/MathML"><m:msub><m:mi>x</m:mi><m:mi>i</m:mi></m:msub></m:math>&#160;can produce a &#8216;jagged&#8217;  function of <m:math xmlns:m="http://www.w3.org/1998/Math/MathML"><m:mi>x</m:mi></m:math>, which may be difficult to integrate to the desired accuracy and for this reason products of automatic one-dimensional  functions should be used with caution (see <a class="litref" href="#ref203">Lyness (1983)</a>).</div></li><li class="listalpha">Monte Carlo methods
 <div class="paramtext">These are based on estimating the mean value of the integrand sampled at points chosen from an appropriate statistical distribution function.  Usually a variance reducing procedure is incorporated to combat the fundamentally slow rate of convergence of the rudimentary form of the technique.  These methods can be effective by comparison with alternative methods when the integrand contains singularities or is erratic in some way, but they are of quite limited accuracy.</div></li><li class="listalpha">Automatic adaptive procedures
 <div class="paramtext">An automatic adaptive strategy in several dimensions normally involves division of the region into subregions, concentrating the divisions in those parts of the region where the integrand is worst behaved.  It is difficult to arrange with any generality for variable limits in the inner integral(s).  For this reason, some methods use a region where all the limits are constants; this is called a hyper-rectangle.  Integrals over regions defined by variable or infinite limits may be handled by transformation to a hyper-rectangle.  Integrals over regions so irregular that such a transformation is not feasible may be handled by surrounding the region by an appropriate hyper-rectangle and defining the integrand to be zero outside the desired region.  Such a technique should always be followed by a Monte Carlo method for integration.</div>
 <div class="paramtext">The method used locally in each subregion produced by the adaptive subdivision process is usually one of three types: Monte Carlo, number theoretic or deterministic.  Deterministic methods are usually the most rapidly convergent but are often expensive to use for high dimensionality and not as robust as the other techniques.</div></li></ol><div class="paramtext">
</div><h2><a name="available" id="available"/>3&#160;&#160;Recommendations on Choice and Use of Available Functions</h2><div class="paramtext">The following three sub-sections consider in turn functions for: one-dimensional integrals over a finite interval, and over a semi-infinite or an infinite interval; and multi-dimensional integrals.  Within each sub-section, functions are classified by the type of method, which ranges from simple rule evaluation to automatic adaptive algorithms.  The recommendations apply particularly when the primary objective is simply to compute the value of one or more integrals, and in these cases the automatic adaptive functions are generally the most convenient and reliable, although also the most expensive in computing time.</div>
<div class="paramtext">Note however that in some circumstances it may be counter-productive to use an automatic function.  If the results of the quadrature are to be used in turn as input to a further computation (e.g., an &#8216;outer&#8217; quadrature or an optimization problem), then this further computation may be adversely affected by the &#8216;jagged performance profile&#8217; of an automatic function; a simple rule-evaluation function may provide much better overall performance.  For further guidance, the article by <a class="litref" href="#ref203">Lyness (1983)</a> is recommended.</div><h3><a name="intrecomm_1" id="intrecomm_1"/>3.1&#160;&#160;One-dimensional Integrals over a Finite Interval</h3><ol class="listalpha"><li class="listalpha">Integrand defined at a set of points
 <div class="paramtext">If <m:math xmlns:m="http://www.w3.org/1998/Math/MathML"><m:mi>f</m:mi><m:mfenced separators=""><m:mi>x</m:mi></m:mfenced></m:math>&#160;is defined numerically at four or more points, then the Gill&#8211;Miller finite difference method  (<a class="rtnref" href="../D01/d01gac.xml">nag_1d_quad_vals (d01gac)</a>) should be used.  The interval of integration is taken to coincide with the range of <m:math xmlns:m="http://www.w3.org/1998/Math/MathML"><m:mi>x</m:mi></m:math>&#160;values of the points supplied.  It is in the nature of this problem that any function may be unreliable.  In order to check results independently and so as to provide an alternative technique you may fit the integrand by Chebyshev-series using <a class="rtnref" href="../E02/e02adc.xml">nag_1d_cheb_fit (e02adc)</a> and then use functions <a class="rtnref" href="../E02/e02ajc.xml">nag_1d_cheb_intg (e02ajc)</a> and <a class="rtnref" href="../E02/e02akc.xml">nag_1d_cheb_eval2 (e02akc)</a> to evaluate its integral (which need not be restricted to the range of the integration points, as is the case for <a class="rtnref" href="../D01/d01gac.xml">nag_1d_quad_vals (d01gac)</a>).  A further alternative is to fit a cubic spline to the data using  <a class="rtnref" href="../E02/e02bac.xml">nag_1d_spline_fit_knots (e02bac)</a> and then to evaluate its integral using <a class="rtnref" href="../E02/e02bdc.xml">nag_1d_spline_intg (e02bdc)</a>.</div></li><li class="listalpha">Integrand defined as a function
 <div class="paramtext">If the functional form of <m:math xmlns:m="http://www.w3.org/1998/Math/MathML"><m:mi>f</m:mi><m:mfenced separators=""><m:mi>x</m:mi></m:mfenced></m:math>&#160;is known, then one of the following approaches should be taken.  They are arranged in the order from most specific to most general, hence the first applicable procedure in the list will be the most efficient.  <b>However, if you do not wish to make any assumptions about the integrand, the most reliable functions to use will be  <a class="rtnref" href="../D01/d01sjc.xml">nag_1d_quad_gen_1 (d01sjc)</a>.</b>
 </div><ol class="listroman"><li class="listroman">Rule-evaluation functions
  <div class="paramtext">If <m:math xmlns:m="http://www.w3.org/1998/Math/MathML"><m:mi>f</m:mi><m:mfenced separators=""><m:mi>x</m:mi></m:mfenced></m:math>&#160;is known to be sufficiently well behaved (more precisely, can be closely approximated by a polynomial of moderate degree),  a Gaussian function with a suitable number of abscissae may be used.</div>
  <div class="paramtext"><a class="rtnref" href="../D01/d01bac.xml">nag_1d_quad_gauss (d01bac)</a> may be used if it is not required to examine the weights and abscissae.</div></li><li class="listroman">Automatic adaptive functions
  <div class="paramtext">Firstly, several functions are available for integrands of the form <m:math xmlns:m="http://www.w3.org/1998/Math/MathML"><m:mi>w</m:mi><m:mfenced separators=""><m:mi>x</m:mi></m:mfenced><m:mi>g</m:mi><m:mfenced separators=""><m:mi>x</m:mi></m:mfenced></m:math>&#160;where <m:math xmlns:m="http://www.w3.org/1998/Math/MathML"><m:mi>g</m:mi><m:mfenced separators=""><m:mi>x</m:mi></m:mfenced></m:math>&#160;is a &#8216;smooth&#8217;  function (i.e., has no singularities, sharp peaks or violent oscillations in the interval of integration) and <m:math xmlns:m="http://www.w3.org/1998/Math/MathML"><m:mi>w</m:mi><m:mfenced separators=""><m:mi>x</m:mi></m:mfenced></m:math>&#160;is a weight function of one of the following forms.
 </div><ol class="listnumber"><li class="listnumber">if <m:math xmlns:m="http://www.w3.org/1998/Math/MathML"><m:mi>w</m:mi><m:mfenced separators=""><m:mi>x</m:mi></m:mfenced><m:mo>=</m:mo><m:msup>
<m:mfenced separators=""><m:mi>b</m:mi><m:mo>-</m:mo><m:mi>x</m:mi></m:mfenced>
<m:mi>&#945;</m:mi></m:msup><m:msup>
<m:mfenced separators=""><m:mi>x</m:mi><m:mo>-</m:mo><m:mi>a</m:mi></m:mfenced>
<m:mi>&#946;</m:mi></m:msup>   <m:msup><m:mfenced separators=""><m:mrow><m:mi>log</m:mi><m:mo>&#8289;</m:mo><m:mfenced separators=""><m:mi>b</m:mi><m:mo>-</m:mo><m:mi>x</m:mi></m:mfenced></m:mrow></m:mfenced><m:mi>k</m:mi></m:msup><m:msup><m:mfenced separators=""><m:mrow><m:mi>log</m:mi><m:mo>&#8289;</m:mo><m:mfenced separators=""><m:mi>x</m:mi><m:mo>-</m:mo><m:mi>a</m:mi></m:mfenced></m:mrow></m:mfenced><m:mi>l</m:mi></m:msup></m:math>,  where <m:math xmlns:m="http://www.w3.org/1998/Math/MathML"><m:mi>k</m:mi><m:mo>,</m:mo><m:mi>l</m:mi><m:mo>=</m:mo><m:mn>0</m:mn><m:mtext>&#8203; or &#8203;</m:mtext><m:mn>1</m:mn></m:math>, <m:math xmlns:m="http://www.w3.org/1998/Math/MathML"><m:mi>&#945;</m:mi><m:mo>,</m:mo><m:mi>&#946;</m:mi><m:mo>&gt;</m:mo><m:mrow><m:mo>-</m:mo><m:mn>1</m:mn></m:mrow></m:math>:  use <a class="rtnref" href="../D01/d01apc.xml">nag_1d_quad_wt_alglog (d01apc)</a>;</li><li class="listnumber">if <m:math xmlns:m="http://www.w3.org/1998/Math/MathML"><m:mi>w</m:mi><m:mfenced separators=""><m:mi>x</m:mi></m:mfenced><m:mo>=</m:mo><m:mfrac><m:mn>1</m:mn><m:mrow><m:mi>x</m:mi><m:mo>-</m:mo><m:mi>c</m:mi></m:mrow>
 </m:mfrac>
</m:math>: use <a class="rtnref" href="../D01/d01aqc.xml">nag_1d_quad_wt_cauchy (d01aqc)</a> (this integral is called the Hilbert transform of <m:math xmlns:m="http://www.w3.org/1998/Math/MathML"><m:mi>g</m:mi></m:math>);</li><li class="listnumber">if <m:math xmlns:m="http://www.w3.org/1998/Math/MathML"><m:mi>w</m:mi><m:mfenced separators=""><m:mi>x</m:mi></m:mfenced><m:mo>=</m:mo><m:mrow><m:mi>cos</m:mi><m:mo>&#8289;</m:mo><m:mfenced separators=""><m:mi>&#969;</m:mi><m:mi>x</m:mi></m:mfenced></m:mrow></m:math>&#160;or <m:math xmlns:m="http://www.w3.org/1998/Math/MathML"><m:mrow><m:mi>sin</m:mi><m:mo>&#8289;</m:mo><m:mfenced separators=""><m:mi>&#969;</m:mi><m:mi>x</m:mi></m:mfenced></m:mrow></m:math>: use <a class="rtnref" href="../D01/d01anc.xml">nag_1d_quad_wt_trig (d01anc)</a> (this function can also handle certain types of singularities in <m:math xmlns:m="http://www.w3.org/1998/Math/MathML"><m:mi>g</m:mi><m:mfenced separators=""><m:mi>x</m:mi></m:mfenced></m:math>).</li></ol><div class="paramtext">
  </div>
  <div class="paramtext">Secondly, there are some functions for general <m:math xmlns:m="http://www.w3.org/1998/Math/MathML"><m:mi>f</m:mi><m:mfenced separators=""><m:mi>x</m:mi></m:mfenced></m:math>.  If  <m:math xmlns:m="http://www.w3.org/1998/Math/MathML"><m:mi>f</m:mi><m:mfenced separators=""><m:mi>x</m:mi></m:mfenced></m:math>&#160;is known to be free of singularities, though it may be oscillatory, <a class="rtnref" href="../D01/d01skc.xml">nag_1d_quad_osc_1 (d01skc)</a> may be used.</div>
  <div class="paramtext">The most powerful of the finite interval integration functions 

is <a class="rtnref" href="../D01/d01sjc.xml">nag_1d_quad_gen_1 (d01sjc)</a>, which can cope with singularities of several types. 

It
may be used if none of the more specific situations described above applies.  

<a class="rtnref" href="../D01/d01sjc.xml">nag_1d_quad_gen_1 (d01sjc)</a> is 
somewhat more reliable, particularly where the integrand has singularities other than at an end point, or has discontinuities or cusps, and is therefore recommended where the integrand is known to be badly behaved, or where its nature is completely unknown.  
</div>
  <div class="paramtext">Most of the functions in this chapter require you to supply a function or function to evaluate the integrand at a single point.  
</div>
  <div class="paramtext">If <m:math xmlns:m="http://www.w3.org/1998/Math/MathML"><m:mi>f</m:mi><m:mfenced separators=""><m:mi>x</m:mi></m:mfenced></m:math>&#160;has singularities of certain types, discontinuities or sharp peaks <b>occurring at known points</b>, the integral should be evaluated separately over each of the subranges or 

<a class="rtnref" href="../D01/d01asc.xml">nag_1d_quad_inf_wt_trig (d01asc)</a>
  may be used.</div></li></ol><div class="paramtext">
 </div></li></ol><h3><a name="intrecomm_2" id="intrecomm_2"/>3.2&#160;&#160;One-dimensional Integrals over a Semi-infinite or Infinite Interval</h3><div class="paramtext">
</div><ol class="listalpha"><li class="listalpha">Integrand defined at a set of points
 <div class="paramtext">If <m:math xmlns:m="http://www.w3.org/1998/Math/MathML"><m:mi>f</m:mi><m:mfenced separators=""><m:mi>x</m:mi></m:mfenced></m:math>&#160;is defined numerically at four or more points,  and the portion of the integral lying outside the range of the points supplied may be neglected, then the Gill&#8211;Miller finite difference method,  <a class="rtnref" href="../D01/d01gac.xml">nag_1d_quad_vals (d01gac)</a>, should be used.</div></li><li class="listalpha">Integrand defined as a function
 <ol class="listroman"><li class="listroman">Rule evaluation functions
  <div class="paramtext">If <m:math xmlns:m="http://www.w3.org/1998/Math/MathML"><m:mi>f</m:mi><m:mfenced separators=""><m:mi>x</m:mi></m:mfenced></m:math>&#160;behaves approximately like a polynomial in  <m:math xmlns:m="http://www.w3.org/1998/Math/MathML"><m:mi>x</m:mi></m:math>, apart from a weight function of the form:
  </div><ol class="listnumber"><li class="listnumber"><m:math xmlns:m="http://www.w3.org/1998/Math/MathML"><m:msup><m:mi>e</m:mi><m:mrow><m:mo>-</m:mo><m:mi>&#946;</m:mi><m:mi>x</m:mi></m:mrow></m:msup><m:mo>,</m:mo><m:mi>&#946;</m:mi><m:mo>&gt;</m:mo><m:mn>0</m:mn></m:math>&#160;(semi-infinite interval, lower limit finite); or</li><li class="listnumber"><m:math xmlns:m="http://www.w3.org/1998/Math/MathML"><m:msup><m:mi>e</m:mi><m:mrow><m:mo>-</m:mo><m:mi>&#946;</m:mi><m:mi>x</m:mi></m:mrow></m:msup><m:mo>,</m:mo><m:mi>&#946;</m:mi><m:mo>&lt;</m:mo><m:mn>0</m:mn></m:math>&#160;(semi-infinite interval,  upper limit finite); or</li><li class="listnumber"><m:math xmlns:m="http://www.w3.org/1998/Math/MathML"><m:msup><m:mi>e</m:mi><m:mrow><m:mo>-</m:mo><m:mi>&#946;</m:mi><m:msup>
<m:mfenced separators=""><m:mi>x</m:mi><m:mo>-</m:mo><m:mi>&#945;</m:mi></m:mfenced>
<m:mn>2</m:mn></m:msup></m:mrow></m:msup><m:mo>,</m:mo><m:mi>&#946;</m:mi><m:mo>&gt;</m:mo><m:mn>0</m:mn></m:math>&#160;(infinite interval),</li></ol><div class="paramtext">
or if <m:math xmlns:m="http://www.w3.org/1998/Math/MathML"><m:mi>f</m:mi><m:mfenced separators=""><m:mi>x</m:mi></m:mfenced></m:math>&#160;behaves approximately like a polynomial in  <m:math xmlns:m="http://www.w3.org/1998/Math/MathML"><m:msup><m:mfenced separators=""><m:mi>x</m:mi><m:mo>+</m:mo><m:mi>b</m:mi></m:mfenced><m:mrow><m:mo>-</m:mo><m:mn>1</m:mn></m:mrow></m:msup></m:math>&#160;(semi-infinite range), then the Gaussian  functions may be used.</div>
  <div class="paramtext">
<a class="rtnref" href="../D01/d01tac.xml">nag_1d_quad_gauss_1 (d01tac)</a>
 may be used if it is not required to examine the weights and abscissae.</div></li><li class="listroman">Automatic adaptive functions
  <div class="paramtext">
<a class="rtnref" href="../D01/d01smc.xml">nag_1d_quad_inf_1 (d01smc)</a>
 may be used, except for integrands which decay slowly towards an infinite end point, and oscillate in sign over the entire range.  For this class, it may be possible to calculate the integral by integrating between the zeros and invoking some extrapolation process.</div>
  <div class="paramtext">
<a class="rtnref" href="../D01/d01ssc.xml">nag_1d_quad_inf_wt_trig_1 (d01ssc)</a>
 may be used for integrals involving weight functions of the form <m:math xmlns:m="http://www.w3.org/1998/Math/MathML"><m:mrow><m:mi>cos</m:mi><m:mo>&#8289;</m:mo><m:mfenced separators=""><m:mi>&#969;</m:mi><m:mi>x</m:mi></m:mfenced></m:mrow></m:math>&#160;and <m:math xmlns:m="http://www.w3.org/1998/Math/MathML"><m:mrow><m:mi>sin</m:mi><m:mo>&#8289;</m:mo><m:mfenced separators=""><m:mi>&#969;</m:mi><m:mi>x</m:mi></m:mfenced></m:mrow></m:math>&#160; over a semi-infinite interval (lower limit finite).</div>
  <div class="paramtext">The following alternative procedures are mentioned for completeness, though their use will rarely be necessary.
  </div><ol class="listnumber"><li class="listnumber">If the integrand decays rapidly towards an infinite end point, a finite cut-off may be chosen, and the finite range methods applied.</li><li class="listnumber">If the only irregularities occur in the finite part (apart from a singularity at the finite limit, with which 

<a class="rtnref" href="../D01/d01smc.xml">nag_1d_quad_inf_1 (d01smc)</a>
  can cope), the range may be divided, with 

<a class="rtnref" href="../D01/d01smc.xml">nag_1d_quad_inf_1 (d01smc)</a> used on the infinite part.</li><li class="listnumber">A transformation to finite range may be employed,e.g.,

<div class="formula"><table class="formula"><tr><td class="formula"><m:math xmlns:m="http://www.w3.org/1998/Math/MathML" display="block">
<m:mi>x</m:mi><m:mo>=</m:mo><m:mfrac><m:mrow><m:mn>1</m:mn><m:mo>-</m:mo><m:mi>t</m:mi></m:mrow><m:mi>t</m:mi></m:mfrac><m:mtext>&#8195; or &#8195;</m:mtext><m:mi>x</m:mi><m:mo>=</m:mo><m:mo>-</m:mo><m:mrow><m:msub><m:mi mathvariant="normal">log</m:mi><m:mi>e</m:mi></m:msub><m:mo>&#8289;</m:mo><m:mi>t</m:mi></m:mrow>
</m:math></td><td class="formula2"/></tr></table></div>

will transform <m:math xmlns:m="http://www.w3.org/1998/Math/MathML"><m:mfenced separators=""><m:mn>0</m:mn><m:mo>,</m:mo><m:mi>&#8734;</m:mi></m:mfenced></m:math>&#160;to <m:math xmlns:m="http://www.w3.org/1998/Math/MathML"><m:mfenced separators=""><m:mn>1</m:mn><m:mo>,</m:mo><m:mn>0</m:mn></m:mfenced></m:math>&#160;while for infinite ranges we have

<div class="formula"><table class="formula"><tr><td class="formula"><m:math xmlns:m="http://www.w3.org/1998/Math/MathML" display="block">
<m:munderover><m:mo>&#8747;</m:mo><m:mrow><m:mo>-</m:mo><m:mi>&#8734;</m:mi></m:mrow><m:mi>&#8734;</m:mi></m:munderover><m:mi>f</m:mi><m:mfenced separators=""><m:mi>x</m:mi></m:mfenced><m:mrow><m:mi>d</m:mi><m:mi>x</m:mi></m:mrow><m:mo>=</m:mo><m:munderover><m:mo>&#8747;</m:mo><m:mn>0</m:mn><m:mi>&#8734;</m:mi></m:munderover><m:mfenced separators=""><m:mi>f</m:mi><m:mfenced separators=""><m:mi>x</m:mi></m:mfenced><m:mo>+</m:mo><m:mi>f</m:mi><m:mfenced separators=""><m:mo>-</m:mo><m:mi>x</m:mi></m:mfenced></m:mfenced><m:mrow><m:mi>d</m:mi><m:mi>x</m:mi></m:mrow><m:mtext>.</m:mtext>
</m:math></td><td class="formula2"/></tr></table></div>

If the integrand behaves badly on <m:math xmlns:m="http://www.w3.org/1998/Math/MathML"><m:mfenced separators=""><m:mrow><m:mo>-</m:mo><m:mi>&#8734;</m:mi></m:mrow><m:mo>,</m:mo><m:mn>0</m:mn></m:mfenced></m:math>&#160;and well on  <m:math xmlns:m="http://www.w3.org/1998/Math/MathML"><m:mfenced separators=""><m:mn>0</m:mn><m:mo>,</m:mo><m:mi>&#8734;</m:mi></m:mfenced></m:math>&#160;or vice versa it is better to compute it as <m:math xmlns:m="http://www.w3.org/1998/Math/MathML"><m:munderover><m:mo>&#8747;</m:mo><m:mrow><m:mo>-</m:mo><m:mi>&#8734;</m:mi></m:mrow><m:mn>0</m:mn></m:munderover><m:mi>f</m:mi><m:mfenced separators=""><m:mi>x</m:mi></m:mfenced><m:mrow><m:mi>d</m:mi><m:mi>x</m:mi></m:mrow><m:mo>+</m:mo><m:munderover><m:mo>&#8747;</m:mo><m:mn>0</m:mn><m:mi>&#8734;</m:mi></m:munderover><m:mi>f</m:mi><m:mfenced separators=""><m:mi>x</m:mi></m:mfenced><m:mrow><m:mi>d</m:mi><m:mi>x</m:mi></m:mrow></m:math>.  This saves computing unnecessary function values in the semi-infinite range where the function is well behaved.</li></ol><div class="paramtext">
  </div></li></ol></li></ol><div class="paramtext">
</div><h3><a name="intrecomm_3" id="intrecomm_3"/>3.3&#160;&#160;Multi-dimensional Integrals</h3><ol class="listalpha"><li class="listalpha">Automatic functions (<a class="rtnref" href="../D01/d01gbc.xml">nag_multid_quad_monte_carlo (d01gbc)</a> and <a class="rtnref" href="../D01/d01fcc.xml">nag_multid_quad_adapt (d01fcc)</a>)
 <div class="paramtext">Both functions are for integrals of the form
</div>
<div class="formula"><table class="formula"><tr><td class="formula"><m:math xmlns:m="http://www.w3.org/1998/Math/MathML" display="block">
<m:munderover><m:mo>&#8747;</m:mo><m:msub><m:mi>a</m:mi><m:mn>1</m:mn></m:msub><m:msub><m:mi>b</m:mi><m:mn>1</m:mn></m:msub></m:munderover>
<m:munderover><m:mo>&#8747;</m:mo><m:msub><m:mi>a</m:mi><m:mn>2</m:mn></m:msub><m:msub><m:mi>b</m:mi><m:mn>2</m:mn></m:msub></m:munderover>
<m:mo>&#8943;</m:mo>
<m:munderover><m:mo>&#8747;</m:mo><m:msub><m:mi>a</m:mi><m:mi>n</m:mi></m:msub><m:msub><m:mi>b</m:mi><m:mi>n</m:mi></m:msub></m:munderover>
<m:mi>f</m:mi><m:mfenced separators=""><m:msub><m:mi>x</m:mi><m:mn>1</m:mn></m:msub><m:mo>,</m:mo><m:msub><m:mi>x</m:mi><m:mn>2</m:mn></m:msub><m:mo>,</m:mo><m:mo>&#8230;</m:mo><m:mo>,</m:mo><m:msub><m:mi>x</m:mi><m:mi>n</m:mi></m:msub></m:mfenced><m:mi>d</m:mi><m:msub><m:mi>x</m:mi><m:mi>n</m:mi></m:msub><m:mi>d</m:mi><m:msub><m:mi>x</m:mi><m:mrow><m:mi>n</m:mi><m:mo>-</m:mo><m:mn>1</m:mn></m:mrow></m:msub><m:mo>&#8943;</m:mo><m:mi>d</m:mi><m:msub><m:mi>x</m:mi><m:mn>1</m:mn></m:msub><m:mtext>.</m:mtext>
</m:math></td><td class="formula2"/></tr></table></div>
<div class="paramtext">
 </div>
 <table style="width:90%;"><tr><td style="width:15%" class="libdoc" valign="top"><a class="rtnref" href="../D01/d01gbc.xml">nag_multid_quad_monte_carlo (d01gbc)</a></td><td valign="top">is an adaptive Monte Carlo function.  This function is usually slow and not recommended for high-accuracy work.  It is a robust function that can often be used for low-accuracy results with highly irregular integrands or when <m:math xmlns:m="http://www.w3.org/1998/Math/MathML"><m:mi>n</m:mi></m:math>&#160;is large.</td></tr><tr><td style="width:15%" class="libdoc" valign="top"><a class="rtnref" href="../D01/d01fcc.xml">nag_multid_quad_adapt (d01fcc)</a></td><td valign="top">is an adaptive deterministic function.  Convergence is fast for well behaved integrands.  Highly accurate results can often be obtained for <m:math xmlns:m="http://www.w3.org/1998/Math/MathML"><m:mi>n</m:mi></m:math>&#160;between 2 and 5, using significantly fewer integrand evaluations than would be required by <a class="rtnref" href="../D01/d01gbc.xml">nag_multid_quad_monte_carlo (d01gbc)</a>.  The function will usually work when the integrand is mildly singular and for <m:math xmlns:m="http://www.w3.org/1998/Math/MathML"><m:mi>n</m:mi><m:mo>&#8804;</m:mo><m:mn>10</m:mn></m:math>&#160;should be used before <a class="rtnref" href="../D01/d01gbc.xml">nag_multid_quad_monte_carlo (d01gbc)</a>. If it is known in advance that the integrand is highly irregular, it is best to compare results from at least two different functions.</td></tr></table>
 <div class="paramtext">There are many problems for which one or both of the functions will require large amounts of computing time to obtain even moderately accurate results.  The amount of computing time is controlled by the number of integrand evaluations allowed by you, and you should set this  argument carefully, with reference to the time available and the accuracy desired.</div></li></ol><h2><a name="dtree" id="dtree"/>4&#160;&#160;Decision Trees</h2><h4><a name="tree1" id="tree1"/>Tree 1: One-dimensional integrals over a finite interval
</h4>
<table class="dtree">
<tr>
<td class="dtentry">Is the functional form of the integrand known?</td>
<td class="dtnobar">_<br/>yes</td>
<td class="dtentry">Is the integrand smooth (polynomial-like) apart from weight function <m:math xmlns:m="http://www.w3.org/1998/Math/MathML"><m:msup><m:mfenced open="|" close="|" separators=""><m:mi>x</m:mi><m:mo>-</m:mo><m:mfenced separators=""><m:mi>a</m:mi><m:mo>+</m:mo><m:mi>b</m:mi></m:mfenced><m:mo>/</m:mo><m:mn>2</m:mn></m:mfenced><m:mi>c</m:mi></m:msup></m:math>&#160;or <m:math xmlns:m="http://www.w3.org/1998/Math/MathML"><m:msup>
<m:mfenced separators=""><m:mi>b</m:mi><m:mo>-</m:mo><m:mi>x</m:mi></m:mfenced>
<m:mi>c</m:mi></m:msup><m:msup>
<m:mfenced separators=""><m:mi>x</m:mi><m:mo>-</m:mo><m:mi>a</m:mi></m:mfenced>
<m:mi>d</m:mi></m:msup></m:math>?</td>
<td class="dtnobar">_<br/>yes</td>
<td class="dtentry"><a class="rtnref" href="../D01/d01bac.xml">d01bac</a></td></tr>
<tr>
<td class="dtnobar">|</td>
<td/>
<td class="dtnobar">no<br/>|</td>
<td/></tr>
<tr><td class="dtnobar">|</td>
<td/>
<td class="dtentry">Has the integrand discontinuities, sharp peaks or singularities at known points other than the end points?</td>
<td class="dtnobar">_<br/>yes</td>
<td class="dtentry">Split the range and begin again or use <a class="rtnref" href="../D01/d01slc.xml">d01slc</a></td></tr>
<tr>
<td class="dtnobar">|</td>
<td/>
<td class="dtnobar">no<br/>|</td>
<td/></tr>
<tr><td class="dtnobar">|</td>
<td/>
<td class="dtentry">Is the integrand free of singularities, sharp peaks and violent oscillations apart from weight function <m:math xmlns:m="http://www.w3.org/1998/Math/MathML"><m:msup>
<m:mfenced separators=""><m:mi>b</m:mi><m:mo>-</m:mo><m:mi>x</m:mi></m:mfenced>
<m:mi>&#945;</m:mi></m:msup><m:msup>
<m:mfenced separators=""><m:mi>x</m:mi><m:mo>-</m:mo><m:mi>a</m:mi></m:mfenced>
<m:mi>&#946;</m:mi></m:msup><m:msup>
<m:mfenced separators=""><m:mrow><m:mi>log</m:mi><m:mo>&#8289;</m:mo><m:mfenced separators=""><m:mi>b</m:mi><m:mo>-</m:mo><m:mi>x</m:mi></m:mfenced></m:mrow>
</m:mfenced>
<m:mi>k</m:mi></m:msup><m:msup>
<m:mfenced separators=""><m:mrow><m:mi>log</m:mi><m:mo>&#8289;</m:mo><m:mfenced separators=""><m:mi>x</m:mi><m:mo>-</m:mo><m:mi>a</m:mi></m:mfenced></m:mrow>
</m:mfenced>
<m:mi>l</m:mi></m:msup></m:math>?</td>
<td class="dtnobar">_<br/>yes</td>
<td class="dtentry"><a class="rtnref" href="../D01/d01spc.xml">d01spc</a></td></tr>
<tr>
<td class="dtnobar">|</td>
<td/>
<td class="dtnobar">no<br/>|</td>
<td/></tr>
<tr><td class="dtnobar">|</td>
<td/>
<td class="dtentry">Is the integrand free of singularities, sharp peaks and violent oscillations apart from weight function <m:math xmlns:m="http://www.w3.org/1998/Math/MathML"><m:mfrac><m:mn>1</m:mn><m:mrow><m:mi>x</m:mi><m:mo>-</m:mo><m:mi>c</m:mi></m:mrow>
 </m:mfrac>
</m:math>?</td>
<td class="dtnobar">_<br/>yes</td>
<td class="dtentry"><a class="rtnref" href="../D01/d01sqc.xml">d01sqc</a></td></tr>
<tr>
<td class="dtnobar">|</td>
<td/>
<td class="dtnobar">no<br/>|</td>
<td/></tr>
<tr><td class="dtnobar">|</td>
<td/>
<td class="dtentry">Is the integrand free of violent oscillations apart from weight function <m:math xmlns:m="http://www.w3.org/1998/Math/MathML"><m:mrow><m:mi>cos</m:mi><m:mo>&#8289;</m:mo><m:mfenced separators=""><m:mi>&#969;</m:mi><m:mi>x</m:mi></m:mfenced></m:mrow></m:math>&#160;or <m:math xmlns:m="http://www.w3.org/1998/Math/MathML"><m:mrow><m:mi>sin</m:mi><m:mo>&#8289;</m:mo><m:mfenced separators=""><m:mi>&#969;</m:mi><m:mi>x</m:mi></m:mfenced></m:mrow></m:math>?</td>
<td class="dtnobar">_<br/>yes</td>
<td class="dtentry"><a class="rtnref" href="../D01/d01snc.xml">d01snc</a></td></tr>
<tr>
<td class="dtnobar">|</td>
<td/>
<td class="dtnobar">no<br/>|</td>
<td/></tr>
<tr><td class="dtnobar">|</td>
<td/>
<td class="dtentry">Is the integrand free of singularities?</td>
<td class="dtnobar">_<br/>yes</td>
<td class="dtentry"><a class="rtnref" href="../D01/d01skc.xml">d01skc</a></td></tr>
<tr>
<td class="dtnobar">|</td>
<td/>
<td class="dtnobar">no<br/>|</td>
<td/></tr>
<tr><td class="dtnobar">|</td>
<td/>
<td class="dtentry"><a class="rtnref" href="../D01/d01ajc.xml">d01ajc</a></td></tr>
<tr>
<td class="dtnobar">no<br/>|</td>
<td/></tr>
<tr>
<td class="dtentry"><a class="rtnref" href="../D01/d01gac.xml">d01gac</a></td></tr></table><h4><a name="tree2" id="tree2"/>Tree 2: One-dimensional integrals over a semi-infinite or infinite interval
</h4>
<table class="dtree">
<tr>
<td class="dtentry">Is the functional form of the integrand known?</td>
<td class="dtnobar">_<br/>yes</td>
<td class="dtentry">Are you concerned with efficiency for simple integrals?</td>
<td class="dtnobar">_<br/>yes</td>
<td class="dtentry">Is the integrand smooth (polynomial like) apart from weight function <m:math xmlns:m="http://www.w3.org/1998/Math/MathML"><m:msup><m:mi>e</m:mi><m:mrow><m:mo>-</m:mo><m:mi>&#946;</m:mi>
<m:mfenced separators=""><m:mi>x</m:mi></m:mfenced>
</m:mrow></m:msup></m:math>&#160;(semi-infinite range) or <m:math xmlns:m="http://www.w3.org/1998/Math/MathML"><m:msup><m:mi>e</m:mi><m:msup><m:mrow><m:mo>-</m:mo><m:mi>&#946;</m:mi>
<m:mfenced separators=""><m:mi>x</m:mi><m:mo>-</m:mo><m:mi>a</m:mi></m:mfenced>
</m:mrow><m:mn>2</m:mn></m:msup></m:msup></m:math>&#160;(infinite range) or is the integrand polynomial-like in <m:math xmlns:m="http://www.w3.org/1998/Math/MathML"><m:mover><m:mn>1</m:mn><m:mrow><m:mi>x</m:mi><m:mo>+</m:mo><m:mi>b</m:mi></m:mrow></m:mover></m:math>&#160;(semi-infinite range)?</td>
<td class="dtnobar">_<br/>yes</td>
<td class="dtentry"><a class="rtnref" href="../D01/d01tac.xml">d01tac</a></td></tr>
<tr>
<td class="dtnobar">|</td>
<td/>
<td class="dtnobar">|</td>
<td/>
<td class="dtnobar">no<br/>|</td>
<td/></tr>
<tr><td class="dtnobar">|</td>
<td/><td class="dtnobar">|</td>
<td/>
<td class="dtentry">Has integrand discontinuities, sharp peaks or singularities at known points other than a finite limit?</td>
<td class="dtnobar">_<br/>yes</td>
<td class="dtentry">Split range; begin again using finite or infinite range trees</td></tr>
<tr>
<td class="dtnobar">|</td>
<td/>
<td class="dtnobar">|</td>
<td/>
<td class="dtnobar">no<br/>|</td>
<td/></tr>
<tr><td class="dtnobar">|</td>
<td/><td class="dtnobar">|</td>
<td/>
<td class="dtentry">Does the integrand oscillate over the entire range?</td>
<td class="dtnobar">_<br/>yes</td>
<td class="dtentry">Does the integrand decay rapidly towards an infinite limit?</td>
<td class="dtnobar">_<br/>yes</td>
<td class="dtentry">Use <a class="rtnref" href="../D01/d01smc.xml">d01smc</a> or set cutoff and use finite range tree</td></tr>
<tr>
<td class="dtnobar">|</td>
<td/>
<td class="dtnobar">|</td>
<td/>
<td class="dtnobar">|</td>
<td/>
<td class="dtnobar">no<br/>|</td>
<td/></tr>
<tr><td class="dtnobar">|</td>
<td/><td class="dtnobar">|</td>
<td/><td class="dtnobar">|</td>
<td/>
<td class="dtentry"><a class="rtnref" href="../D01/d01ssc.xml">d01ssc</a></td></tr>
<tr>
<td class="dtnobar">|</td>
<td/>
<td class="dtnobar">|</td>
<td/>
<td class="dtnobar">no<br/>|</td>
<td/></tr>
<tr><td class="dtnobar">|</td>
<td/><td class="dtnobar">|</td>
<td/>
<td class="dtentry"><a class="rtnref" href="../D01/d01smc.xml">d01smc</a></td></tr>
<tr>
<td class="dtnobar">|</td>
<td/>
<td class="dtnobar">no<br/>|</td>
<td/></tr>
<tr><td class="dtnobar">|</td>
<td/>
<td class="dtentry"><a class="rtnref" href="../D01/d01amc.xml">d01amc</a></td></tr>
<tr>
<td class="dtnobar">no<br/>|</td>
<td/></tr>
<tr>
<td class="dtentry"><a class="rtnref" href="../D01/d01gac.xml">d01gac</a> (integrates over the range of the points supplied)</td></tr></table><h4><a name="tree3" id="tree3"/>Tree 3: Multi-dimensional integrals
</h4>
<table class="dtree">
<tr>
<td class="dtentry">Is the integrand free of extremely bad behaviour or is bad behaviour on the boundary?</td>
<td class="dtnobar">_<br/>yes</td>
<td class="dtentry"><a class="rtnref" href="../D01/d01fcc.xml">d01fcc</a></td></tr>
<tr>
<td class="dtnobar">no<br/>|</td>
<td/></tr>
<tr>
<td class="dtentry">Compare results from <a class="rtnref" href="../D01/d01gbc.xml">d01gbc</a> and <a class="rtnref" href="../D01/d01fcc.xml">d01fcc</a> and one-dimensional recursive application</td></tr></table><h2><a name="index" id="index"/>5&#160;&#160;Index</h2><table>
   <tr><td class="index1">Multi-dimensional quadrature:</td><td class="index2">
  &#160;&#160;&#160;</td></tr>
   
      <tr><td class="index1">&#160;&#160;&#160;&#160;over a hyper-rectangle:</td><td class="index2">
  &#160;&#160;&#160;</td></tr>
      
         <tr><td class="index1">&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;adaptive method</td><td class="index2">
  &#160;&#160;&#160;<a class="rtnref" href="../D01/d01fcc.xml">d01fcc</a></td></tr>
         <tr><td class="index1">&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;adaptive method, thread-safe</td><td class="index2">
  &#160;&#160;&#160;<a class="rtnref" href="../D01/d01wcc.xml">d01wcc</a></td></tr>
         <tr><td class="index1">&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;Monte Carlo method</td><td class="index2">
  &#160;&#160;&#160;<a class="rtnref" href="../D01/d01gbc.xml">d01gbc</a></td></tr>
         <tr><td class="index1">&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;Monte Carlo method, thread-safe</td><td class="index2">
  &#160;&#160;&#160;<a class="rtnref" href="../D01/d01xbc.xml">d01xbc</a></td></tr>
      
   
   <tr><td class="index1">One-dimensional quadrature:</td><td class="index2">
  &#160;&#160;&#160;</td></tr>
   
      <tr><td class="index1">&#160;&#160;&#160;&#160;adaptive integration of a function over a finite interval:</td><td class="index2">
  &#160;&#160;&#160;</td></tr>
      
         <tr><td class="index1">&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;allowing for singularities at user-specified break-points</td><td class="index2">
  &#160;&#160;&#160;<a class="rtnref" href="../D01/d01alc.xml">d01alc</a></td></tr>
         <tr><td class="index1">&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;allowing for singularities at user-specified break-points, thread-safe</td><td class="index2">
  &#160;&#160;&#160;<a class="rtnref" href="../D01/d01slc.xml">d01slc</a></td></tr>
         <tr><td class="index1">&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;method suitable for oscillating functions</td><td class="index2">
  &#160;&#160;&#160;<a class="rtnref" href="../D01/d01akc.xml">d01akc</a></td></tr>
         <tr><td class="index1">&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;method suitable for oscillating functions, thread-safe</td><td class="index2">
  &#160;&#160;&#160;<a class="rtnref" href="../D01/d01skc.xml">d01skc</a></td></tr>
         <tr><td class="index1">&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;strategy due to Piessens and de Doncker,</td><td class="index2">
  &#160;&#160;&#160;</td></tr>
         
            <tr><td class="index1">&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;allowing for badly behaved integrands</td><td class="index2">
  &#160;&#160;&#160;<a class="rtnref" href="../D01/d01ajc.xml">d01ajc</a></td></tr>
            <tr><td class="index1">&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;allowing for badly behaved integrands, thread-safe</td><td class="index2">
  &#160;&#160;&#160;<a class="rtnref" href="../D01/d01sjc.xml">d01sjc</a></td></tr>
         
         <tr><td class="index1">&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;weight function <m:math xmlns:m="http://www.w3.org/1998/Math/MathML">
               <m:mn>1</m:mn>
               <m:mo>/</m:mo>
               <m:mfenced separators="">
                  <m:mi>x</m:mi>
                  <m:mo>-</m:mo>
                  <m:mi>c</m:mi>
               </m:mfenced>
            </m:math>&#160;Cauchy principal value (Hilbert transform)</td><td class="index2">
  &#160;&#160;&#160;<a class="rtnref" href="../D01/d01aqc.xml">d01aqc</a></td></tr>
         <tr><td class="index1">&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;weight function <m:math xmlns:m="http://www.w3.org/1998/Math/MathML">
               <m:mn>1</m:mn>
               <m:mo>/</m:mo>
               <m:mfenced separators="">
                  <m:mi>x</m:mi>
                  <m:mo>-</m:mo>
                  <m:mi>c</m:mi>
               </m:mfenced>
            </m:math>&#160;Cauchy principal value (Hilbert transform), thread-safe</td><td class="index2">
  &#160;&#160;&#160;<a class="rtnref" href="../D01/d01sqc.xml">d01sqc</a></td></tr>
         <tr><td class="index1">&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;weight function with end-point singularities of algebraico-logarithmic type</td><td class="index2">
  &#160;&#160;&#160;<a class="rtnref" href="../D01/d01apc.xml">d01apc</a></td></tr>
         <tr><td class="index1">&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;weight function with end-point singularities of algebraico-logarithmic type, thread-safe</td><td class="index2">
  &#160;&#160;&#160;<a class="rtnref" href="../D01/d01spc.xml">d01spc</a></td></tr>
         <tr><td class="index1">&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;weight function <m:math xmlns:m="http://www.w3.org/1998/Math/MathML">
               <m:mrow><m:mi>cos</m:mi><m:mo>&#8289;</m:mo><m:mfenced separators="">
                     <m:mi>&#969;</m:mi>
                     <m:mi>x</m:mi>
                  </m:mfenced></m:mrow>
            </m:math>&#160;or <m:math xmlns:m="http://www.w3.org/1998/Math/MathML">
               <m:mrow><m:mi>sin</m:mi><m:mo>&#8289;</m:mo><m:mfenced separators="">
                     <m:mi>&#969;</m:mi>
                     <m:mi>x</m:mi>
                  </m:mfenced></m:mrow>
            </m:math>&#160;         </td><td class="index2">
  &#160;&#160;&#160;<a class="rtnref" href="../D01/d01anc.xml">d01anc</a></td></tr>
         <tr><td class="index1">&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;weight function <m:math xmlns:m="http://www.w3.org/1998/Math/MathML">
               <m:mrow><m:mi>cos</m:mi><m:mo>&#8289;</m:mo><m:mfenced separators="">
                     <m:mi>&#969;</m:mi>
                     <m:mi>x</m:mi>
                  </m:mfenced></m:mrow>
            </m:math>&#160;or <m:math xmlns:m="http://www.w3.org/1998/Math/MathML">
               <m:mrow><m:mi>sin</m:mi><m:mo>&#8289;</m:mo><m:mfenced separators="">
                     <m:mi>&#969;</m:mi>
                     <m:mi>x</m:mi>
                  </m:mfenced></m:mrow>
            </m:math>, thread-safe</td><td class="index2">
  &#160;&#160;&#160;<a class="rtnref" href="../D01/d01snc.xml">d01snc</a></td></tr>
      
      <tr><td class="index1">&#160;&#160;&#160;&#160;adaptive integration of a function over an infinite interval or semi-infinite interval</td><td class="index2">
  &#160;&#160;&#160;<a class="rtnref" href="../D01/d01amc.xml">d01amc</a></td></tr>
      <tr><td class="index1">&#160;&#160;&#160;&#160;adaptive integration of a function over an infinite interval or semi-infinite interval, thread-safe</td><td class="index2">
  &#160;&#160;&#160;<a class="rtnref" href="../D01/d01smc.xml">d01smc</a></td></tr>
      <tr><td class="index1">&#160;&#160;&#160;&#160;adaptive integration of a function over an infinite interval or semi-infinite interval:</td><td class="index2">
  &#160;&#160;&#160;</td></tr>
      
         <tr><td class="index1">&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;weight function <m:math xmlns:m="http://www.w3.org/1998/Math/MathML">
               <m:mrow><m:mi>cos</m:mi><m:mo>&#8289;</m:mo><m:mfenced separators="">
                     <m:mi>&#969;</m:mi>
                     <m:mi>x</m:mi>
                  </m:mfenced></m:mrow>
            </m:math>&#160;or <m:math xmlns:m="http://www.w3.org/1998/Math/MathML">
               <m:mrow><m:mi>sin</m:mi><m:mo>&#8289;</m:mo><m:mfenced separators="">
                     <m:mi>&#969;</m:mi>
                     <m:mi>x</m:mi>
                  </m:mfenced></m:mrow>
            </m:math>&#160;         </td><td class="index2">
  &#160;&#160;&#160;<a class="rtnref" href="../D01/d01asc.xml">d01asc</a></td></tr>
         <tr><td class="index1">&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;weight function <m:math xmlns:m="http://www.w3.org/1998/Math/MathML">
               <m:mrow><m:mi>cos</m:mi><m:mo>&#8289;</m:mo><m:mfenced separators="">
                     <m:mi>&#969;</m:mi>
                     <m:mi>x</m:mi>
                  </m:mfenced></m:mrow>
            </m:math>&#160;or <m:math xmlns:m="http://www.w3.org/1998/Math/MathML">
               <m:mrow><m:mi>sin</m:mi><m:mo>&#8289;</m:mo><m:mfenced separators="">
                     <m:mi>&#969;</m:mi>
                     <m:mi>x</m:mi>
                  </m:mfenced></m:mrow>
            </m:math>, thread-safe</td><td class="index2">
  &#160;&#160;&#160;<a class="rtnref" href="../D01/d01ssc.xml">d01ssc</a></td></tr>
      
      <tr><td class="index1">&#160;&#160;&#160;&#160;Gaussian quadrature rule-evaluation</td><td class="index2">
  &#160;&#160;&#160;<a class="rtnref" href="../D01/d01bac.xml">d01bac</a></td></tr>
      <tr><td class="index1">&#160;&#160;&#160;&#160;Gaussian quadrature rule-evaluation, thread-safe</td><td class="index2">
  &#160;&#160;&#160;<a class="rtnref" href="../D01/d01tac.xml">d01tac</a></td></tr>
      <tr><td class="index1">&#160;&#160;&#160;&#160;integration of a function defined by data values only,</td><td class="index2">
  &#160;&#160;&#160;</td></tr>
      
         <tr><td class="index1">&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;Gill&#8211;Miller method</td><td class="index2">
  &#160;&#160;&#160;<a class="rtnref" href="../D01/d01gac.xml">d01gac</a></td></tr>
      
   
</table><h2><a name="withdrawn" id="withdrawn"/>6&#160;&#160;Functions Withdrawn or Scheduled for Withdrawal</h2><div class="paramtext">None.</div><h2><a name="references" id="references"/>7&#160;&#160;References</h2><div class="paramtext">
<p><a name="ref201" id="ref201"/>Davis P J and Rabinowitz P (1975) <i>Methods of Numerical Integration</i> Academic Press </p>
<p><a name="ref202" id="ref202"/>Gladwell I (1986) Vectorisation of one dimensional quadrature codes <i>Numerical Integration: Recent Developments, and Applications</i> (ed P Keast and G Fairweather) 231&#8211;238 D Reidel Publishing Company, Holland </p>
<p><a name="ref203" id="ref203"/>Lyness J N (1983) When not to use an automatic quadrature routine <i>SIAM Rev.</i> <b>25</b> 63&#8211;87 </p>
<p><a name="ref010" id="ref010"/>Piessens R, de Doncker&#8211;Kapenga E, &#220;berhuber C and Kahaner D (1983) <i>QUADPACK, A Subroutine Package for Automatic Integration</i> Springer&#8211;Verlag </p>
<p><a name="ref204" id="ref204"/>Sobol I M (1974) <i>The Monte Carlo Method</i> The University of Chicago Press </p>
<p><a name="ref205" id="ref205"/>Stroud A H (1971) <i>Approximate Calculation of Multiple Integrals</i> Prentice&#8211;Hall </p>
</div><hr/><div><a href="../../pdf/D01/d01_intro.pdf">d01 Chapter Introduction (pdf version)</a></div><div><a href="d01_conts.xml">Chapter Contents</a></div>
<div><a href="../mark8.xml">NAG C Library Manual</a></div>
<div><hr/>
  &#169; The Numerical Algorithms Group Ltd, Oxford, UK. 2005
  </div></body></html>
