Exercise: Gauss-Chebyshev and an error bound

Determining how many nodes guarantee six decimals in an integral with Chebyshev weight.

Choosing n before computing

ExampleIntegral with Chebyshev weight

Compute 11ex1x2dx\int_{-1}^{1}\frac{e^x}{\sqrt{1-x^2}}\,dx with six guaranteed decimals using the error bound.

  1. The Chebyshev error bound is bounded by e on (-1,1):

    E2πe22n(2n)!|E|\le\frac{2\pi e}{2^{2n}(2n)!}
  2. Testing n=1,2,3,4,5 gives the bounds:

    2.134933555, 0.044477782, 3.70648104, 1.65468106, 4.596331092.134933555,\ 0.044477782,\ 3.70648\cdot10^{-4},\ 1.65468\cdot10^{-6},\ 4.59633\cdot10^{-9}
  3. The first nn that guarantees error below 10610^{-6} is n=5n=5.

    n=5n=5
  4. With the five Chebyshev nodes, the weighted sum gives:

    Iπ5(e0.951057+e0.587785+e0+e0.587785+e0.951057)=3.977463I\approx\frac{\pi}{5}\left(e^{-0.951057}+e^{-0.587785}+e^0+e^{0.587785}+e^{0.951057}\right)=3.977463

The bound is used to decide n before trusting the decimals of the result.