Chebyshev Spectral Differentiation via Fast Fourier Transform
Consider the function with derivative . This Demonstration uses Chebyshev differentiation via Fast Fourier Transform (FFT)  to estimate at the Chebyshev–Gauss–Lobatto points. You can change the number of interior points, . The error (i.e., the difference between the exact and approximate values of ) decreases for large values of .
Here are the steps for Chebyshev differentiation via the fast Fourier transform (FFT)  algorithm:
1. Take the Chebyshev–Gauss–Lobatto points given by with . These points are the extrema of the Chebyshev polynomial of the first kind, .
2. Calculate and form the vector .
3. Calculate , the real part of the and of .
4. Compute , where ; then calculate where is the inverse fast Fourier transform.
5. Use the vector to evaluate (i.e., the approximate derivative calculated at the Chebyshev–Gauss–Lobatto points) for :
 L. N. Trefethen, Spectral Methods in MATLAB, Philadelphia: SIAM, 2000.