1 /* Original version of this file copyright 1999 by Michael Wester,
2 * and retrieved from http://www.math.unm.edu/~wester/demos/SpecialFunctions/problems.macsyma
5 * Released under the terms of the GNU General Public License, version 2,
6 * per message dated 2007-06-03 from Michael Wester to Robert Dodier
7 * (contained in the file wester-gpl-permission-message.txt).
9 * See: "A Critique of the Mathematical Abilities of CA Systems"
10 * by Michael Wester, pp 25--60 in
11 * "Computer Algebra Systems: A Practical Guide", edited by Michael J. Wester
12 * and published by John Wiley and Sons, Chichester, United Kingdom, 1999.
14 /* ----------[ M a c s y m a ]---------- */
15 /* ---------- Initialization ---------- */
18 /* ---------- Special Functions ---------- */
19 /* Bernoulli numbers: B_16 => -3617/510 [Gradshteyn and Ryzhik 9.71] */
21 /* d/dk E(phi, k) => [E(phi, k) - F(phi, k)]/k where F(phi, k) and E(phi, k)
22 are elliptic integrals of the 1st and 2nd kind, respectively
23 [Gradshteyn and Ryzhik 8.123(3)] */
24 diff(elliptic_e(phi, k^2), k);
26 /* Jacobian elliptic functions: d/du dn u => -k^2 sn u cn u
27 [Gradshteyn and Ryzhik 8.158(3)] */
28 diff(jacobi_dn(u, k^2), u);
29 /* => -2 sqrt(pi) [Gradshteyn and Ryzhik 8.338(3)] */
31 /* psi(1/3) => - Euler's_constant - pi/2 sqrt(1/3) - 3/2 log 3 where psi(x)
32 is the psi function [= d/dx log Gamma(x)] [Gradshteyn and Ryzhik 8.366(6)]
35 /* Bessel function of the first kind of order 2 => 0.04158 + 0.24740 i */
36 sfloat(bessel_j[2](1 + %i));
37 /* => 12/pi^2 [Gradshteyn and Ryzhik 8.464(6)] */
38 bessel_j[-5/2](%pi/2);
39 /* => sqrt(2/(pi z)) (sin z/z - cos z) [Gradshteyn and Ryzhik 8.464(3)] */
41 /* d/dz J_0(z) => - J_1(z) [Gradshteyn and Ryzhik 8.473(4)] */
42 diff(bessel_j[0](z), z);
43 /* Associated Legendre (spherical) function of the 1st kind: P^mu_nu(0)
44 => 2^mu sqrt(pi) / [Gamma([nu - mu]/2 + 1) Gamma([- nu - mu + 1]/2)]
45 [Gradshteyn and Ryzhik 8.756(1)] */
46 declare(nu, integer, mu, integer)$
48 alegendre_p(nu, mu, 0);
50 remove(nu, integer, mu, integer)$
51 /* P^1_3(x) => -3/2 sqrt(1 - x^2) (5 x^2 - 1)
52 [Gradshteyn and Ryzhik 8.813(4)] */
54 /* nth Chebyshev polynomial of the 1st kind: T_n(x) => 0
55 [Gradshteyn and Ryzhik 8.941(1)] */
56 ratsimp(chebyshev_t(1008, x) - 2*x*chebyshev_t(1007, x) + chebyshev_t(1006, x));
57 /* T_n(-1) => (-1)^n [Gradshteyn and Ryzhik 8.944(2)] */
69 /* => arcsin z/z [Gradshteyn and Ryzhik 9.121(26)] */
70 hgfred([1/2, 1/2], [3/2], z^2);
71 /* => sin(n z)/(n sin z cos z) [Gradshteyn and Ryzhik 9.121(17)] */
72 q: hgfred([(n + 2)/2, -(n - 2)/2], [3/2], sin(z)^2);
74 ev(trigreduce(trigsimp(q)), triginverses:all);
77 /* zeta'(0) => - 1/2 log(2 pi) [Gradshteyn and Ryzhik 9.542(4)] */
78 subst(x = 0, diff(zeta(x), x));
80 /* Dirac delta distribution => 3 f(4/5) + g'(1) */
81 integrate(f((x + 2)/5)*delta((x - 2)/3) - g(x)*diff(delta(x - 1), x), x, 0, 3);
82 delint(f((x + 2)/5)*delta((x - 2)/3) - g(x)*diff(delta(x - 1), x), x, 0, 3);
84 /* Define an antisymmetric function f */
85 declare(f, antisymmetric)$
86 /* Test it out => [-f(a, b, c), 0] */
87 [f(c, b, a), f(c, b, c)];
88 remove(f, antisymmetric)$