4
$\begingroup$

Why:

Limit[Sum[Sqrt[-i^2 + n^2]/n^2, {i, 1, n}], n -> Infinity]
(* 0 *)

but:

Integrate[Sqrt[1 - x^2], {x, 0, 1}]
(* Pi/4 *)

The former is the Riemann sum of the latter. They should be equal.

(Version: 11.3)

$\endgroup$
5
  • 1
    $\begingroup$ The limit expression you gave returns unevaluated in version 12.0 (Win10-64 desktop) and 13.0 (Linux cloud) $\endgroup$
    – MarcoB
    Jan 18 at 2:12
  • 2
    $\begingroup$ Please do not use the bugs tag for new questions; the tag can be added when the problem has been vetted by this community and the observed behavior is confirmed to be a bug. $\endgroup$
    – MarcoB
    Jan 18 at 2:14
  • $\begingroup$ The limit expression is wrong, should be Sum[Sqrt[1 - i^2/n^2]/n, {i, 1, Infinity}] $\endgroup$ Jan 18 at 7:10
  • $\begingroup$ @UlrichNeumann: Isn't that equivalent?$$\frac{\sqrt{1 - i^2/n^2}}{n} = \frac{1}{n} \sqrt{\frac{n^2 - i^2}{n^2}} = \frac{1}{n^2} \sqrt{n^2 - i^2}$$ $\endgroup$ Jan 18 at 18:14
  • $\begingroup$ @MichaelSeifert You're right, thanks! $\endgroup$ Jan 18 at 18:52

3 Answers 3

8
$\begingroup$

In 13.0.0 on Windows 10

AsymptoticSum[Sqrt[-i^2/n^2 + 1]/n, {i, 1, n}, n -> Infinity]

Pi/4

It should be noticed that

AsymptoticSum[Sqrt[-i^2 + n^2]/n^2, {i, 1, n}, n -> Infinity]

returns the input.

$\endgroup$
1
  • $\begingroup$ Thank you very much for solving my question. $\endgroup$
    – lotus2019
    Jan 19 at 2:20
5
$\begingroup$

Numerically solving,

Needs["NumericalCalculus`"]

lim = NLimit[Sum[Sqrt[-i^2 + n^2]/n^2, {i, 1, n}], n -> Infinity, 
  WorkingPrecision -> 15]

(* 0.785398 *)

RootApproximant[lim/Pi]*Pi

(* π/4 *)
$\endgroup$
1
  • $\begingroup$ Thank you very much for solving my question. $\endgroup$
    – lotus2019
    Jan 19 at 2:21
4
$\begingroup$

Try midpoint discretization x=1/(2n)+i/n, i,1,n-1:

dx = 1/n;
Sqrt[1 - x^2] dx  /. x -> dx/2 + i dx // FullSimplify (*Sqrt[1 - (1 + 2 i)^2/(4 n^2)]/n*)

Unfortunately Mathematica can't solve the limit

Limit[Sum[Sqrt[1 - (1 + 2 i)^2/(4 n^2)]/n , {i,1, n - 1}], n -> Infinity]

but numerically evaluation gives expected result ~Pi/4

Table[{n,NSum[Sqrt[1 - (1 + 2 i)^2/(4 n^2)]/n, {i, 1, n -1}]}, {n, {10, 100,1000 , 10000}}]
(*{{10, 0.688228}, {100, 0.775482}, {1000,0.784401}, {10000, 0.785298}}*)

left riemann sum works too

Table[{n,NSum[Sqrt[1 - i^2/n^2]/n, {i, 0, n - 1}]},{n, {10, 100, 1000 ,10000}}]
(* {{10, 0.82613}, {100, 0.790104}, {1000, 0.785889}, {10000, 0.785448}}*)
$\endgroup$
1
  • $\begingroup$ Thank you very much. $\endgroup$
    – lotus2019
    Jan 19 at 2:22

Your Answer

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

Not the answer you're looking for? Browse other questions tagged or ask your own question.