Gauss-Chebyshev quadrature formula

chebyshev polynomialsnumerical-calculus

I am currently working to numerically evaluate integral of form
$$I=\int_{-1}^{1}\dfrac{f(x)}{\sqrt{1-x^2}}\text{d}x$$
Gauss-Chebyshev formula says
$$\int_{-1}^{1}\dfrac{f(x)}{\sqrt{1-x^2}}\text{d}x=\dfrac{\pi}{n}\sum_{k=1}^{n}f(\cos(\dfrac{2k-1}{n}\pi)) +\dfrac{2\pi}{(2n)!4^{n}}f^{(2n)}(\xi)=A_n+\dfrac{2\pi}{(2n)!4^{n}}f^{(2n)}(\xi)$$
I wanted to check this formula by choosing $f$ such that $f^{2n}$ is bounded on $[-1,1]$.I set $f(x)=e^x ,f^{2n}(x)\leq e\; , x\in [-1,1]$.For $n=5$ biggest possible mistake is $\dfrac{2\pi e}{10!4^{5}}\approx 4.6 \cdot 10^{-9}$,so it means $I$ and $A_5$ should have same first $8$ decimals.I wrote program in matlab for $n=5$ and I get $A_5=3.97746325877669$.On this online app https://keisan.casio.com/exec/system/1282551763 they get same answer as I , but they say only first $6 $ are correct.

Can someone explain me why are only $6$ places correct not $8$ I get same situation for other numbers, is it due to error of calculating value of functions or something else?

Best Answer

We have:

\begin{align}I&=3.97746326050\\-(A_5&=3.97746325877)\\\hline\mathrm{err}&=0.00000000172\\\frac{2\pi e}{10!4^5}&=0.00000000459\end{align}

and thus the provided upper bound on the error is indeed correct.

Related Question