Simplifying finite sum over 1/(ax+b) - MathOverflow most recent 30 from http://mathoverflow.net 2013-06-20T01:33:28Z http://mathoverflow.net/feeds/question/88632 http://www.creativecommons.org/licenses/by-nc/2.5/rdf http://mathoverflow.net/questions/88632/simplifying-finite-sum-over-1-axb Simplifying finite sum over 1/(ax+b) Alex Flint 2012-02-16T14:28:49Z 2012-02-16T17:34:41Z <p>Can I simplify:</p> <p>\begin{equation} \sum_{x=x_0}^{x_1} \frac{1}{ax+b} \end{equation}</p> http://mathoverflow.net/questions/88632/simplifying-finite-sum-over-1-axb/88636#88636 Answer by Aeryk for Simplifying finite sum over 1/(ax+b) Aeryk 2012-02-16T14:46:02Z 2012-02-16T14:46:02Z <p>Mathematica (or rather Wolfram Alpha) gives an answer in terms of the digamma function: http://www.wolframalpha.com/input/?i=Sum[1%2F%28a+x%2Bb%29%2C{x%2Cx0%2Cx1}]</p> http://mathoverflow.net/questions/88632/simplifying-finite-sum-over-1-axb/88639#88639 Answer by Alex Flint for Simplifying finite sum over 1/(ax+b) Alex Flint 2012-02-16T15:11:38Z 2012-02-16T15:11:38Z <p>Using some Taylor approximations it turns out there's a fast approximation here. Code below.</p> <pre><code>float fastdigamma (float x) { float twopx = 2.f + x; return - (1.f + 2.f * x) / (x * (1.f + x)) - (13.f + 6.f * x) / (12.f * twopx * twopx) + log(twopx); } float FastHarmonicSum(float a, float b, float x0, float x1) { return (fastdigamma(b/a + x1 + 1.) - fastdigamma(b/a + x0)) / a; } </code></pre> <p>I found <code>fastdigamma</code> at <a href="http://www.machinedlearnings.com/2011/06/faster-lda.html" rel="nofollow">http://www.machinedlearnings.com/2011/06/faster-lda.html</a></p> http://mathoverflow.net/questions/88632/simplifying-finite-sum-over-1-axb/88653#88653 Answer by Gerhard Paseman for Simplifying finite sum over 1/(ax+b) Gerhard Paseman 2012-02-16T17:34:41Z 2012-02-16T17:34:41Z <p>Sometimes I estimate the sum of 1/p, where p ranges over a finite set of prime numbers. I often use 2/a as a lower bound for 1/(a+d) + 1/(a-d) when d is small compared to a. I often end up with a handy rational approximation with a small error I can calculate exactly when I need to do so. Perhaps a modification of this idea can help you in making elementary estimates of your sum.</p> <p>Gerhard "Not Quite Splitting The Difference" Paseman, 2012.02.16 </p>