home *** CD-ROM | disk | FTP | other *** search
/ Chip 2002 June / Chip_2002-06_cd1.bin / zkuste / derive / download / Setup.exe / %MAINDIR% / Users / Eulermac.dmo < prev    next >
Encoding:
Text File  |  2002-05-15  |  2.0 KB  |  62 lines

  1. "File: EULERMAC.DMO    Euler-Maclaurin Summation Formula Demonstration"
  2.  
  3. "EULERMAC.MTH was contributed by Jim FitzSimons of Cave Creek, Arizona."
  4.  
  5. "Phone: 602-488-1859  Fax: 602-488-5014  E-mail: cherry@neta.com"
  6.  
  7. "The Euler-Maclaurin summation formula can be used to find asymptotic"
  8.  
  9. "expansions of finite or infinite sums."
  10.  
  11. "It is described in Section 23.1.30 on page 806 of the Handbook of"
  12.  
  13. "Mathematical Functions by Milton Abramowitz and Irene A. Stegun."
  14.  
  15. pause:=
  16.  
  17. "This is the Euler-Maclaurin summation formula as defined in EULERMAC.MTH:"
  18.  
  19. EULERMAC(y,k,a0,a,b,m):=SUM(y,k,a0,a-1)+(LIM(y,k,b)+LIM(y,k,a))/2+INT(y,k,a,b)~
  20. +SUM(ZETA(1-2*j_)/(2*j_-1)!*(LIM(DIF(y,k,2*j_-1),k,a,0)-LIM(DIF(y,k,2*j_-1),k,~
  21. b,0)),j_,1,m)
  22.  
  23. "The first argument, y, of EULERMAC should be an expression which is a"
  24.  
  25. "function of the second argument, k, the index variable of the sum."
  26.  
  27. "a0 and b are the starting and ending indexes of the sum, respectively."
  28.  
  29. "a is the start of the Euler-Maclaurin asymptotic expansion.  m is the"
  30.  
  31. "order of the expansion.  Choose a and m to give the desired accuracy."
  32.  
  33. pause:=
  34.  
  35. "The Euler-Mascheroni Gamma constant can be defined as:"
  36.  
  37. euler_gamma=LIM(SUM(1/(k+1),k,0,b-1)-LN(b),b,inf,1)
  38.  
  39. "EULERMAC can approximate the Gamma constant to any desired degree of"
  40.  
  41. "precision.  For example, to approximate it accurate to 32 digits of"
  42.  
  43. "precision, let y(k)=1/(k+1), a0=0, a=64, and n=9:"
  44.  
  45. APPROX(LIM(EULERMAC(1/(k+1),k,0,64,b-1,9)-LN(b),b,inf,1),32)
  46.  
  47. "As another example, EULERMAC can approximate the Riemann Zeta function."
  48.  
  49. "If the real part of z>1, Zeta(z,q) can be defined as the infinite sum:"
  50.  
  51. ZETA(z,q)=SUM(1/(q+k)^z,k,0,inf)
  52.  
  53. "To compute Zeta(2)=Zeta(2,1) accurate to 32 digits of precision, set"
  54.  
  55. "precision to exact mode, but display using 32 digit decimal notation:"
  56.  
  57. [Precision:=Exact,Notation:=Decimal,NotationDigits:=32]
  58.  
  59. "Then let y(k)=1/(1+k)^2, a0=0, a=64, b=inf, and m=9 in EULERMAC:"
  60.  
  61. EULERMAC(1/(1+k)^2,k,0,64,inf,9)
  62.