SPECFN.TEX 29 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816
  1. \documentstyle[11pt,reduce]{article}
  2. \title{{\tt SPECFN}: Special Functions Package for REDUCE}
  3. \date{}
  4. \author{Chris Cannam\\[0.05in]
  5. Konrad--Zuse--Zentrum f\"ur Informationstechnik Berlin \\
  6. Heilbronner Strasse 10 \\
  7. D--10711 Berlin -- Wilmersdorf \\
  8. Federal Republic of Germany \\[0.05in]
  9. E--mail: neun@sc.zib--berlin.de \\[0.05in]
  10. Version 2.0, November 1994}
  11. \begin{document}
  12. \maketitle
  13. \index{SPECFN package}
  14. \section{Introduction}
  15. This package provides the 'common' special functions for REDUCE.
  16. The names of the operators and implementation details can be
  17. found in this document.
  18. Due to the enormous number of special functions
  19. a package for special functions is never complete.
  20. Several users pointed out that important classes
  21. of special functions were missing in the first version.
  22. These comments and other hints from a number of contributors
  23. and users were very helpful.
  24. The first version of this package was developed while the author
  25. worked as a student exchange grantee at ZIB Berlin in 1992/93.
  26. The package is maintained by ZIB Berlin after the author left the ZIB.
  27. Therefore, please direct comments, hints and bug reports etc. to
  28. {\tt neun@sc.ZIB-Berlin.de}.
  29. This package is designed to provide algebraic and numeric manipulations of
  30. several common special functions, namely:
  31. \begin{itemize}
  32. \item Bernoulli numbers and Euler numbers;
  33. \item Stirling numbers;
  34. \item Binomial Coefficients;
  35. \item Pochhammer notation;
  36. \item The Gamma function;
  37. \item The psi function and its derivatives;
  38. \item The Riemann Zeta function;
  39. \item The Bessel functions J and Y of the first and second kinds;
  40. \item The modified Bessel functions I and K;
  41. \item The Hankel functions H1 and H2;
  42. \item The Kummer hypergeometric functions M and U;
  43. \item The Beta function, and Struve, Lommel and Whittaker functions;
  44. \item The Airy funcions;
  45. \item The Exponential Integral, the Sine and Cosine Integrals;
  46. \item The Hyperbolic Sine and Cosine Integrals;
  47. \item The Fresnel Integrals and the Error function;
  48. \item The Dilog function;
  49. \item Hermite Polynomials;
  50. \item Jacobi Polynomials;
  51. \item Legendre Polynomials;
  52. \item Associated Legendre Functions (Spherical and Solid Harmonics)
  53. \item Laguerre Polynomials;
  54. \item Chebyshev Polynomials;
  55. \item Gegenbauer Polynomials;
  56. \item Euler Polynomials;
  57. \item Bernoulli Polynomials;
  58. \item (Jacobi's) Elliptic Functions;
  59. \item Elliptic Integrals;
  60. \item 3j and 6j symbols , Clebsch-Gordan coefficients;
  61. \item and some well-known constants.
  62. \end{itemize}
  63. All algorithms whose sources are uncredited are culled from series or
  64. expressions found in the Dover Handbook of Mathematical
  65. Functions\cite{Abramowitz:72}.
  66. There is a nice collection of plot calls for special functions
  67. in the file \$reduce/plot/specplot.tst.
  68. These examples will reproduce a number of well-known pictures from
  69. \cite{Abramowitz:72}.
  70. \section{Compatibility with earlier \REDUCE\ versions}
  71. For {PSL} versions,
  72. this package is intended to be used with the new \REDUCE\ bigfloat
  73. mechanisms which is distributed together with REDUCE 3.5 and later versions.
  74. The package does work with the earlier bigfloat implementations,
  75. but in order to
  76. ensure that it works efficiently with the new versions, it has not been
  77. optimized for the old.
  78. \section{Simplification and Approximation}
  79. All of the operators supported by this package have certain algebraic
  80. simplification rules to handle special cases, poles, derivatives and so
  81. on. Such rules are applied whenever they are appropriate. However, if
  82. the {\tt ROUNDED} switch is on, numeric evaluation is also carried out.
  83. Unless otherwise stated below, the result of an application of a special
  84. function operator to real or complex numeric arguments in rounded mode
  85. will be approximated numerically whenever it is possible to do so. All
  86. approximations are to the current precision.
  87. Most algebraic simplifications within the special function package
  88. are defined in the form of a \REDUCE\ ruleset. Therefore, in order to
  89. get a quick insight into the simplification rules one can use the
  90. ShowRules operator, e.g.\\
  91. \begin{verbatim}
  92. ShowRules BesselI;
  93. 1 ~z - ~z
  94. {besseli(~n,~z) => ---------------*(e - e )
  95. sqrt(pi*2*~z)
  96. 1
  97. when numberp(~n) and ~n=---,
  98. 2
  99. 1 ~z - ~z
  100. besseli(~n,~z) => ---------------*(e + e )
  101. sqrt(pi*2*~z)
  102. 1
  103. when numberp(~n) and ~n= - ---,
  104. 2
  105. besseli(~n,~z) => 0
  106. when numberp(~z) and ~z=0 and numberp(~n) and ~n neq 0,
  107. besseli(~n,~z) => besseli( - ~n,~z) when numberp(~n)
  108. and impart(~n)=0 and ~n=floor(~n) and ~n<0,
  109. besseli(~n,~z) => do*i(~n,~z)
  110. when numberp(~n) and numberp(~z) and *rounded,
  111. df(besseli(~n,~z),~z)
  112. besseli(~n - 1,~z) + besseli(~n + 1,~z)
  113. => -----------------------------------------,
  114. 2
  115. df(besseli(~n,~z),~z)
  116. => besseli(1,~z) when numberp(~n) and ~n=0}
  117. \end{verbatim}
  118. Several \REDUCE\ packages (such as Sum or Limits) obtain different
  119. (hopefully better)
  120. results for the algebraic simplifications when the SPECFN package
  121. is loaded, because the later package contains some information which
  122. may be useful and directly applicable for other packages, e.g.:
  123. \begin{verbatim}
  124. sum(1/k^s,k,1,infinity); % will be evaluated to
  125. zeta(s)
  126. \end{verbatim}
  127. \ttindex{savesfs}
  128. A record is kept of all values previously approximated, so that should a
  129. value be required which has already been computed to the current
  130. precision or greater, it can be simply looked up. This can result in
  131. some storage overheads, particularly if many values are computed which
  132. will not be needed again. In this case, the switch {\tt savesfs} may be
  133. turned off in order to inhibit the storage of approximated values. The
  134. switch is on by default.
  135. \section{Constants}
  136. \ttindex{Euler\_Gamma}\ttindex{Khinchin}\ttindex{Golden\_Ratio}
  137. \ttindex{Catalan}
  138. Some well-known constants are defined in the special function package.
  139. Important properties of these constants which can be used to define them
  140. are also known. Numerical values are computed at arbitrary precision
  141. if the switch ROUNDED is on.
  142. \begin{itemize}
  143. \item Euler\_Gamma : Euler's constants, also available as -$\psi(1)$;
  144. \item Catalan : Catalan's constant;
  145. \item Khinchin : Khinchin's constant , defined in \cite{Khinchin:64}.
  146. (takes a lot of time to compute);
  147. \item Golden\_Ratio : $\frac{1 + \sqrt{5}}{2}$
  148. \end{itemize}
  149. \section{Bernoulli Numbers and Euler Numbers}
  150. \ttindex{Bernoulli}\index{Bernoulli numbers}
  151. \ttindex{Euler}\index{Euler numbers}
  152. The unary operator {\tt Bernoulli} provides notation and computation for
  153. Bernoulli numbers. {\tt Bernoulli(n)} evaluates to the $n$th Bernoulli
  154. number; all of the odd Bernoulli numbers, except {\tt Bernoulli(1)}, are
  155. zero.
  156. The algorithms are based upon those by Herbert Wilf, presented by Sandra
  157. Fillebrown \cite{Fillebrown:92}. If the {\tt ROUNDED} switch is off,
  158. the algorithms are exactly those; if it is on, some further rounding may
  159. be done to prevent computation of redundant digits. Hence, these
  160. functions are particularly fast when used to approximate the Bernoulli
  161. numbers in rounded mode.
  162. Euler numbers are computed by the unary operator Euler, which
  163. return the nth Euler number. The computation is derived
  164. directly from Pascal's triangle of binomial coefficients.
  165. \section{Stirling Numbers}
  166. \index{Stirling Numbers}\ttindex{Stirling1}\ttindex{Stirling2}
  167. Stirling numbers of the first and second kind are computed
  168. by the binary operators {\tt Stirling1} and {\tt Stirling2}
  169. using explicit formulae.
  170. \section{The $\Gamma$ Function, and Related Functions}
  171. \ttindex{Gamma}\index{$\Gamma$ function}\index{Gamma function}
  172. \subsection{The $\Gamma$ Function}
  173. This is represented by the unary operator {\tt Gamma}.
  174. Initial transformations applied with {\tt ROUNDED} off are: $\Gamma(n)$ for
  175. integral $n$ is computed, $\Gamma(n+1/2)$ for integral $n$ is rewritten to
  176. an expression in $\sqrt\pi$, $\Gamma(n+1/m)$ for natural $n$ and $m$ a
  177. positive integral power of 2 less than or equal to 64 is rewritten to an
  178. expression in $\Gamma(1/m)$, expressions with arguments at which there is a
  179. pole are replaced by {\tt INFINITY}, and those with a negative (real)
  180. argument are rewritten so as to have positive arguments.
  181. The algorithm used for numerical approximation is an implementation of an
  182. asymptotic series for $ln(\Gamma)$, with a scaling factor obtained from
  183. the Pochhammer functions.
  184. An expression for $\Gamma'(z)$ in terms of $\Gamma$ and $\psi$ is
  185. included.
  186. \subsection{The Pochhammer Notation}
  187. \ttindex{Pochhammer}\index{Pochhammer notation}
  188. The Pochhammer notation $(a)_k$ is supported by the binary operator {\tt
  189. Pochhammer}. With {\tt ROUNDED} off, this expression is evaluated
  190. numerically if $a$ and $k$ are both integral, and otherwise may be
  191. simplified where appropriate. The simplification rules are based upon
  192. algorithms supplied by Wolfram Koepf \cite{Koepf:92}.
  193. \subsection{The Digamma Function, $\psi$}
  194. \ttindex{PSI}\index{$\psi$ function}\index{psi function}\index{Digamma
  195. function}
  196. This is represented by the unary operator {\tt PSI}.
  197. Initial transformations for $\psi$ are applied on a similar basis to
  198. those for $\Gamma$; where possible, $\psi(x)$ is rewritten in
  199. terms of $\psi(1)$ and $\psi(\frac{1}{2})$, and expressions with negative
  200. arguments are rewritten to have positive ones.
  201. Numerical evaluation of $\psi$ is only carried out if the argument is
  202. real. The algorithm used is based upon an asymptotic series, with a
  203. suitable scaler.
  204. Relations for the derivative and integral of $\psi$ are included.
  205. \subsection{The Polygamma Functions, $\psi^{(n)}$}
  206. \ttindex{Polygamma}\index{$\psi^{(n)}$ functions}\index{Polygamma
  207. functions}
  208. The $n$th derivative of the $\psi$ function is represented by the
  209. binary operator {\tt Polygamma}, whose first argument is $n$.
  210. Initial manipulations on $\psi^{(n)}$ are few; where the second argument
  211. is $1$ or $3/2$, the expression is rewritten to one involving the
  212. Riemann $\zeta$ function, and when the first is zero it is rewritten to
  213. $\psi$; poles are also handled.
  214. Numerical evaluation is only carried out with real arguments. The
  215. algorithm used is again an asymptotic series with a scaling factor; for
  216. negative (second) arguments, a Reflection Formula is used, introducing a
  217. term in the $n$th derivative of $\cot(z\pi)$.
  218. Simple relations for derivatives and integrals are provided.
  219. \subsection{The Riemann $\zeta$ Function}
  220. \ttindex{Zeta}\index{Riemann Zeta function}\index{Zeta
  221. function}\index{$\zeta$ function}
  222. This is represented by the unary operator {\tt Zeta}.
  223. With {\tt ROUNDED} off, $\zeta(z)$ is evaluated numerically for even
  224. integral arguments in the range $-31 < z < 31$, and for odd integral
  225. arguments in the range $-30 < z < 16$. Outside this range the values
  226. become a little unwieldy.
  227. Numerical evaluation of $\zeta$ is only carried out if the argument is real.
  228. The algorithms used for $\zeta$ are: for odd integral arguments, an
  229. expression relating $\zeta(n)$ with $\psi^{n-1}(3)$; for even arguments, a
  230. trivial relationship with the Bernoulli numbers; and for other arguments the
  231. approach is either (for larger arguments) to take the first few primes in
  232. the standard over-all-primes expansion, and then continue with the defining
  233. series with natural numbers not divisible by these primes, or (for smaller
  234. arguments) to use a fast-converging series obtained from \cite{Bender:78}.
  235. There are no rules for differentiation or integration of $\zeta$.
  236. \section{Bessel Functions}
  237. \ttindex{BesselJ}\ttindex{BesselY}\ttindex{BesselI}\ttindex{BesselK}\ttindex{Hankel1}\ttindex{Hankel2}\index{Bessel
  238. functions}\index{Hankel functions}
  239. Support is provided for the Bessel functions J and Y, the modified
  240. Bessel functions I and K, and the Hankel functions of the first and
  241. second kinds. The relevant operators are, respectively, {\tt BesselJ},
  242. {\tt BesselY}, {\tt BesselI}, {\tt BesselK}, {\tt Hankel1} and {\tt
  243. Hankel2}, which are all binary operators.
  244. The following initial transformations are performed:
  245. \begin{itemize}
  246. \item trivial cases or poles of J, Y, I and K are handled;
  247. \item J, Y, I and K with negative first argument are transformed to have
  248. positive first argument;
  249. \item J with negative second argument is transformed for positive second
  250. argument;
  251. \item Y or K with non-integral or complex second argument is transformed
  252. into an expression in J or I respectively;
  253. \item derivatives of J, Y and I are carried out;
  254. \item derivatives of K with zero first argument are carried out;
  255. \item derivatives of Hankel functions are carried out.
  256. \end{itemize}
  257. Also, if the {\tt COMPLEX} switch is on and {\tt ROUNDED} is off,
  258. expressions in Hankel functions are rewritten in terms of Bessels.
  259. No numerical approximation is provided for the Bessel K function, or for
  260. the Hankel functions for anything other than special cases. The
  261. algorithms used for the other Bessels are generally implementations of
  262. standard ascending series for J, Y and I, together with asymptotic
  263. series for J and Y; usually, the asymptotic series are tried first, and
  264. if the argument is too small for them to attain the current precision,
  265. the standard series are applied. An obvious optimization prevents an
  266. attempt with the asymptotic series if it is clear from the outset that
  267. it will fail.
  268. There are no rules for the integration of Bessel and Hankel functions.
  269. \section{Hypergeometric and Other Functions}
  270. \ttindex{Beta}\ttindex{KummerM}\ttindex{KummerU}\ttindex{StruveH}
  271. \ttindex{StruveL}\ttindex{Lommel1}\ttindex{Lommel2}\ttindex{WhittakerM}
  272. \ttindex{WhittakerW}\index{Beta function}\index{$B$ function}
  273. \index{Kummer functions}\index{Struve functions}\index{Lommel functions}
  274. \index{Whittaker functions}\index{Hypergeometric functions}
  275. This package also provides some support for other functions, in the form
  276. of algebraic simplifications:
  277. \begin{itemize}
  278. \item The Beta function, a variation upon the $\Gamma$
  279. function\cite{Abramowitz:72}, with the binary operator {\tt Beta};
  280. \item The Struve {\bf H} and {\bf L} functions, through the binary
  281. operators {\tt StruveH} and {\tt StruveL}, for which manipulations are
  282. provided to handle special cases, simplify to more readily handled
  283. functions where appropriate, and differentiate with respect to the second
  284. argument;
  285. \item The Lommel functions of the first and second kinds, through the
  286. ternary operators {\tt Lommel1} and {\tt Lommel2}, for which manipulations
  287. are provided to handle special cases and simplify where appropriate;
  288. \item The Kummer confluent hypergeometric functions M and U (the
  289. hypergeometric ${_1F_1}$ or $\Phi$, and $z^{-a}{_2F_0}$ or $\Psi$,
  290. respectively),
  291. with the ternary operators {\tt KummerM} and {\tt KummerU}, for which
  292. there are manipulations for special cases and simplifications, derivatives
  293. and, for the M function, numerical approximations for real arguments;
  294. \item The Whittaker M and W functions, variations upon the Kummer
  295. functions, which, with the ternary operators {\tt WhittakerM} and {\tt
  296. WhittakerW}, simplify to expressions in the Kummer functions.
  297. \end{itemize}
  298. \section{Integral Functions}
  299. The SPECFN package includes manipulation and a limited numerical
  300. evaluation for some Integral functions, namely
  301. erf, erfc, Si, Shi, si, Ci, Chi, Ei, Fresnel\_C and Fresnel\_S.
  302. The definitions from integral, the derviatives and some limits are
  303. known together with some simple properties such as symmetry
  304. conditions.
  305. The numerical approximation for the Integral functions suffer
  306. from the fact that the precision is not set correctly for
  307. values of the argument above 10.0 (approx.) and from the
  308. usage of summations even for large arguments.
  309. \section{Airy Functions}
  310. \ttindex{Airy\_Ai}\ttindex{Airy\_Bi}\ttindex{Airy\_Aiprime}
  311. \ttindex{Airy\_Biprime}\index{Airy Functions}
  312. Support is provided for the Airy Functions Ai and Bi and for the
  313. Airyprime Functions Aiprime and Biprime. The relevant operators are
  314. respectively {\tt Airy\_Ai}, {\tt Airy\_Bi}, {\tt Airy\_Aiprime}, and
  315. {\tt Airy\_Biprime}, which are all unary operators with one argument.
  316. The following cases can be performed:
  317. \begin{itemize}
  318. \item Trivial cases of Airy\_Ai and Airy\_Bi and their primes are handled.
  319. \item All cases can handle both complex and real arguments.
  320. \item The Airy Functions can also be represented in terms of Bessel
  321. Functions by activating an inactive rule set.
  322. \end{itemize}
  323. In order to activate the Airy Function to Bessel Rules one should type: \\
  324. {\tt let Airy2Bessel\_rules;}. As a result the Airy\_Ai function,
  325. for example will be calculated using the formula :- \\
  326. \\
  327. {\tt Ai(z) = } $\frac{1}{3}$\( \sqrt{z} \)[{\bf {\sl I}}$_{-1/3}$($\zeta$)
  328. - {\bf {\sl I}}$_{1/3}$({$\zeta$})] , where
  329. $\zeta$ = $\frac{2}{3} z^{\frac{2}{3}}$\\
  330. \\
  331. \underline{{\tt Note}}:- In order to obtain satisfactory approximations
  332. to results both the {\tt COMPLEX} and {\tt ROUNDED} switches must be on.
  333. The algorithms used for the Airy Functions are implementations of
  334. standard ascending series, together with asymptotic series. At some
  335. point it is better to use the asymptotic approach, rather than the
  336. series. This value is calculated by the program and depends on the given
  337. precision.
  338. There are no rules for the integration of Airy Functions.
  339. \section{Polynomial Functions}
  340. Two groups are defined, some well-known orthogonal Polynomials
  341. (Hermite, Jacobi, Legendre, Laguerre, Chebyshev, Gegenbauer)
  342. and Euler and Bernoulli Polynomials.
  343. The names of the \REDUCE\ operator are build by adding a P
  344. to the name
  345. of the polynomials, e.g. EulerP implements the Euler polynomials.
  346. Most definitions are equivalent to \cite{Abramowitz:72}, except
  347. for the ternary (associated) Legendre Polynomials.
  348. \begin{verbatim}
  349. P(n,m,x) = (-1)^m *(1-x^2)^(m/2)*df(legendreP (n,x),x,m)
  350. \end{verbatim}
  351. \section{Spherical and Solid Harmonics}
  352. \ttindex{SolidHarmonicY} \ttindex{SphericalHarmonicY}
  353. The relevant operators are, respectively,\\
  354. {\tt SolidHarmonicY} and {\tt SphericalHarmonicY}.
  355. The SolidHarmonicY operator implements the Solid Harmonics
  356. described below. It expects 6 parameter, namely n,m,x,y,z and r2
  357. and returns a polynomial in x,y,z and r2.
  358. The operator
  359. SphericalHarmonicY is a special case of SolidHarmonicY
  360. with the usual definition:
  361. \begin{verbatim}
  362. algebraic procedure SphericalHarmonicY(n,m,theta,phi);
  363. SolidHarmonicY(n,m,sin(theta)*cos(phi),
  364. sin(theta)*sin(phi),cos(theta),1)$
  365. \end{verbatim}
  366. Solid Harmonics of order n (Laplace polynomials)
  367. are homogeneous polynomials of degree n in x,y,z
  368. which are solutions of Laplace equation:-
  369. \begin{verbatim}
  370. df(P,x,2) + df(P,y,2) + df(P,z,2) = 0.
  371. \end{verbatim}
  372. There are 2*n+1 independent such polynomials for any given $n >=0$
  373. and with:-
  374. \begin{verbatim}
  375. w!0 = z, w!+ = i*(x-i*y)/2, w!- = i*(x+i*y)/2,
  376. \end{verbatim}
  377. they are given by the Fourier integral:-
  378. \begin{verbatim}
  379. S(n,m,w!-,w!0,w!+) =
  380. (1/(2*pi)) *
  381. for u:=-pi:pi integrate (w!0 + w!+ * exp(i*u) + w!- *
  382. exp(-i*u))^n * exp(i*m*u) * du;
  383. \end{verbatim}
  384. which is obviously zero if $|m| > n$ since then all terms in the
  385. expanded integrand contain the factor exp(i*k*u) with k neq 0,
  386. S(n,m,x,y,z) is proportional to
  387. \begin{verbatim}
  388. r^n * Legendre(n,m,cos theta) * exp(i*phi)
  389. \end{verbatim}
  390. Let r2 = $x^2 + y^2 + z^2$ and r = sqrt(r2).
  391. The spherical harmonics are simply the restriction of the solid
  392. harmonics to the surface of the unit sphere and the set of all
  393. spherical harmonics {$n >=0; -n <= m =< n$} form a complete orthogonal
  394. basis on it, i.e. $<n,m|n',m'>$ = Kronecker\_delta(n,n') *
  395. Kronecker\_delta(m,m') using
  396. $<...|...>$ to designate the scalar product
  397. of functions over the spherical surface.
  398. The coefficients of the solid harmonics are normalised in what
  399. follows to yield an ortho-normal system of spherical harmonics.
  400. Given their polynomial nature, there are many recursions formulae
  401. for the solid harmonics and any recursion valid for Legendre functions
  402. can be 'translated' into solid harmonics. However the direct proof is
  403. usually far simpler using Laplace's definition.
  404. It is also clear that all differentiations of solid harmonics are
  405. trivial, qua polynomials.
  406. Some substantial reduction in the symbolic form would occur if one
  407. maintained throughout the recursions the symbol r2 (r cannot occur
  408. as it is not rational in x,y,z). Formally the solid harmonics appear
  409. in this guise as more compact polynomials in (x,y,z,r2).
  410. Only two recursions are needed:-
  411. (i) along the diagonal (n,n);
  412. (ii) along a line of constant n: (m,m),(m+1,m),...,(n,m).
  413. Numerically these recursions are stable.
  414. For $m < 0$ one has:-
  415. \begin{verbatim}
  416. S(n,m,x,y,z) = (-1)^m * S(n,-m,x,-y,z);
  417. \end{verbatim}
  418. \section{Jacobi's Elliptic Functions}
  419. The following functions have been implemented:
  420. \begin{itemize}
  421. \item The Twelve Jacobi Functions
  422. \item Arithmetic Geometric Mean
  423. \item Descending Landen Transformation
  424. \end{itemize}
  425. \subsection{Jacobi Functions}
  426. The following Jacobi functions are available:-
  427. \begin{itemize}
  428. \item Jacobisn(u,m)
  429. \item Jacobidn(u,m)
  430. \item Jacobicn(u,m)
  431. \item Jacobicd(u,m)
  432. \item Jacobisd(u,m)
  433. \item Jacobind(u,m)
  434. \item Jacobidc(u,m)
  435. \item Jacobinc(u,m)
  436. \item Jacobisc(u,m)
  437. \item Jacobins(u,m)
  438. \item Jacobids(u,m)
  439. \item Jacobics(u,m)
  440. \end{itemize}
  441. They will be evaluated numerically if the {\tt rounded} switch is used.
  442. \subsection{Amplitude}
  443. The amplitude of u can be evaluated using the
  444. {\tt JacobiAmplitude(u,m)} command.
  445. \subsection{Arithmetic Geometric Mean}
  446. A procedure to evaluate the AGM of initial values \(a_0,b_0,c_0\)
  447. exists as \\
  448. {\tt AGM\_function(\(a_0,b_0,c_0\))} and will return \\
  449. $\{ N, AGM, \{ a_N, \ldots ,a_0\}, \{ b_N, \ldots ,b_0\},
  450. \{c_N, \ldots ,c_0\}\}$,
  451. where N is the number of steps to compute the AGM to the
  452. desired acuracy. \\
  453. To determine the Elliptic Integrals K($m$), E($m$) we use initial values
  454. \(a_0 = 1\); \(b_0 = \sqrt{1-m}\) ; \(c_0 = \sqrt{m}\).
  455. \subsection{Descending Landen Transformation}
  456. The procedure to evaluate the Descending Landen Transformation of
  457. phi and alpha uses the following equations:\\
  458. \indent \ \ \ \ \( (1+sin \alpha_{n+1})(1+cos \alpha_n)=2 \)
  459. \ \ \ \ where \(\alpha_{n+1}<\alpha_n\) \\
  460. \indent \ \ \ \ \(tan(\phi_{n+1}-\phi_n)=cos \alpha_n tan \phi_n \)
  461. \ \ \ where \(\phi_{n+1}>\phi_n\) \\
  462. It can be called using {\tt landentrans($\phi_0$,$\alpha_0$)}
  463. and will return \\
  464. $\{\{\phi_0, \ldots ,\phi_n\},\{\alpha_0, \ldots ,\alpha_n\}\}$.
  465. \section{Elliptic Integrals}
  466. The following functions have been implemented:
  467. \begin{itemize}
  468. \item Elliptic Integrals of the First Kind
  469. \item Elliptic Integrals of the Second Kind
  470. %\item Ellpitic Integrals of the Third Kind
  471. \item Jacobi $\theta$ Functions
  472. \item Jacobi $\zeta$ Function
  473. \end{itemize}
  474. \subsection{Elliptic F}
  475. The Elliptic F function can be used as {\tt EllipticF($\phi$,m)} and
  476. will return the value of the {\underline {Elliptic Integral of the
  477. First Kind}}.
  478. \subsection{Elliptic K}
  479. The Elliptic K function can be used as {\tt EllipticK(m)} and will
  480. return the value of the {\underline {Complete Elliptic Integral of the
  481. First Kind}}, K. It is often used in the calculation of other elliptic
  482. functions
  483. \subsection{Elliptic K$'$}
  484. The Elliptic K$'$ function can be used as {\tt EllipticK!$'$(m)} and will
  485. return the value K($1-m$).
  486. \subsection{Elliptic E}
  487. The Elliptic E function comes with two different numbers of arguments:
  488. It can be used with two arguments as {\tt EllipticE($\phi$,m)}
  489. and will return the value
  490. of the {\underline {Elliptic Integral of the Second Kind}}.
  491. The Elliptic E function can also be used as {\tt EllipticE(m)} and
  492. will return the value of the {\underline {Complete Elliptic Integral
  493. of the Second Kind}}, E.
  494. %\section{Ellpitic $\Pi$}
  495. %
  496. %The Elliptic $\pi$ function can be used as {\tt EllipticPi( )} and
  497. %will return the value of the {\underline {Elliptic Integral of the
  498. %Third Kind}}.
  499. %
  500. \subsection{Elliptic $\Theta$ Functions}
  501. This can be used as {\tt EllipticTheta(a,u,m)}, where $a$ is the index
  502. for the theta functions ($a = 1,2,3$ or $4$) and will return $H$;
  503. $H_1$; $\Theta_1$; $\Theta$. (Also denoted in some texts as
  504. $\vartheta_1$; $\vartheta_2$; $\vartheta_3$; $\vartheta_4$.)
  505. \subsection{Jacobi's Zeta Function Z }
  506. This can be used as {\tt JacobiZeta(u,m)} and will return
  507. Jacobi Zeta. Note: the operator {\tt Zeta} will invoke Riemann's
  508. $\zeta$ function.
  509. \section{Lambert's W function}
  510. Lambert's W function is the inverse of the function $w*e^w$.
  511. Therefore it is an important contribution for the solve package.
  512. The function is studied extensively in \cite{Corless:92}.
  513. The current implementation will compute the principal branch in
  514. ROUNDED mode only.
  515. \section{3j symbols and Clebsch-Gordan Coefficients}
  516. The operators {\tt ThreeJSymbol}, {\tt Clebsch\_Gordan} are defined like
  517. in \cite{Landolt:68} or \cite{Edmonds:57}. ThreeJSymbol expects as arguments
  518. three lists of values \{$j_i,m_i$\}, e.g.
  519. \begin{verbatim}
  520. ThreeJSymbol({J+1,M},{J,-M},{1,0});
  521. Clebsch_Gordan({2,0},{2,0},{2,0});
  522. \end{verbatim}
  523. \section{6j symbols }
  524. The operator {\tt SixJSymbol} is defined like
  525. in \cite{Landolt:68} or \cite{Edmonds:57}.
  526. SixJSymbol expects two lists of values \{$j_1,j_2,j_3$\} and
  527. \{$l_1,l_2,l_3$\} as arguments, e.g.
  528. \begin{verbatim}
  529. SixJSymbol({7,6,3},{2,4,6});
  530. \end{verbatim}
  531. In the current implementation of the SixJSymbol, there is only a limited
  532. reasoning about the minima and maxima of the summation using
  533. the INEQ package, such that in most
  534. cases the special 6j-symbols (see e.g. \cite{Landolt:68})
  535. will not be found.
  536. \section{Acknowledgements}
  537. The contributions of Kerry Gaskell, Matthew Rebbeck, Lisa Temme
  538. and Stephen Scowcroft (all students from the University of Bath
  539. on placement in ZIB Berlin for one year) were very helpful
  540. to augment the package. The advise of Ren\'e Grognard (CSIRO , Australia)
  541. for the development of the module for Clebsch-Gordan and 3j, 6j symbols
  542. and the module for spherical and solid harmonics was very much appreciated.
  543. \section{Table of Operators}
  544. \fbox{
  545. \begin{tabular}{r l}\\
  546. Function & Operator \\\\
  547. %\hline
  548. $\left( { n \atop m } \right)$ & {\tt Binomial(n,m)} \\
  549. Bernoulli($n$) or $ B_n $ & {\tt Bernoulli(n)} \\
  550. Euler($n$) or $ E_n $ & {\tt Euler(n)} \\
  551. $S_n^{(m)}$ & {\tt Stirling1(n,m)} \\
  552. ${\bf S}_n^{(m)}$ & {\tt Stirling2(n,m)} \\
  553. $\Gamma(z)$ & {\tt Gamma(z)} \\
  554. $(a)_k$ & {\tt Pochhammer(a,k)} \\
  555. $\psi(z)$ & {\tt Psi(z)} \\
  556. $\psi^{(n)}(z)$ & {\tt Polygamma(n,z)} \\
  557. $Riemann's \zeta(z)$ & {\tt Zeta(z)} \\
  558. $J_\nu(z)$ & {\tt BesselJ(nu,z)}\\
  559. $Y_\nu(z)$ & {\tt BesselY(nu,z)}\\
  560. $I_\nu(z)$ & {\tt BesselI(nu,z)}\\
  561. $K_\nu(z)$ & {\tt BesselK(nu,z)}\\
  562. $H^{(1)}_\nu(z)$ & {\tt Hankel1(n,z)}\\
  563. $H^{(2)}_\nu(z)$ & {\tt Hankel2(n,z)}\\
  564. $B(z,w)$ & {\tt Beta(z,w)}\\
  565. ${\bf H}_{\nu}(z)$ & {\tt StruveH(nu,z)}\\
  566. ${\bf L}_{\nu}(z)$ & {\tt StruveL(n,z)}\\
  567. $s_{a,b}(z)$ & {\tt Lommel1(a,b,z)}\\
  568. $S_{a,b}(z)$ & {\tt Lommel2(a,b,z)}\\
  569. $Ai(z)$ & {\tt Airy\_Ai(z)}\\
  570. $Bi(z)$ & {\tt Airy\_Bi(z)}\\
  571. $Ai'(z)$ & {\tt Airy\_Aiprime(z)}\\
  572. $Bi'(z)$ & {\tt Airy\_Biprime(z)}\\
  573. $M(a, b, z)$ or $_1F_1(a, b; z)$ or $\Phi(a, b; z)$ &
  574. {\tt KummerM(a,b,z)} \\
  575. $U(a, b, z)$ or $z^{-a}{_2F_0(a, b; z)}$ or $\Psi(a, b; z)$ &
  576. {\tt KummerU(a,b,z)}\\
  577. $M_{\kappa,\mu}(z)$ & {\tt WhittakerM(kappa,mu,z)}\\
  578. $W_{\kappa,\mu}(z)$ & {\tt WhittakerW(kappa,mu,z)}\\
  579. $B_n(x)$ & {\tt BernoulliP(n,x)}\\
  580. $E_n(x)$ & {\tt EulerP(n,x)}\\
  581. $C_n^{(\alpha)}(x)$ & {\tt GegenbauerP(n,alpha,x)}\\
  582. $H_n(x)$ & {\tt HermiteP(n,x)}\\
  583. $L_n(x)$ & {\tt LaguerreP(n,x)}\\
  584. $L_n^{(m)}(x)$ & {\tt LaguerreP(n,m,x)}\\
  585. $P_n(x)$ & {\tt LegendreP(n,x)}\\
  586. $P_n^{(m)}(x)$ & {\tt LegendreP(n,m,x)}\\
  587. \end{tabular}}
  588. \fbox{
  589. \begin{tabular}{r l}\\
  590. Function & Operator \\\\
  591. %\hline
  592. $P_n^{(\alpha,\beta)} (x)$ & {\tt JacobiP(n,alpha,beta,x)}\\
  593. $U_n(x)$ & {\tt ChebyshevU(n,x)}\\
  594. $T_n(x)$ & {\tt ChebyshevT(n,x)}\\
  595. $Y_n^{m}(x,y,z,r2)$ & {\tt SolidHarmonicY(n,m,x,y,z,r2)}\\
  596. $Y_n^{m}(\theta,\phi)$ & {\tt SphericalHarmonicY(n,m,theta,phi)}\\
  597. $\left( {j_1 \atop m_1} {j_2 \atop m_2}
  598. {j_3 \atop m_3} \right)$ & {\tt ThreeJSymbol(\{j1,m1\},\{j2,m2\},\{j3,m3\})}\\
  599. $\left( {j_1m_1j_2m_2 | j_1j_2j_3 - m_3} \right)$ &
  600. {\tt Clebsch\_Gordan(\{j1,m1\},\{j2,m2\},\{j3,m3\})}\\
  601. $\left\{ {j_1 \atop l_1} {j_2 \atop l_2}
  602. {j_3 \atop l_3} \right\}$ & {\tt SixJSymbol(\{j1,j2,j3\},\{l1,l2,l3\})}\\
  603. \\
  604. $Si(z)$ & {\tt Si(z) }\\
  605. $si(z)$ & {\tt s\_i(z) }\\
  606. $Ci(z)$ & {\tt Ci(z) }\\
  607. $Shi(z)$ & {\tt Shi(z) }\\
  608. $Chi(z)$ & {\tt Chi(z) }\\
  609. $erf(z)$ & {\tt erf(z) }\\
  610. $erfc(z)$ & {\tt erfc(z) }\\
  611. $Ei(z)$ & {\tt Ei(z) }\\
  612. $dilog(z)$ & {\tt dilog(z)} \\
  613. $C(x)$ & {\tt Fresnel\_C(x)} \\
  614. $S(x)$ & {\tt Fresnel\_S(x)} \\
  615. \\
  616. $sn(u|m)$ & {\tt Jacobisn(u,m)}\\
  617. $dn(u|m)$ & {\tt Jacobidn(u,m)}\\
  618. $cn(u|m)$ & {\tt Jacobicn(u,m)}\\
  619. $cd(u|m)$ & {\tt Jacobicd(u,m)}\\
  620. $sd(u|m)$ & {\tt Jacobisd(u,m)}\\
  621. $nd(u|m)$ & {\tt Jacobind(u,m)}\\
  622. $dc(u|m)$ & {\tt Jacobidc(u,m)}\\
  623. $nc(u|m)$ & {\tt Jacobinc(u,m)}\\
  624. $sc(u|m)$ & {\tt Jacobisc(u,m)}\\
  625. $ns(u|m)$ & {\tt Jacobins(u,m)}\\
  626. $ds(u|m)$ & {\tt Jacobids(u,m)}\\
  627. $cs(u|m)$ & {\tt Jacobics(u,m)}\\
  628. $F(\phi|m)$ & {\tt EllipticF(phi,m)}\\
  629. $K(m)$ & {\tt EllipticK(m)}\\
  630. $E(\phi|m) or E(m)$ & {\tt EllipticE(phi,m) or EllipticE(m)}\\
  631. $H(u|m), H_1(u|m), \Theta_1(u|m), \Theta(u|m)$ & {\tt EllipticTheta(a,u,m)}\\
  632. $\theta_1(u|m), \theta_2(u|m), \theta_3(u|m), \theta_4(u|m)$
  633. & {\tt EllipticTheta(a,u,m)}\\
  634. $Z(u|m)$ & {\tt Zeta\_function(u,m)}
  635. \end{tabular}}
  636. \bibliography{specfn}
  637. \bibliographystyle{plain}
  638. \end{document}