e02ahf forms the polynomial which is the derivative of a given polynomial. Both the original polynomial and its derivative are represented in Chebyshev series form. Given the coefficients
, for
, of a polynomial
of degree
, where
the routine returns the coefficients
, for
, of the polynomial
of degree
, where
Here
denotes the Chebyshev polynomial of the first kind of degree
with argument
. It is assumed that the normalized variable
in the interval
was obtained from your original variable
in the interval
by the linear transformation
and that you require the derivative to be with respect to the variable
. If the derivative with respect to
is required, set
and
.
Values of the derivative can subsequently be computed, from the coefficients obtained, by using
e02akf.
The method employed is that of Chebyshev series (see Chapter 8 of
Modern Computing Methods (1961)), modified to obtain the derivative with respect to
. Initially setting
, the routine forms successively
If on entry
or
, explanatory error messages are output on the current error message unit (as defined by
x04aaf).
There is always a loss of precision in numerical differentiation, in this case associated with the multiplication by
in the formula quoted in
Section 3.
Background information to multithreading can be found in the
Multithreading documentation.
The increments
ia1,
iadif1 are included as arguments to give a degree of flexibility which, for example, allows a polynomial in two variables to be differentiated with respect to either variable without rearranging the coefficients.
Suppose a polynomial has been computed in Chebyshev series form to fit data over the interval
. The following program evaluates the first and second derivatives of this polynomial at
equally spaced points over the interval. (For the purposes of this example,
xmin,
xmax and the Chebyshev coefficients are simply suppliedin DATA statements.
Normally a program would first read in or generate data and compute the fitted polynomial.)
None.