rtoy / maxima

A Clone of Maxima's repo
Other
0 stars 0 forks source link

Limit of the Wallis product #3099

Closed rtoy closed 3 months ago

rtoy commented 3 months ago

Imported from SourceForge on 2024-07-07 13:42:57 Created by andrejv on 2008-08-30 06:28:21 Original: https://sourceforge.net/p/maxima/bugs/1484


Computing the Wallis product for %pi fails:

(%o3) (%pi*4^N*N!^2)/(2*2^(2*N)*gamma(N+1/2)*gamma(N+3/2)) (%i4) limit(%, N, inf); (%o4) 0 (%i5) load(stirling)$ (%i6) stirling(%o3); (%o6) ((N+3/2)^(-N-1)*2^(-2*N-1)*4^N*%e^(2*N+2)*N!^2)/(2*(N+1/2)^N) (%i7) limit(%, N, inf); (%o7) 0 (%i8) ratsimp(%o6); (%o8) (4^N*%e^(2*N+2)*N!^2)/((2*N+1)^N*(2*N+3)^N*(4*N+6)) (%i9) limit(%, N, inf); (%o9) %pi/2

Only the last limit is correct.

Andrej

rtoy commented 3 months ago

Imported from SourceForge on 2024-07-07 13:42:58 Created by dgildea on 2008-08-30 18:49:54 Original: https://sourceforge.net/p/maxima/bugs/1484/#895f


Logged In: YES user_id=1797506 Originator: NO

src/tlimit.lisp rev 1.7: taylim: ask for $lhospitallim terms of taylor series, instead of 1 term. this is an arbitrary limit: with default value $lhospitallim = 4, tlimit(2^n/n^5, n, inf) => 0 (before, tlimit(2^n/n^2, n, inf) => 0 ) This handles this problem with the default settings, and gives the user the ability to increase the limit.

(%i2) (%pi*4^N*N!^2)/(2*2^(2*N)*gamma(N+1/2)*gamma(N+3/2)); (%o2) %pi*2^(-2*N-1)*4^N*N!^2/(gamma(N+1/2)*gamma(N+3/2)) (%i3) limit(%, N, inf); (%o3) %pi/2 (%i4) load(stirling)$ (%i5) stirling(%o2); (%o5) (N+3/2)^(-N-1)*2^(-2*N-2)*4^N*%e^(2*N+2)*N!^2/(N+1/2)^N (%i6) limit(%, N, inf); (%o6) %pi/2 (%i7) ratsimp(%o5); (%o7) 4^N*%e^(2*N+2)*N!^2/((2*N+1)^N*(2*N+3)^N*(4*N+6)) (%i8) limit(%, N, inf); (%o8) %pi/2

rtoy commented 3 months ago

Imported from SourceForge on 2024-07-07 13:43:02 Created by dgildea on 2008-08-30 18:49:54 Original: https://sourceforge.net/p/maxima/bugs/1484/#75c0