Ask Your Question
0

limit of sequence

asked 2022-05-18 15:38:47 +0100

mahmood gravatar image

given this sequence

i tried the following:

  s,n = var('s,n')
  s = sum((3*n)/sqrt(2*n^4-k^2*n^2), k, 1, n)
  s.limit(n=Infinity)

but i get:

3*limit(n*sum(1/sqrt(-k^2*n^2 + 2*n^4), k, 1, n), n, +Infinity)

which is not the result i want, this sequence either diverges or converges, so its either a number or infinity/-infinity, any ideas how to make this work properly? or can sagemath not handle this type of limits?

thank you

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
1

answered 2022-05-19 00:31:35 +0100

dan_fulea gravatar image

Consider first the sum alone, without taking a limit.

var('k,n')
E = (3*n)/sqrt(2*n^4 - k^2*n^2)
S = sum(E.canonicalize_radical(), k, 1, n)

The value of S is more or less an echo. In other words, sage has no idea (and no chance) to find a closed formula for the sum.

sage: S
3*sum(1/sqrt(-k^2 + 2*n^2), k, 1, n)

Taking the limit from such an expression produces an other echo.

sage: S.limit(n = oo)
3*limit(sum(1/sqrt(-k^2 + 2*n^2), k, 1, n), n, +Infinity)

In such cases, we can ask for numerical values for a "big $n$":

sage: n = 10**6; 3.0 * sum([ 1.0 / sqrt(2.*n^2 - k^2) for k in range(1, n + 1)])
2.35619492953245

For such numerical computations pari/gp does a better job, we have for instance

? \p 100
   realprecision = 115 significant digits (100 digits displayed)
? n = 10^6; sum(k=1, n, 3 / sqrt(2*n^2 - k^2))
%2 = 2.356194929532423149025695836193084006094556217514368071115402460936426617919755947726804564160237427
? n = 10^8; sum(k=1, n, 3 / sqrt(2*n^2 - k^2))
%3 = 2.35619449458574323604876967144696073157514146025901053849933599052885950787940136378309129299648754

Mathematically we have a masked Riemann sum: $$ 3\lim_{n\to\infty}\sum_{1\le k\le n}\frac 1{\sqrt{2n^2-k^2}} = 3\lim_{n\to\infty}\frac 1n\sum_{1\le k\le n}\frac 1{\sqrt{2-(k/n)^2}} = 3\int_0^1\frac{dx}{2-x^2} = \frac{3\pi}4\ , $$ and this involved integral can be easily done in sage:

sage: var('x');
sage: integral( 3 / sqrt(2 - x^2), x, 0, 1)
3/4*pi
sage: _.n()
2.35619449019234

Sage is stronger, when the typist acts both as a good mathematician and as a good programmer, and it was designed to work best in such a combination.

edit flag offensive delete link more

Comments

thank you!

mahmood gravatar imagemahmood ( 2022-05-19 10:38:03 +0100 )edit

but shouldnt sagemath be able to figure out that its a riemann sum on its own?

mahmood gravatar imagemahmood ( 2022-05-20 14:43:21 +0100 )edit

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

1 follower

Stats

Asked: 2022-05-18 15:38:47 +0100

Seen: 370 times

Last updated: May 19 '22