Abstract
The Clenshaw-Curtis (C-C) rule is a quadrature formula for integrals on the finite interval [− 1,1] and known to be efficient for smooth integrands and suitable for constructing an automatic method owing to nice features, i.e., the C-C rule family is nested and the accuracy is easy to check. In this paper, for an integral on a semi-infinite interval \([0,\infty )\) with an integrand decaying exponentially as \(x\to \infty \), we propose a truncated formula of the C-C rule and present an automatic method to approximate the integral to the accuracy of double precision and its Matlab code. We reduce the interval \([0,\infty )\) to a finite interval [0,a], choosing a so that the ignored integral on \([a,\infty )\) is sufficiently small. To approximate the integral Ia on [0,a], we consider a wider interval [0,2a]. By a change of variables, we transform nodes of the C-C rule on [− 1,1] to those on [0,2a]. To approximate Ia, our formula uses the nodes belonging to [0,a]. Similarly, a truncated formula of the Gauss-Legendre (GLe) rule is available. For an analytic function f(z) on \([0,\infty )\), we give an error analysis for our method. Using numerical examples, we compare our formula with the truncated GLe, Gauss-Laguerre and double exponential formulae in performance. Numerical examples show that our formula, as well as the truncated GLe formula, is efficient, particularly, for semi-infinitely oscillatory integrals.
Similar content being viewed by others
References
Abramowitz, M., Stegun, I.A.: Handbook of mathematical functions. Dover, New York (1965)
Brezinski, C., Redivo Zaglia, M.: Extrapolation Methods: Theory and Practice Studies in Computational Mathematics, vol. 2. North-Holland, Amsterdam (1991)
Capobianco, M.R., Criscuolo, G.: Some remarks on the numerical computation of integrals on an unbounded interval. Numer. Algorithms 45, 37–48 (2007)
Clenshaw, C.W., Curtis, A.R.: A method for numerical integration on an automatic computer. Numer. Math. 2, 197–205 (1960)
Davis, P.J., Rabinowitz, P.: Methods of Numerical Integration, 2nd edn. Academic Press, Orland (1984)
Gautschi, W.: Quadrature formulae on half-infinite intervals. BIT 31, 438–446 (1991)
Gautschi, W.: Orthogonal Polynomials: Computation and Application. Oxford University Press, Oxford (2004)
Gradshteyn, I.S., Ryzhik, I.M.: Table of Integrals, Series, and Products, Corrected and Enlarged Edition. Academic Press, New York (1980)
Hasegawa, T., Sidi, A.: An automatic integration procedure for infinite range integrals involving oscillatory kernels. Numer. Algorithms 13, 1–19 (1996)
Hasegawa, T., Sugiura, H.: Error estimate for a corrected Clenshaw-Curtis quadrature rule. Numer. Math. 130, 135–149 (2015)
Hatano, Y., Ninomiya, I., Sugiura, H., Hasegawa, T.: Numerical evaluation of Goursat’s infinite integral. Numer. Algorithms 52, 213–224 (2009)
Imhof, J.P.: On the method for numerical integration of Clenshaw and Curtis. Numer. Math. 5, 138–141 (1963)
Mason, J.C., Handscomb, D.C.: Chebyshev Polynomials Chapman & hall/CRC, Boca Raton (2003)
Mastroianni, G., Monegato, G.: Some new application of truncated gauss-Laguerre quadrature formulas. Numer. Algorithms 49, 283–297 (2008)
Michalski, K.A., Mosig, J.R.: Efficient computation of Sommerfeld integral tails – methods and algorithms. J. Electromagnet Wave 30, 281–317 (2016)
Ogata, H.: A numerical integration formula based on the Bessel functions. Publ. Res. Inst. Math. Sci. 41, 949–970 (2005)
Ratnanather, J.T., Kim, J.H., Zhang, S., Davis, A.M.J., Lucas, S.K.: Algorithm 935: IIPBF, a MATLAB toolbox for infinite integral of products of two Bessel functions. ACM Trans. Math. Software 40, Article No. 14 (2014)
Rivlin, T.J.: Chebyshev Polynomials: from Approximation Theory to Algebra and Number Theory, 2nd edn. Wiley, New York (1990)
Sidi, A.: Practical Extrapolation Methods: Theory and Applications Cambridge Monographs on Applied and Computational Mathematics, vol. 10. Cambridge University Press, Cambridge (2003)
Sloan, I.H., Smith, W.E.: Product integration with the Clenshaw-Curtis points: implementation and error estimates. Numer. Math. 34, 387–401 (1980)
Takahasi, H., Mori, M.: Double exponential formulas for numerical integration. Publ. Res. Inst. Math. Sci. 9, 721–741 (1974)
Trefethen, L.N.: Is Gauss quadrature better than Clenshaw-Curtis? SIAM Rev. 50, 67–87 (2008)
Trefethen, L.N., Weideman, J.A.C.: The exponentially convergent trapezoidal rule. SIAM Rev. 56, 385–458 (2014)
Van Deun, J., Cools, R.: Algorithm 858: Computing infinite range integrals of an arbitrary product of Bessel functions. ACM Trans. Math. Software 32, 580–596 (2006)
Waldvogel, J.: Fast construction of the Fejér and Clenshaw-Curtis quadrature rules. BIT 46, 195–202 (2006)
Waldvogel, J. Towards a general error theory of the trapezoidal rule, in Gautschi, W., Mastroianni, G., Rassias, T. (eds.): Approximation and Computation. Springer Optimization and Its Applications, vol. 42 267–282. Springer, New York (2010)
Acknowledgments
We thank Professor David Levin for his valuable comments for improving the presentation. We are grateful to one of the referees for his/her valuable suggestions for succinct descriptions.
Author information
Authors and Affiliations
Corresponding author
Additional information
Publisher’s note
Springer Nature remains neutral with regard to jurisdictional claims in published maps and institutional affiliations.
Appendix: Matlab codes and numerical results
Appendix: Matlab codes and numerical results
We assume a Matlab computation in double-precision arithmetic, the unit roundoff u ≈ 1.11 × 10− 16. We present Matlab codes for evaluating the weights and nodes of the C-C rule (2.2) and for an automatic method by the TC-C rule in Section 4. We increase the number of nodes n + 1 like n = 2k (\(k=2,3,\dots 11\)), until the error estimate is smaller than or equal to the required tolerance 10− 15, slightly larger than u. For each number of nodes, we compute an approximation anscc with weights ww for illustrative purposes. If we perform this computation only once when the tolerance is satisfied, then our Matlab code may be slightly faster in computation, since the error estimation ErEsCC requires only function values at the Chebyshev nodes xx given in the last line of the function CCw(n). Minor modifications of CCw(n) and CCTrunc(fun) suffice for this end.
Table 2 gives numerical results by the Matlab code above. We omit the numbers of nodes required in estimating the upper end a of [0,a].
Let n be an integer ≥ 2. The Matlab code below computes the weights \(w_{k}^{(n)}= \)ww(k + 1) with the FFT and nodes \(t_{k}^{(n)}= \)xx(k + 1) (0 ≤ k ≤ n) of the (n + 1)-point C-C rule \({I}_{n}^{(\text {C-C})}\) (2.1).
function [ww,xx]=CCw(n) N=[3:2:n+1]'; v=[2; -4./N./(N-2)]; v(end)=v(end)/(2-mod(n,2)); w=real(ifft(v,n)); w(1)=w(1)/2; ww=[w; w(1)]; t=linspace(0,pi,n+1); xx=-cos(t);
The Matlab code below for the TC-C rule gives an approximation ’anscc’ to the integral of a given function ’fun’ on \([0,\infty )\) in the accuracy 1.0 × 10− 15, slightly larger than u ≈ 1.11 × 10− 16.
function [anscc,Eest]=CCTrunc(fun) tol=1.11e-16; a=-log10(tol); fa=fun(a); if (abs(fa))>tol while abs(fa)>tol, a=a+2; fa=fun(a); end while abs(fa)<tol, a=a-0.2; fa=fun(a); end else while abs(fa)<tol, a=a-1; fa=fun(a); end while abs(fa)>tol, a=a+0.1; fa=fun(a); end end epsil=max(abs(fa),1.e-15); nn=2; for k=nn:11 n=2^k; mm=n*2; N=[1:n+1]; [ww,xx]=CCw(mm); xc=xx(N); if k==nn, xo=a*(xc+1); ff=fun(xo); else ff(1:2:n+1)=fo; xe=xc(2:2:end); xe=a*(xe+1); ff(2:2:n)=fun(xe); end anscc=ff*ww(N)*a; Err(ff,xc,mm); ErrEstCC=max(ErEsCC,epsil); if ErrEstCC==epsil, break; end fo=ff; end Eest=ErrEstCC; function Err(f,xc,n) sumfe=sum(f(1:2:end))-f(1)/2; sumfo=sum(f(2:2:end)); ErEsCC1=a*abs(sumfe-sumfo)/n; sume=f(1:2:end)*xc(1:2:end)'-f(1)*xc(1)/2; sumo=f(2:2:end)*xc(2:2:end)'; ErEsCC2=2*a*abs(sume-sumo)/n; ErEsCC=(ErEsCC1+ErEsCC2)*8*n/((n^2-9)*(n^2-1)); end end
Rights and permissions
About this article
Cite this article
Sugiura, H., Hasegawa, T. A truncated Clenshaw-Curtis formula approximates integrals over a semi-infinite interval. Numer Algor 86, 659–674 (2021). https://doi.org/10.1007/s11075-020-00905-w
Received:
Accepted:
Published:
Issue Date:
DOI: https://doi.org/10.1007/s11075-020-00905-w
Keywords
- Integral on an unbounded interval
- Clenshaw-Curtis quadrature rule
- Truncated formula
- Error analysis
- Matlab code