Go Back > Great Internet Mersenne Prime Search > Math

Thread Tools
Old 2009-08-25, 03:12   #1
CRGreathouse's Avatar
Aug 2006

5,987 Posts
Default Calculating a difficult sum

What are good ways to numerically calculate integrals? Background (skip, skim, or read depending on your patience):
I was trying to estimate the value of a difficult arithmetic sum recently and I'm not quite sure how to go about it.

The summands are ~ 1/xlog^2 x and so clearly converge, but a finite sum as far as I was able to manage (a few million terms, though I could reach a billion with a bit more time) aren't enough to get a value I can trust to even two decimal places, and it's surely meaningless beyond four.

The obvious next step was to take the sum as far as I cared to go and use an integral for the rest. Fortunately the terms are just well-behaved enough that I have viable upper and lower bounds. With some effort I managed to generate three integrals that give upper and lower bounds (the lower bound is two piecewise integrals).

So I typed all this up in my programming language of choice and wrote a wrapper function that let me set precision and how far to set the sum/integral cutoff. It was only then that I realized that the integral was apparently rather numerically unstable -- even though the bounding functions were smooth in the domain of consideration. Every time I raised the precision I got a new answer, to the limit of my patience.

My best though so far was to subtract the main term 1/xlog^2 x out of the integral, since it has closed-form integral -1/log x. But this hasn't helped much so far.
I'm just looking for general strategies, either better ways to calculate the integrals or a different approach to the sum. Because the sum includes primes it's a pain to work with numerically... but Pierre Dusart's bounds are tight enough at large numbers that I think I can make the integral approach work. But first I have to know that what I think is the integral is, in fact, the integral!

Last fiddled with by CRGreathouse on 2009-08-25 at 03:12
CRGreathouse is offline   Reply With Quote
Old 2009-08-25, 04:50   #2
flouran's Avatar
Dec 2008

72·17 Posts

Why not evaluate the integrals formulaically using an implementation of Risch's algorithm (although Cherry's algorithmic extension to Rich's result seems more practical; but, as you know, that's not saying much ), and then evaluate the resulting formula numerically at the points you want?

If I interpret Cherry's paper correctly (which you gave me 4 months ago), he does implement his algorithm in Macsyma.

Is Mathematica able to compute this integral (I know, it's a dumb question; but it's worth a shot)?

Last fiddled with by flouran on 2009-08-25 at 04:52
flouran is offline   Reply With Quote
Old 2009-08-25, 05:05   #3
CRGreathouse's Avatar
Aug 2006

10111011000112 Posts

Neither Mathematica nor Maxima can evaluate the integral in closed form. That's not surprising: most integrals can't be, and I wouldn't have posted if it could have been.
CRGreathouse is offline   Reply With Quote
Old 2009-08-25, 14:11   #4
wblipp's Avatar
May 2003
Near Grandkid

2·1,187 Posts

Sometimes a change of variable in the integral helps. The integral convergence may be the same problem as the summation convergence - the integrand decreases so slowly that you need to keep extending the range of integration. The idea is to get a new integration variable that rapidly covers ranges of the old integration variable. Perhaps z = log x.

wblipp is offline   Reply With Quote

Thread Tools

Similar Threads
Thread Thread Starter Forum Replies Last Post
mprime seems difficult/buggy dchmelik Software 3 2017-10-25 06:33
A rather difficult lottery Oddball Lounge 2 2010-05-06 02:18
Why is RH so difficult to prove? Damian Math 31 2008-10-03 02:11
Difficult Differential Unregistered Homework Help 9 2008-10-01 21:24
Geometry puzzle(difficult) hyh1048576 Puzzles 6 2003-07-27 06:46

All times are UTC. The time now is 23:56.

Wed Feb 8 23:56:14 UTC 2023 up 174 days, 21:24, 1 user, load averages: 2.15, 1.28, 1.17

Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2023, Jelsoft Enterprises Ltd.

This forum has received and complied with 0 (zero) government requests for information.

Permission is granted to copy, distribute and/or modify this document under the terms of the GNU Free Documentation License, Version 1.2 or any later version published by the Free Software Foundation.
A copy of the license is included in the FAQ.

≠ ± ∓ ÷ × · − √ ‰ ⊗ ⊕ ⊖ ⊘ ⊙ ≤ ≥ ≦ ≧ ≨ ≩ ≺ ≻ ≼ ≽ ⊏ ⊐ ⊑ ⊒ ² ³ °
∠ ∟ ° ≅ ~ ‖ ⟂ ⫛
≡ ≜ ≈ ∝ ∞ ≪ ≫ ⌊⌋ ⌈⌉ ∘ ∏ ∐ ∑ ∧ ∨ ∩ ∪ ⨀ ⊕ ⊗ 𝖕 𝖖 𝖗 ⊲ ⊳
∅ ∖ ∁ ↦ ↣ ∩ ∪ ⊆ ⊂ ⊄ ⊊ ⊇ ⊃ ⊅ ⊋ ⊖ ∈ ∉ ∋ ∌ ℕ ℤ ℚ ℝ ℂ ℵ ℶ ℷ ℸ 𝓟
¬ ∨ ∧ ⊕ → ← ⇒ ⇐ ⇔ ∀ ∃ ∄ ∴ ∵ ⊤ ⊥ ⊢ ⊨ ⫤ ⊣ … ⋯ ⋮ ⋰ ⋱
∫ ∬ ∭ ∮ ∯ ∰ ∇ ∆ δ ∂ ℱ ℒ ℓ
𝛢𝛼 𝛣𝛽 𝛤𝛾 𝛥𝛿 𝛦𝜀𝜖 𝛧𝜁 𝛨𝜂 𝛩𝜃𝜗 𝛪𝜄 𝛫𝜅 𝛬𝜆 𝛭𝜇 𝛮𝜈 𝛯𝜉 𝛰𝜊 𝛱𝜋 𝛲𝜌 𝛴𝜎𝜍 𝛵𝜏 𝛶𝜐 𝛷𝜙𝜑 𝛸𝜒 𝛹𝜓 𝛺𝜔