# Gaussian Numerical Differentiation

Gaussian quadrature improves on Newton-Cotes formulas by allowing the abscissas to vary along with the weights in order to integrate higher order polynomials.

Can this idea be extended to numerical differentiation? To wit, can I choose a set $\{h_{i}\}$ such that $f'$ is much better approximated by a weighted sum of evaluations at $x+h_{i}$ than it could be at equally spaced data point? For example, maybe the following relation could hold for some $j$:

\begin{align*} f'(x) = \sum_{i=1}^{n}\frac{w_i}{h_i}f(x+h_{i}) + \mathcal{O}(\left\| hf^{(n+j)}\right\|^{n+j}) \end{align*}

• Short answer: Yes, look at Chebyshev collocation methods (in particular, Nick Trefethen's book Approximation Theory and Approximation Practice and the Chebfun software). – Christian Clason Mar 31 '17 at 19:24
• In particular, you might want to see Trefethen's short script for computing a Chebyshev differentiation matrix. – J. M. Apr 1 '17 at 9:47

Yes. As you may know, numerical differentiation and integration is closely related to (polynomial) interpolation: The idea to approximately differentiate or integrate a given function is to approximate it with a function (often an interpolating polynomial) that can be differentiated or integrated exactly. For example, the standard central difference quotient formulas for $f(x)$ can be derived from differentiating a quadratic interpolating polynomial through the points $x-h, x, x+h$.
The benefit ist that the error in approximating the derivative or integral is only determined by the error in approximating the function -- which is well understood for polynomial interpolation. In particular, it turns out that uniform interpolation points are a poor choice in general, and interpolation points based on roots of orthogonal polynomials are much better. In the context of quadrature, this leads to the different variants of Gaussian quadrature (Legendre, Chebyshev, Jacobi, Laguerre, Hermite...); in the context of differentiation, this is referred to as spectral collocation. Since it is the basis of spectral methods for solving differential equations, rather than a finite-difference quotient this is usually realized by a differentiation matrix that maps the values of $f$ at a selection of collocation points to the corresponding values of $f'$. (In contrast to the standard finite-difference matrices, these are usually dense; spectral methods are therefore global methods.) The deep relations between these concepts are explained in