d01bd calculates an approximation to the integral of a function over a finite interval $\left[a,b\right]$:
 $I=∫abfxdx.$
It is non-adaptive and as such is recommended for the integration of ‘smooth’ functions. These exclude integrands with singularities, derivative singularities or high peaks on $\left[a,b\right]$, or which oscillate too strongly on $\left[a,b\right]$.

# Syntax

C#
```public static void d01bd(
D01..::..D01BD_F f,
double a,
double b,
double epsabs,
double epsrel,
out double result,
out double abserr,
out int ifail
)```
Visual Basic
```Public Shared Sub d01bd ( _
f As D01..::..D01BD_F, _
a As Double, _
b As Double, _
epsabs As Double, _
epsrel As Double, _
<OutAttribute> ByRef result As Double, _
<OutAttribute> ByRef abserr As Double, _
<OutAttribute> ByRef ifail As Integer _
)```
Visual C++
```public:
static void d01bd(
D01..::..D01BD_F^ f,
double a,
double b,
double epsabs,
double epsrel,
[OutAttribute] double% result,
[OutAttribute] double% abserr,
[OutAttribute] int% ifail
)```
F#
```static member d01bd :
f : D01..::..D01BD_F *
a : float *
b : float *
epsabs : float *
epsrel : float *
result : float byref *
abserr : float byref *
ifail : int byref -> unit
```

#### Parameters

f
Type: NagLibrary..::..D01..::..D01BD_F
f must return the value of the integrand $f$ at a given point.

A delegate of type D01BD_F.

a
Type: System..::..Double
On entry: $a$, the lower limit of integration.
b
Type: System..::..Double
On entry: $b$, the upper limit of integration. It is not necessary that $a.
epsabs
Type: System..::..Double
On entry: the absolute accuracy required. If epsabs is negative, the absolute value is used. See [Accuracy].
epsrel
Type: System..::..Double
On entry: the relative accuracy required. If epsrel is negative, the absolute value is used. See [Accuracy].
result
Type: System..::..Double%
On exit: the approximation to the integral $I$.
abserr
Type: System..::..Double%
On exit: an estimate of the modulus of the absolute error, which should be an upper bound for $\left|I-{\mathbf{result}}\right|$.
ifail
Type: System..::..Int32%
On exit: $\mathbf{ifail}=0$ unless the method detects an error (see [Error Indicators and Warnings]).

# Description

d01bd is based on the QUADPACK routine QNG (see Piessens et al. (1983)). It is a non-adaptive method which uses as its basic rules, the Gauss $10$-point and $21$-point formulae. If the accuracy criterion is not met, formulae using $43$ and $87$ points are used successively, stopping whenever the accuracy criterion is satisfied.
This method is designed for smooth integrands only.

# References

Patterson T N L (1968) The Optimum addition of points to quadrature formulae Math. Comput. 22 847–856
Piessens R, de Doncker–Kapenga E, Überhuber C and Kahaner D (1983) QUADPACK, A Subroutine Package for Automatic Integration Springer–Verlag

# Error Indicators and Warnings

There are no specific errors detected by d01bd. However, if abserr is greater than
 $maxepsabs,epsrel×result$
this indicates that the method has probably failed to achieve the requested accuracy within $87$ function evaluations.

# Accuracy

d01bd attempts to compute an approximation, result, such that:
 $I-result≤tol,$
where
 $tol=maxepsabs,epsrel×I,$
and epsabs and epsrel are user-specified absolute and relative error tolerances. There can be no guarantee that this is achieved, and you are advised to subdivide the interval if you have any doubts about the accuracy obtained. Note that abserr contains an estimated bound on $\left|I-{\mathbf{result}}\right|$.

# Parallelism and Performance

None.

 $∫01x2sin10πxdx.$