Quote:

> I am looking for subroutine to compute the integration of a cublic

> spline function. Can anyone suggest where I can find one?

> Thanks in advance.

> shekhar

Given that you probably already have a cubic spline evaluation

procedure, a quick-and-dirty solution is to use a 2-point Gauss-

Kronrod (exact for cubic polynomials) rule inside each subinterval. It

will, however, be suboptimal w.r.t. the amount of computation

required, _especially_ if you locate the correct interval (as spline

evaluation functions typically do) over and over again.

The 2p GK rule is:

int(f(x),x=a..b) ~ .5*(f(c-d)+f(c+d))

where

c = .5*(a+b)

d = .5*(a-b)/sqrt(3)