Mon Feb 22 22:12:00 MST 1999 aquarius% macsyma Starting Macsyma math engine with no window system... /opt/local/macsyma_422/macsyma.422 local This is Macsyma 422.0 for Sparc (Solaris 2.x) computers. Copyright (c) 1982 - 1998 Macsyma Inc. All rights reserved. Portions copyright (c) 1982 Massachusetts Institute of Technology. All rights reserved. Type "DESCRIBE(TRADE_SECRET);" to see important legal notices. Type "HELP();" for more information. /aquarius/data2/opt/local/macsyma_422/system/init.lsp being loaded. /aquarius/home/wester/macsyma-init.lsp being loaded. (c1) (c2) /* ----------[ M a c s y m a ]---------- */ /* ---------- Initialization ---------- */ symbol_display_case: lower_case$ Time= 0 msecs (c3) showtime: all$ Time= 0 msecs (c4) prederror: false$ Time= 0 msecs (c5) /* ---------- Sums ---------- */ load(nusum1)$ /aquarius/data2/opt/local/macsyma_422/share/nusum1.so being loaded. Time= 1230 msecs (c6) /* Simplify the sum below to sum(x[i]^2, i = 1..n) - sum(x[i], i = 1..n)^2/n */ xbar: sum(x[j], j, 1, n) / n; Time= 40 msecs n ==== \ > x / j ==== j = 1 (d6) -------- n (c7) sum((x[i] - xbar)^2, i, 1, n); Time= 80 msecs n ==== \ > x n / j ==== ==== \ j = 1 2 (d7) > (x - --------) / i n ==== i = 1 (c8) niceindices(sumexpand(expand(%))); /aquarius/data2/opt/local/macsyma_422/share/algfuncs.so being loaded. Time= 750 msecs n ==== \ 2 ( > x ) n / i ==== ==== \ 2 i = 1 (d8) > x - ----------- / i n ==== i = 1 (c9) remvalue(xbar)$ Time= 0 msecs (c10) /* Derivation of the least squares fitting of data points (x[i], y[i]) to a line y = m x + b. See G. Keady, ``Using Maple's linalg package with Zill and Cullen _Advanced Engineering Mathematics_, Part II: Vectors, Matrices and Vector Calculus'', University of Western Australia, ftp://maths.uwa.edu.au/pub/keady/ */ f: sum((y[i] - m*x[i] - b)^2, i, 1, n)$ Time= 30 msecs (c11) solve([diff(f, m) = 0, diff(f, b) = 0], [m, b]); /aquarius/data2/opt/local/macsyma_422/library1/algsys.so being loaded. /aquarius/data2/opt/local/macsyma_422/library1/triangsy.so being loaded. Time= 180 msecs (d11) [] (c12) remvalue(f)$ Time= 0 msecs (c13) load("nusum1")$ /aquarius/data2/opt/local/macsyma_422/share/nusum1.so being loaded. Time= 150 msecs (c14) /* Indefinite sum => (-1)^n binomial(2 n, n). See Herbert S, Wilf, ``IDENTITIES and their computer proofs'', University of Pennsylvania. */ closedform(indefsum((-1)^k * binomial(2*n, k)^2, k)); /aquarius/data2/opt/local/macsyma_422/library1/binoml.so being loaded. /aquarius/data2/opt/local/macsyma_422/library1/combin.so being loaded. /aquarius/data2/opt/local/macsyma_422/library1/result.so being loaded. Time= 1000 msecs k 2 (d14) indefsum((- 1) binomial (2 n, k), k) (c15) /* Check whether the full Gosper algorithm is implemented => 1/2^(n + 1) binomial(n, k - 1) */ closedform(indefsum(binomial(n, k)/2^n - binomial(n + 1, k)/2^(n + 1), k)); Time= 2690 msecs (- n + k - 1) binomial(n + 1, k) (d15) - -------------------------------- n 2 2 (n + 1) (c16) factcomb(makefact(%)); Time= 220 msecs n! (d16) ---------------- n 2 k! 2 (n - k)! (c17) /* Dixon's identity (check whether Zeilberger's algorithm is implemented). Note that the indefinite sum is equivalent to the definite sum(..., k = -min(a, b, c)..min(a, b, c)) => (a + b + c)!/(a! b! c!) [Wilf] */ closedform(indefsum((-1)^k * binomial(a+b, a+k) * binomial(b+c, b+k) * binomial(c+a, c+k), k)); Time= 1410 msecs (d17) indefsum(binomial(b + a, k + a) binomial(c + a, k + c) k binomial(c + b, k + b) (- 1) , k) (c18) /* Telescoping sum => g(n + 1) - g(0) */ closedform(sum(g(k + 1) - g(k), k, 0, n)); Time= 150 msecs n n ==== ==== \ \ (d18) > g(k + 1) - > g(k) / / ==== ==== k = 0 k = 0 (c19) /* => n^2 (n + 1)^2 / 4 */ closedform(sum(k^3, k, 1, n)); Time= 530 msecs 2 2 n (n + 1) (d19) ----------- 4 (c20) /* See Daniel I. A. Cohen, _Basic Techniques of Combinatorial Theory_, John Wiley and Sons, 1978, p. 60. The following two sums can be derived directly from the binomial theorem: sum(k^2 * binomial(n, k) * x^k, k = 1..n) = n x (1 + n x) (1 + x)^(n - 2) => n (n + 1) 2^(n - 2) [Cohen, p. 60] */ closedform(sum(k^2 * binomial(n, k), k, 1, n)); Time= 350 msecs n ==== \ (n + 1) > k binomial(n, k) / ==== k = 1 (d20) ------------------------------ 2 (c21) /* => [2^(n + 1) - 1]/(n + 1) [Cohen, p. 83] */ closedform(sum(binomial(n, k)/(k + 1), k, 0, n)); Time= 180 msecs n ==== \ binomial(n, k) (d21) > -------------- / k + 1 ==== k = 0 (c22) /* Vandermonde's identity => binomial(n + m, r) [Cohen, p. 31] */ closedform(sum(binomial(n, k) * binomial(m, r - k), k, 0, r)); Time= 570 msecs r ==== \ (d22) > binomial(m, r - k) binomial(n, k) / ==== k = 0 (c23) /* => Fibonacci[2 n] [Cohen, p. 88] */ closedform(sum(binomial(n, k) * fib(k), k, 0, n)); /aquarius/data2/opt/local/macsyma_422/library1/scs.so being loaded. Time= 720 msecs n n ==== ==== \ k \ k > %phi binomial(n, k) > (1 - %phi) binomial(n, k) / / ==== ==== k = 0 k = 0 (d23) -------------------------- - -------------------------------- 2 %phi - 1 2 %phi - 1 (c24) /* => Fibonacci[n] Fibonacci[n + 1] [Cohen, p. 65] */ closedform(sum(fib(k)^2, k, 1, n)); Time= 1620 msecs 2 n + 2 n n + 1 (%phi - 1) %phi (1 - %phi) (%phi - 1) %phi (d24) ---------------------- - -------------------------------- 2 2 (2 %phi - 1) (2 %phi - 1) n ==== 2 \ 2 k + 1 (%phi - %phi - 1) > %phi / ==== k = 1 - ------------------------------------ 2 (2 %phi - 1) n ==== 2 \ k k (%phi - %phi - 1) > (1 - %phi) %phi / ==== k = 1 + ------------------------------------------ 2 (2 %phi - 1) n ==== 2 \ 2 k (%phi - 1) (%phi - %phi - 1) > (1 - %phi) / ==== 2 k = 1 (%phi - 1) %phi + ------------------------------------------------- - ---------------- 2 2 (2 %phi - 1) (2 %phi - 1) 2 n 2 2 (1 - %phi) (%phi - 1) %phi (%phi - 1) %phi (%phi - 1) %phi - ------------------------------ + ---------------- + --------------- 2 2 2 (2 %phi - 1) (2 %phi - 1) (2 %phi - 1) (c25) factor(ratsimp(%)); Time= 140 msecs n n n + 1 n n (%phi - (1 - %phi) ) (%phi + (1 - %phi) %phi - (1 - %phi) ) (d25) ------------------------------------------------------------------ 5 (c26) ratsimp(% - fibtophi(fib(n) * fib(n + 1))); Time= 10 msecs (d26) 0 (c27) /* => 1/2 cot(x/2) - cos([2 n + 1] x/2)/[2 sin(x/2)] See Konrad Knopp, _Theory and Application of Infinite Series_, Dover Publications, Inc., 1990, p. 480. */ closedform(sum(sin(k*x), k, 1, n)); Time= 1560 msecs %i n x + %i x - %i n x %i x %i %e %i %e %i %e %i (d27) - ------------------ - -------------- + -------------- + -------------- %i x %i x %i x %i x 2 (%e - 1) 2 (%e - 1) 2 (%e - 1) 2 (%e - 1) (c28) factor(trigreduce(rectform(%))); /aquarius/data2/opt/local/macsyma_422/library1/trgred.so being loaded. Time= 2080 msecs sin((n + 1) x) - sin(n x) - sin(x) (d28) ---------------------------------- 2 (cos(x) - 1) (c29) halfangles(% - 1/2*cot(x/2) - cos((2*n + 1)*x/2)/(2*sin(x/2))); Time= 1020 msecs sqrt(cos((2 n + 1) x) + 1) sin((n + 1) x) - sin(n x) - sin(x) (d29) - -------------------------- + ---------------------------------- 2 sqrt(1 - cos(x)) 2 (cos(x) - 1) cos(x) + 1 - ---------- 2 sin(x) (c30) /* => sin(n x)^2/sin x [Gradshteyn and Ryzhik 1.342(3)] */ closedform(sum(sin((2*k - 1)*x), k, 1, n)); Time= 770 msecs n ==== \ (d30) > sin((2 k - 1) x) / ==== k = 1 (c31) /* => Fibonacci[n + 1] [Cohen, p. 87] */ closedform(sum(binomial(n - k, k), k, 0, floor(n/2))); Time= 960 msecs n floor(-) 2 ==== \ (d31) > binomial(n - k, k) / ==== k = 0 (c32) /* => pi^2 / 6 + zeta(3) =~ 2.84699 */ closedform(sum(1/k^2 + 1/k^3, k, 1, inf)); /aquarius/data2/opt/local/macsyma_422/library1/specfn.so being loaded. Time= 550 msecs 2 %pi (d32) zeta(3) + ---- 6 (c33) /* sfloat(%); */ bfloat(%); Time= 80 msecs (d33) 2.8469909700078207219b0 (c34) /* => pi^2/12 - 1/2 (log 2)^2 [Gradshteyn and Ryzhik 0.241(2)] */ closedform(sum(1/(2^k*k^2), k, 1, inf)); Time= 230 msecs inf ==== \ 1 (d34) > ----- / k 2 ==== 2 k k = 1 (c35) /* => pi/12 sqrt(3) - 1/4 log 3 [Knopp, p. 268] */ closedform(sum(1/((3*k + 1)*(3*k + 2)*(3*k + 3)), k, 0, inf)); Time= 750 msecs %pi log(3) (d35) --------- - ------ 4 sqrt(3) 4 (c36) /* => 1/2 (2^(n - 1) + 2^(n/2) cos(n pi/4)) [Gradshteyn and Ryzhik 0.153(1)] */ closedform(sum(binomial(n, 4*k), k, 0, inf)); Time= 1070 msecs inf ==== \ (d36) > binomial(n, 4 k) / ==== k = 0 (c37) /* => 1 [Knopp, p. 233] */ closedform(sum(1/(sqrt(k*(k + 1)) * (sqrt(k) + sqrt(k + 1))), k, 1, inf)); Time= 610 msecs inf ==== \ 1 (d37) > ----------------------------------- / k (sqrt(k + 1) + sqrt(k)) + sqrt(k) ==== k = 1 (c38) /* => 1/sqrt([1 - x y]^2 - 4 x^2) (| x y | < 1 and -1 <= x < 1). From Evangelos A. Coutsias, Michael J. Wester and Alan S. Perelson, ``A Nucleation Theory of Cell Surface Capping'', draft. */ 'sum('sum(binomial(n, k)*binomial(n - k, n - 2*k)*x^n*y^(n - 2*k), k, 0, floor(n/2)), n, 0, inf); Time= 5020 msecs n floor(-) inf 2 ==== ==== \ n \ n - 2 k (d38) > x > binomial(n, k) binomial(n - k, n - 2 k) y / / ==== ==== n = 0 k = 0 (c39) /* An equivalent summation to the above is: */ 'sum('sum(n!/(k!^2*(n - 2*k)!)*(x/y)^k*(x*y)^(n - k), n, 2*k, inf), k, 0, inf); Time= 1270 msecs inf ==== n - k n - k k \ n! x y x > ---------------- inf / (n - 2 k)! ==== ==== \ n = 2 k (d39) > --------------------------- / 2 k ==== k! y k = 0 (c40) closedform(%); Time= 5540 msecs inf ==== n - k n - k k \ n! x y x > ---------------- inf / (n - 2 k)! ==== ==== \ n = 2 k (d40) > --------------------------- / 2 k ==== k! y k = 0 (c41) /* => pi/2 [Knopp, p. 269] */ 'sum('product(k/(2*k - 1), k, 1, m), m, 2, inf); Time= 560 msecs inf m ==== /===\ \ | | k (d41) > | | ------- / | | 2 k - 1 ==== k = 1 m = 2 (c42) closedform(%); Time= 960 msecs inf ==== \ m! (d42) sqrt(%pi) > ------------- / m 2 m - 1 ==== 2 (-------)! m = 2 2 (c43) /* ---------- Quit ---------- */ quit(); Bye. real 39.83 user 35.86 sys 1.81