I came over the following integral $$ \int_0^\pi \sin(x^3) \mathrm{d}x $$ when a friend of mine tried to approximate it. The most obvious way is to use taylors formula, and then turn the integral into a sum. Eg $$ \int_0^\pi \sin(x^3) \mathrm{d}x \approx \sum_{k=0}^N \frac{1}{2} \frac{(-1)^k \pi^{3k+2}}{(3k+2)(2k+1)!} $$ The problem is the nominator increases much more rapidly than the denominator for the first 30 terms or so. Much faster than what a standard calculator can deal with. This can be seen here http://i.imgur.com/Giv59wR.jpg

By using the midpoint rule instead, the sum turns into $$ \int_0^\pi \sin(x^3) \mathrm{d}x \approx \frac{\pi}{2}\sum_{k=0}^N f\left( \frac{\pi}{2} \frac{2k-1}{N}\right) $$ Which converges to two decimal places in $36$ iterations, however to obtain a higher accuracy the convergence is slower than the taylor series.

As a final note I also tried using the substitution $u \mapsto u^3$, but the series expansion did not improve.

My question is as follows: What is the least terms needed to approximate the integral to $3$ digits accuracy under the restrictions of using a standard pocket calculator?

To clearify the calculator does not have more than 8 digits accuracy, and can use sine and cosine. Oh, I also tried Simpsons that did not improve the convergence. Could Romberg, or Gaussian lead to faster convergence?

  • $\begingroup$ You will get better results using Simpson's rule or Boole's rule. 36 intervals gives you 3 digits with either of these methods. $\endgroup$ – vadim123 Oct 11 '13 at 14:17
  • $\begingroup$ Then where is my mistake here? i.imgur.com/Kj477Ey.jpg $\endgroup$ – N3buchadnezzar Oct 11 '13 at 14:29
  • $\begingroup$ You are using the midpoint rule; instead I advocate using a different, better, rule for numerical integration. $\endgroup$ – vadim123 Oct 11 '13 at 15:05
  • $\begingroup$ I added an image (hopefully clearly) showing me using the simpsons rule to approximate the integral. As seen it does not converge successfully to three correct digits neither after 36 or 100 iterations. $\endgroup$ – N3buchadnezzar Oct 11 '13 at 15:17
  • $\begingroup$ Your sums suggest that the interval is $[0,2\pi]$, not $[0,\pi]$ (you are not using Simpson's rule correctly). See WolframAlpha. $\endgroup$ – vadim123 Oct 11 '13 at 15:37

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.