1

I have an equation $$ \int_{0}^{1}sin(x)dx $$ and I want to find the error estimation for Gaussian quadrature using the above equation. I saw this formula for finding the error of the gaussian quadrature $$ \frac{(b-a)^{2n+1}(n!)^{4}}{(2n+1)(2n!)^{2}}\frac{f^{2n}(x)}{(2n!)} $$ For $n=2$ and by change of interval, i get this $$ \frac{(1)^{5}(2!)^{4}}{(5)(4!)^{2}} $$ Now the part I never get, i read some books online and they say $$ \max_{-1\leq x\leq 1}\frac{|f^{2n}(x)|}{(2n)!} $$ whiles others say $$ \frac{\max_{a\leq x\leq b}|f^{2n}(x)|}{(2n)!} $$ Which should I use. Please I need some clarity here.

Now if I use both cases, I never get the book's error. the books with this example obtain an error of $6.4180e-003$. How do they get it. Please I need explanation. Thanks.

  • Gauss quadratures are initially deduced for $[a,b] = [-1,1]$... Other intervals are dealt with using variable changes. So, both formulas can be correct, depending on which interval you are working on. – PierreCarre May 05 '20 at 08:32
  • okay, I was thinking since I changed the interval $[a,b] = [-1,1]$ it was ideal to use the first one ie taking the $\max_{-1\leq x\leq 1}\frac{|f^{2n}(x)|}{(2n)!}$. However, after calculating I still don't the error-value in the book. – Iphy Kelvin May 05 '20 at 08:38
  • Regarding the computed error, try to understand if they are using the error estimate you mention or if they are computing the actual error (keep in mind that you can compute the exact value of the integral) – PierreCarre May 05 '20 at 08:39

1 Answers1

1

Can you provide one of the references for those books? Using the error formula you mention, the error can be bounded by

$$ \frac{(1-0)^{2\cdot 2+1}(2!)^4}{(2\cdot 2+1)(2\cdot 2)!^3 } |\sin 1| \approx1.94785\times 10^{-4}.$$

In this case, since you can compute the exact value of the integral, you can also compute the actual error, $1.09882\times 10^{-4}$, which is consistent with the error bound.

PierreCarre
  • 20,974
  • 1
  • 18
  • 34
  • Yeah exactly, I had similar actual error. Okay, here is one reference: Computation of Nodes and Weights of Gaussian Quadrature by using the Jacobi Method by Raja Zafar Iqbal. Specifically, page 18. – Iphy Kelvin May 05 '20 at 08:59
  • @IphyKelvin with that reference I get a master thesis (by that author) but I see nothing relevant on page 18. – PierreCarre May 05 '20 at 09:09
  • the page 18 has the example I am talking about, along with a table of errors he obtained using the error formula for the Gaussian Quadrature. – Iphy Kelvin May 05 '20 at 09:12
  • my goal is knowing how he got his error values using the example. Because I don't get the values if I do the calculation. – Iphy Kelvin May 05 '20 at 09:14
  • @IphyKelvin Whatever process he used, it is not a very good one, considering that the bound I mentioned (obtained by elementary methods) is way smaller. – PierreCarre May 05 '20 at 09:29
  • @IphyKelvin I found the example you mention (In the document I found, it is on page 13). The author is computing the actual error, but the values in the table are just wrong, at least with respect to the Gauss quadrature. – PierreCarre May 05 '20 at 09:35
  • Okay, cool. Thanks for this. You don't know how happy I am hearing this. lol. Anyway, how did you obtain the bound i.e $1.94785\times 10^{-4}$. I know $b=1$,$a=0$, what values did you obtain for $\max_{a\leq x\leq b}|f^{2n}(x)|$ if $n=2$. Bcos, using a graph, I initilally had $0.841471$. – Iphy Kelvin May 05 '20 at 09:36
  • @IphyKelvin An even order derivative of $\sin x$ will be either $\sin x$ or $-\sin x$. In any case $\max_{0\leq x \leq 1}|f^{(2n)}(x)| = |\sin 1| \approx 0.841471$, so that bound is good for any $n$. – PierreCarre May 05 '20 at 09:45
  • I am so grateful for this. Exactly the same value I get, however I still don't get your bound lol. After calculation, I get $0.007012258333$ as my bound. – Iphy Kelvin May 05 '20 at 09:48
  • @IphyKelvin Check if you are computing the factorials correctly... $(2n)!$ is not the same as $2n!$. – PierreCarre May 05 '20 at 09:49
  • Got it. Yeah my factorial was not correct. Thanks alot. Like you to answer another question for me if you don't mind. – Iphy Kelvin May 05 '20 at 09:56