Taking the limit of a sum

Question: Why can't Mathematica calculate this limit in this way? And what can I do to fix it?

Limit[Sum[2/n (1 + (2 i - 1)/n)^(1/3), {i, 1, n}], n -> \[Infinity]] //N

Of course this limit is a Riemann-Sum, so it can also be represented by:

Integrate[(1 + x)^(1/3), {x, 0, 2}] // N

Finally, I noticed from another question that this does work:

Limit[Sum[Sin[a + x*(k/n)]*(x/n), {k, 1, n}], n -> Infinity]

But what is the essential difference with my code?

• Sum and Limit are evaluated separately. In the first case Sum cannot be evaluated for arbitrary n. In the second, it can. – Szabolcs Sep 3 '17 at 21:00
• You can try Needs["NumericalCalculus`"]; NLimit[Sum[..], n -> \[Infinity]] -- it gives exactly the same answer as Integrate[..] // N. – Michael E2 Sep 3 '17 at 21:08
• Try Limit[Sum[2/n CubeRoot[1 + (2 i - 1)/n], {i, 1, n}], n -> \[Infinity]] – LouisB Sep 3 '17 at 22:43
• @LouisB Why does CubeRoot work?! – GambitSquared Sep 4 '17 at 7:26
• I do not know why CubeRoot works and Power[... , 1/3] does not. I try to use the Surd function for roots. See this question about n-th roots and this question about real roots for more information. – LouisB Sep 4 '17 at 8:31

In order for Mathematica to be able to compute the limit of a sum, it (usually) needs to be able to first compute the sum itself. In this case, this is failing to do so when using Power but not when using the Surd. The reason is that, in general, you can't split the fraction inside the root to combine the $\frac{1}{n}$ in the first term with the $\frac{1}{n^{1/3}}$ in the second term. Under the assumptions of what $n$ is in your sum, however, this is valid, and if you simplify the expression using appropriate assumptions, then both Sum and Limit will succeed:
(Note that in fact we know that $n\geq1$ or the sum is empty, but it is sufficient that $n$ is positive in the simplification step). It is a small bug that Sum doesn't recognize this automatically, and I have filed it for the developer to fix.
As for why Surd and CubeRoot work in this case. Since they are by definition functions from reals to reals (and in particular, do not use the principle root), it is in fact the case that $\frac{\sqrt{f(n)}}{n} = \sqrt{\frac{f(n)}{n^3}}$. So Sum doesn't have to check any validity conditions and succeeds.