# Chebychev Polynomial derivatives at zero points and extreme points

I was looking for some help with derivatives of Chebychev polynomials at zero points. The recursive expression,

$$T_{(j+1)}(x) = 2xT_j(x) - T_{(j-1)}(x)$$

has the derivative $$T'_{j+1}(x) = 2T_j(x) + 2xT'_j(x) - T'_{j-1}(x)$$

with $T'_0=0$ and $T'_1=1$.

But I was looking at Trefethen's book (Chapter 6, Page 54) where he uses the following code to construct a derivative matrix for Chebychev polynomials at extreme points:

% CHEB compute D = differentiation matrix, x = Chebyshev grid
function [D,x] = cheb(N)
if N==0, D=0; x=1; return, end
x = cos(pi*(0:N)/N)';
c = [2; ones(N-1,1); 2].*(-1).^(0:N)';
X = repmat(x,1,N+1);
dX = X-X';
D = (c*(1./c)')./(dX+(eye(N+ 1))) ; % off-diagonal entries
D = D - diag(sum(D'));


How are these two derivative calculations related? Or is it that the derivatives at extreme points and zero points are calculated differently, as above? Any references I can read to better understand this?

Thank you.

• One is the derivative in physical space, and the other in spectral space. It is quite similar to performing a derivative in Fourier space (with the difference that in your case the derivative operator is not diagonal). – davidhigh Apr 6 '18 at 9:14