Merge branch 'rtoy-wrap-option-args'
[maxima.git] / doc / info / Elliptic.texi.m4
blobd9a1c18873e9348456418bc88d3f50ce4d66cb3f
1 @c -*- mode: texinfo -*-
3 @menu
4 * Introduction to Elliptic Functions and Integrals::
5 * Functions and Variables for Elliptic Functions::
6 * Functions and Variables for Elliptic Integrals::
7 @end menu
11 @node Introduction to Elliptic Functions and Integrals, Functions and Variables for Elliptic Functions, , Elliptic Functions
12 @comment  node-name,  next,  previous,  up
13 @section Introduction to Elliptic Functions and Integrals
15 Maxima includes support for Jacobian elliptic functions and for
16 complete and incomplete elliptic integrals.  This includes symbolic
17 manipulation of these functions and numerical evaluation as well.
18 Definitions of these functions and many of their properties can by
19 found in Abramowitz and Stegun, @urlaands{Chapter 16, 567} and
20 @urlaands{Chapter 17., 587}  See also @urldlmf{22.2}.  As much as possible,
21 we use the definitions and relationships given in Abramowitz and Stegun.
23 In particular, all elliptic functions and integrals use the parameter
24 @math{m} instead of the modulus @math{k} or the modular angle
25 @math{\alpha}.  The following relationships are true:
27 m4_displaymath(
28 <<<\eqalign{
29 m &= k^2 \cr
30 k &= \sin\alpha
31 }>>>
33 <<<@math{m = k^2}
35 @math{k = sin(alpha)}>>>
38 Note that Abramowitz and Stegun uses the notation 
39 m4_math(<<<{\rm
40 sn}(u|m)>>>, <<<sn(u|m)>>>) 
41 where we use 
42 m4_math(<<<{\rm
43 sn}(u,m)>>>, <<<sn(u,m)>>>) 
44 instead.  The DLMF uses modulus @math{k}
45 instead of the parameter @math{m}.
47 The elliptic functions and integrals are primarily intended to support
48 symbolic computation.  Therefore, most of derivatives of the functions
49 and integrals are known.  However, if floating-point values are given,
50 a floating-point result is returned.
52 Support for most of the other properties of elliptic functions and
53 integrals other than derivatives has not yet been written.
55 Some examples of elliptic functions:
56 @c ===beg===
57 @c jacobi_sn (u, m);
58 @c jacobi_sn (u, 1);
59 @c jacobi_sn (u, 0);
60 @c diff (jacobi_sn (u, m), u);
61 @c diff (jacobi_sn (u, m), m);
62 @c ===end===
63 @example
64 @group
65 (%i1) jacobi_sn (u, m);
66 (%o1)                    jacobi_sn(u, m)
67 @end group
68 @group
69 (%i2) jacobi_sn (u, 1);
70 (%o2)                        tanh(u)
71 @end group
72 @group
73 (%i3) jacobi_sn (u, 0);
74 (%o3)                        sin(u)
75 @end group
76 @group
77 (%i4) diff (jacobi_sn (u, m), u);
78 (%o4)            jacobi_cn(u, m) jacobi_dn(u, m)
79 @end group
80 @group
81 (%i5) diff (jacobi_sn (u, m), m);
82 (%o5) (jacobi_cn(u, m) jacobi_dn(u, m)
83       elliptic_e(asin(jacobi_sn(u, m)), m)
84  (u - ------------------------------------))/(2 m)
85                      1 - m
86             2
87    jacobi_cn (u, m) jacobi_sn(u, m)
88  + --------------------------------
89               2 (1 - m)
90 @end group
91 @end example
93 Some examples of elliptic integrals:
94 @c ===beg===
95 @c elliptic_f (phi, m);
96 @c elliptic_f (phi, 0);
97 @c elliptic_f (phi, 1);
98 @c elliptic_e (phi, 1);
99 @c elliptic_e (phi, 0);
100 @c elliptic_kc (1/2);
101 @c makegamma (%);
102 @c diff (elliptic_f (phi, m), phi);
103 @c diff (elliptic_f (phi, m), m);
104 @c ===end===
105 @example
106 @group
107 (%i1) elliptic_f (phi, m);
108 (%o1)                  elliptic_f(phi, m)
109 @end group
110 @group
111 (%i2) elliptic_f (phi, 0);
112 (%o2)                          phi
113 @end group
114 @group
115 (%i3) elliptic_f (phi, 1);
116                                phi   %pi
117 (%o3)                  log(tan(--- + ---))
118                                 2     4
119 @end group
120 @group
121 (%i4) elliptic_e (phi, 1);
122                     phi                  phi
123 (%o4)       2 round(---) - sin(%pi round(---) - phi)
124                     %pi                  %pi
125 @end group
126 @group
127 (%i5) elliptic_e (phi, 0);
128 (%o5)                          phi
129 @end group
130 @group
131 (%i6) elliptic_kc (1/2);
132                                 3/2
133                              %pi
134 (%o6)                      -----------
135                                   2 3
136                            2 gamma (-)
137                                     4
138 @end group
139 @group
140 (%i7) makegamma (%);
141                                 3/2
142                              %pi
143 (%o7)                      -----------
144                                   2 3
145                            2 gamma (-)
146                                     4
147 @end group
148 @group
149 (%i8) diff (elliptic_f (phi, m), phi);
150                                 1
151 (%o8)                 ---------------------
152                                     2
153                       sqrt(1 - m sin (phi))
154 @end group
155 @group
156 (%i9) diff (elliptic_f (phi, m), m);
157        elliptic_e(phi, m) - (1 - m) elliptic_f(phi, m)
158 (%o9) (-----------------------------------------------
159                               m
160                                  cos(phi) sin(phi)
161                              - ---------------------)/(2 (1 - m))
162                                              2
163                                sqrt(1 - m sin (phi))
164 @end group
165 @end example
167 Support for elliptic functions and integrals was written by Raymond
168 Toy.  It is placed under the terms of the General Public License (GPL)
169 that governs the distribution of Maxima.
171 @opencatbox{Categories:}
172 @category{Elliptic functions}
173 @closecatbox
175 @node Functions and Variables for Elliptic Functions, Functions and Variables for Elliptic Integrals, Introduction to Elliptic Functions and Integrals, Elliptic Functions
176 @comment  node-name,  next,  previous,  up
177 @section Functions and Variables for Elliptic Functions
178 See @urlaands{Section 6.12, 569} and @urldlmf{22.2} for more
179 information.
181 @anchor{jacobi_sn}
182 @deffn {Function} jacobi_sn (@var{u}, @var{m})
183 The Jacobian elliptic function 
184 m4_mathdot(<<<{\rm sn}(u,m)>>>, <<<sn(u,m)>>>)
187 @opencatbox{Categories:}
188 @category{Elliptic functions}
189 @closecatbox
190 @end deffn
192 @anchor{jacobi_cn}
193 @deffn {Function} jacobi_cn (@var{u}, @var{m})
194 The Jacobian elliptic function 
195 m4_mathdot(<<<{\rm cn}(u,m)>>>, <<<cn(u,m)>>>)
197 @opencatbox{Categories:}
198 @category{Elliptic functions}
199 @closecatbox
200 @end deffn
202 @anchor{jacobi_dn}
203 @deffn {Function} jacobi_dn (@var{u}, @var{m})
204 The Jacobian elliptic function 
205 m4_mathdot(<<<{\rm dn}(u,m)>>>, <<<dn(u,m)>>>)
207 @opencatbox{Categories:}
208 @category{Elliptic functions}
209 @closecatbox
210 @end deffn
212 @anchor{jacobi_ns}
213 @deffn {Function} jacobi_ns (@var{u}, @var{m})
214 The Jacobian elliptic function 
215 m4_mathdot(<<<{\rm ns}(u,m) = 1/{\rm
216 sn}(u,m)>>>, <<<ns(u,m) = 1/sn(u,m)>>>)
218 @opencatbox{Categories:}
219 @category{Elliptic functions}
220 @closecatbox
221 @end deffn
223 @anchor{jacobi_sc}
224 @deffn {Function} jacobi_sc (@var{u}, @var{m})
225 The Jacobian elliptic function 
226 m4_mathdot(<<<{\rm sc}(u,m) = {\rm
227 sn}(u,m)/{\rm cn}(u,m)>>>, <<<sc(u,m) = sn(u,m)/cn(u,m)>>>)
229 @opencatbox{Categories:}
230 @category{Elliptic functions}
231 @closecatbox
232 @end deffn
234 @anchor{jacobi_sd}
235 @deffn {Function} jacobi_sd (@var{u}, @var{m})
236 The Jacobian elliptic function 
237 m4_mathdot({\rm sd}(u,m) = {\rm
238 sn}(u,m)/{\rm dn}(u,m), <<<sd(u,m) = sn(u,m)/dn(u,m)>>>)
240 @opencatbox{Categories:}
241 @category{Elliptic functions}
242 @closecatbox
243 @end deffn
245 @anchor{jacobi_nc}
246 @deffn {Function} jacobi_nc (@var{u}, @var{m})
247 The Jacobian elliptic function 
248 m4_mathdot(<<<{\rm nc}(u,m) = 1/{\rm cn}(u,m)>>>, <<<nc(u,m) = 1/cn(u,m)>>>)
250 @opencatbox{Categories:}
251 @category{Elliptic functions}
252 @closecatbox
253 @end deffn
255 @anchor{jacobi_cs}
256 @deffn {Function} jacobi_cs (@var{u}, @var{m})
257 The Jacobian elliptic function 
258 m4_mathdot(<<<{\rm cs}(u,m) = {\rm
259 cn}(u,m)/{\rm sn}(u,m)>>>, <<<cs(u,m) = cn(u,m)/sn(u,m)>>>)
261 @opencatbox{Categories:}
262 @category{Elliptic functions}
263 @closecatbox
264 @end deffn
266 @anchor{jacobi_cd}
267 @deffn {Function} jacobi_cd (@var{u}, @var{m})
268 The Jacobian elliptic function 
269 m4_mathdot(<<<{\rm cd}(u,m) = {\rm cn}(u,m)/{\rm dn}(u,m)>>>, <<<cd(u,m) = cn(u,m)/dn(u,m)>>>)
271 @opencatbox{Categories:}
272 @category{Elliptic functions}
273 @closecatbox
274 @end deffn
276 @anchor{jacobi_nd}
277 @deffn {Function} jacobi_nd (@var{u}, @var{m})
278 The Jacobian elliptic function 
279 m4_mathdot(<<<{\rm nd}(u,m) = 1/{\rm dn}(u,m)>>>,
280 <<<nd(u,m) = 1/dn(u,m)>>>)
282 @opencatbox{Categories:}
283 @category{Elliptic functions}
284 @closecatbox
285 @end deffn
287 @anchor{jacobi_ds}
288 @deffn {Function} jacobi_ds (@var{u}, @var{m})
289 The Jacobian elliptic function 
290 m4_mathdot(<<<{\rm ds}(u,m) =
291 {\rm dn}(u,m)/{\rm sn}(u,m)>>>, <<<ds(u,m) = dn(u,m)/sn(u,m)>>>)
293 @opencatbox{Categories:}
294 @category{Elliptic functions}
295 @closecatbox
296 @end deffn
298 @anchor{jacobi_dc}
299 @deffn {Function} jacobi_dc (@var{u}, @var{m})
300 The Jacobian elliptic function 
301 m4_mathdot(<<<{\rm dc}(u,m) =
302 {\rm dn}(u,m)/{\rm cn}(u,m)>>>, <<<dc(u,m) = dn(u,m)/cn(u,m)>>>)
304 @opencatbox{Categories:}
305 @category{Elliptic functions}
306 @closecatbox
307 @end deffn
309 @anchor{jacobi_am}
310 @deffn {Function} jacobi_am (@var{u}, @var{m})
311 The Jacobi amplitude function, @code{jacobi_am}, is defined implicitly by (see
312 @url{http://functions.wolfram.com/09.24.02.0001.01})
313 m4_math(<<<z = {\rm am}(w, m)>>>,<<<z = am(w, m)>>>)
314 where @math{w = F(z,m)} where @math{F(z,m)} is the incomplete elliptic
315 integral of the first kind (@pxref{elliptic_f}).  It is defined for
316 all real and complex values of @math{z} and @math{m}.  In particular
317 for real @math{z} and @math{m} with @math{|m|<1},
318 m4_math(<<<{\rm am}(z,m)>>>,<<<am(z,m)>>>)
319 maps the entire real line to the entire real line.  For other values
320 of @math{z} and @math{m}, the following relationship is used:
321 m4_mathdot(<<<{\rm am}(z,m) = \sin^{-1}({\rm jacobi\_sn}(z, m))>>>,
322 <<<am(z,m) = asin(jacobi_sn(z,m))>>>)
324 Some examples:
325 @c ===beg===
326 @c jacobi_am(z,0);
327 @c jacobi_am(z,1);
328 @c jacobi_am(0,m);
329 @c jacobi_am(100, .5);
330 @c jacobi_am(0.5, 1.5);
331 @c jacobi_am(1.5b0, 1.5b0+%i);
332 @c ===end===
333 @example
334 @group
335 (%i1) jacobi_am(z,0);
336 (%o1)                           z
337 @end group
338 @group
339 (%i2) jacobi_am(z,1);
340                                  z    %pi
341 (%o2)                   2 atan(%e ) - ---
342                                        2
343 @end group
344 @group
345 (%i3) jacobi_am(0,m);
346 (%o3)                           0
347 @end group
348 @group
349 (%i4) jacobi_am(100, .5);
350 (%o4)                   84.70311272411382
351 @end group
352 @group
353 (%i5) jacobi_am(0.5, 1.5);
354 (%o5)                  0.4707197897046991
355 @end group
356 @group
357 (%i6) jacobi_am(1.5b0, 1.5b0+%i);
358 (%o6)    9.340542168700782b-1 - 3.723960452146071b-1 %i
359 @end group
360 @end example
362 @c ===beg===
363 @c plot2d([jacobi_am(x,.4),jacobi_am(x,.7),jacobi_am(x,.99),jacobi_am(x,.999999)],[x,0,10*%pi]);
364 @c ===end===
365 @example
366 @group
367 (%i1) plot2d([jacobi_am(x,.4),jacobi_am(x,.7),jacobi_am(x,.99),jacobi_am(x,.999999)],[x,0,10*%pi]);
368 (%o1)                         false
369 @end group
370 @end example
372 @ifnotinfo
373 Compare this plot with the plot from @urldlmf{22.16.iv}:
375 @image{figures/jacobi_am}
376 @end ifnotinfo
378 @opencatbox{Categories:}
379 @category{Elliptic functions}
380 @closecatbox
381 @end deffn
383 @anchor{inverse_jacobi_dn}
384 @deffn {Function} inverse_jacobi_dn (@var{u}, @var{m})
385 The inverse of the Jacobian elliptic function 
386 m4_mathdot(<<<{\rm
387 dn}(u,m)>>>, <<<dn(u,m)>>>) 
388 For 
389 m4_mathcomma(\sqrt{1-m}\le u \le 1,
390 sqrt(1-m) <= u <= 1) 
391 it can also be written (@urldlmf{22.15.E14}):
392 m4_displaymath(
393 {\rm inverse\_jacobi\_dn}(u, m) = \int_u^1 {dt\over \sqrt{(1-t^2)(t^2-(1-m))}},
394 @example
395                                 1
396                                /
397                                [               1
398      inverse_jacobi_dn(u, m) = I  --------------------------- dt
399                                ]             2    2
400                                /  sqrt((1 - t ) (t  + m - 1))
401                                 u
402 @end example
406 @opencatbox{Categories:}
407 @category{Elliptic functions}
408 @closecatbox
409 @end deffn
411 @anchor{inverse_jacobi_ns}
412 @deffn {Function} inverse_jacobi_ns (@var{u}, @var{m})
413 The inverse of the Jacobian elliptic function 
414 m4_mathdot(<<<{\rm
415 ns}(u,m)>>>, <<<ns(u,m)>>>) 
416 For 
417 m4_mathcomma(1 \le u, 1 <= u) 
418 it can also be written (@urldlmf{22.15.E121}):
419 m4_displaymath(
420 {\rm inverse\_jacobi\_ns}(u, m) = \int_u^{\infty} {dt\over \sqrt{(1-t^2)(t^2-m)}},
421 @example
422                                  inf
423                                 /
424                                 [               1
425       inverse_jacobi_ns(u, m) = I    ----------------------- dt
426                                 ]               2    2
427                                 /    sqrt((1 - t ) (t  - m))
428                                  u
429 @end example
432 @opencatbox{Categories:}
433 @category{Elliptic functions}
434 @closecatbox
435 @end deffn
437 @anchor{inverse_jacobi_sc}
438 @deffn {Function} inverse_jacobi_sc (@var{u}, @var{m})
439 The inverse of the Jacobian elliptic function 
440 m4_mathdot(<<<{\rm
441 sc}(u,m)>>>, <<<sc(u,m)>>>) 
442 For all @math{u} it can also be written (@urldlmf{22.15.E20}):
443 m4_displaymath(
444 {\rm inverse\_jacobi\_sc}(u, m) = \int_0^u {dt\over \sqrt{(1+t^2)(1+(1-m)t^2)}},
445 @example
446                               u
447                              /
448                              [                 1
449    inverse_jacobi_sc(u, m) = I  ------------------------------- dt
450                              ]             2                2
451                              /  sqrt((1 - t ) (1 - (1 - m) t ))
452                               0
453 @end example
456 @opencatbox{Categories:}
457 @category{Elliptic functions}
458 @closecatbox
459 @end deffn
461 @anchor{inverse_jacobi_sd}
462 @deffn {Function} inverse_jacobi_sd (@var{u}, @var{m})
463 The inverse of the Jacobian elliptic function 
464 m4_mathdot(<<<{\rm
465 sd}(u,m)>>>, <<<sd(u,m)>>>) 
466 For 
467 m4_mathcomma(-1/\sqrt{1-m}\le u \le
468 1/\sqrt{1-m}, -1/sqrt(1-m) <= 1/sqrt(1-m)) 
469 it can also be written (@urldlmf{22.15.E16}):
470 m4_displaymath(
471 {\rm inverse\_jacobi\_sd}(u, m) = \int_0^u {dt\over \sqrt{(1-(1-m)t^2)(1+mt^2)}},
472 @example
473                             u
474                            /
475                            [                  1
476  inverse_jacobi_sd(u, m) = I  --------------------------------- dt
477                            ]                     2      2
478                            /  sqrt((1 - (1 - m) t ) (m t  + 1))
479                             0
480 @end example
483 @opencatbox{Categories:}
484 @category{Elliptic functions}
485 @closecatbox
486 @end deffn
488 @anchor{inverse_jacobi_nc}
489 @deffn {Function} inverse_jacobi_nc (@var{u}, @var{m})
490 The inverse of the Jacobian elliptic function 
491 m4_mathdot(<<<{\rm
492 nc}(u,m)>>>, <<<nc(u,m)>>>) 
493 For 
494 m4_mathcomma(1\le u, 1 <= u) 
495 it can also be written (@urldlmf{22.15.E19}):
496 m4_displaymath(
497 {\rm inverse\_jacobi\_nc}(u, m) = \int_1^u {dt\over \sqrt{(t^2-1)(m+(1-m)t^2)}},
498 @example
499                               1
500                              /
501                              [                 1
502  inverse_jacobi_nc(u, m) = - I  ------------------------------- dt
503                              ]         2                2
504                              /  sqrt((t  - 1) ((1 - m) t  + m))
505                               u
506 @end example
509 @opencatbox{Categories:}
510 @category{Elliptic functions}
511 @closecatbox
512 @end deffn
514 @anchor{inverse_jacobi_cs}
515 @deffn {Function} inverse_jacobi_cs (@var{u}, @var{m})
516 The inverse of the Jacobian elliptic function 
517 m4_mathdot(<<<{\rm
518 cs}(u,m)>>>, <<<cs(u,m)>>>) 
519 For all @math{u} it can also be written (@urldlmf{22.15.E23}):
520 m4_displaymath(
521 {\rm inverse\_jacobi\_cs}(u, m) = \int_u^{\infty} {dt\over \sqrt{(1+t^2)(t^2+(1-m))}},
522 @example
523                              inf
524                             /
525                             [                  1
526   inverse_jacobi_cs(u, m) = I    ----------------------------- dt
527                             ]          2            2
528                             /    sqrt(t  + 1) sqrt(t  - m + 1)
529                              u
530 @end example
534 @opencatbox{Categories:}
535 @category{Elliptic functions}
536 @closecatbox
537 @end deffn
539 @anchor{inverse_jacobi_cd}
540 @deffn {Function} inverse_jacobi_cd (@var{u}, @var{m})
541 The inverse of the Jacobian elliptic function 
542 m4_mathdot(<<<{\rm
543 cd}(u,m)>>>, <<<cd(u,m)>>>) 
544 For 
545 m4_mathcomma(-1\le u \le 1, -1 <= u <=
546 1) 
547 it can also be written (@urldlmf{22.15.E15}):
548 m4_displaymath(
549 {\rm inverse\_jacobi\_cd}(u, m) = \int_u^1 {dt\over \sqrt{(1-t^2)(1-mt^2)}},
550 @example
551                                 1
552                                /
553                                [              1
554      inverse_jacobi_cd(u, m) = I  ------------------------- dt
555                                ]             2          2
556                                /  sqrt((1 - t ) (1 - m t ))
557                                 u
558 @end example
562 @opencatbox{Categories:}
563 @category{Elliptic functions}
564 @closecatbox
565 @end deffn
567 @anchor{inverse_jacobi_nd}
568 @deffn {Function} inverse_jacobi_nd (@var{u}, @var{m})
569 The inverse of the Jacobian elliptic function 
570 m4_mathdot(<<<{\rm
571 nd}(u,m)>>>, <<<nd(u,m)>>>) 
572 For 
573 m4_mathcomma(1\le u \le 1/\sqrt{1-m},
574 1 <= u <= 1/sqrt(1-m)) 
575 it can also be written (@urldlmf{22.15.E17}):
576 m4_displaymath(
577 {\rm inverse\_jacobi\_nd}(u, m) = \int_1^u {dt\over \sqrt{(t^2-1)(1-(1-m)t^2)}},
578 @example
579                               1
580                              /
581                              [                 1
582  inverse_jacobi_nd(u, m) = - I  ------------------------------- dt
583                              ]         2                    2
584                              /  sqrt((t  - 1) (1 - (1 - m) t ))
585                               u
586 @end example
590 @opencatbox{Categories:}
591 @category{Elliptic functions}
592 @closecatbox
593 @end deffn
595 @anchor{inverse_jacobi_ds}
596 @deffn {Function} inverse_jacobi_ds (@var{u}, @var{m})
597 The inverse of the Jacobian elliptic function 
598 m4_mathdot(<<<{\rm
599 ds}(u,m)>>>, <<<ds(u,m)>>>) 
600 For 
601 m4_mathcomma(\sqrt{1-m}\le u,
602 sqrt(1-m) <= u) 
603 it can also be written (@urldlmf{22.15.E22}):
604 m4_displaymath(
605 {\rm inverse\_jacobi\_ds}(u, m) = \int_u^{\infty} {dt\over \sqrt{(t^2+m)(t^2-(1-m))}},
606 @example
607                               inf
608                              /
609                              [                 1
610    inverse_jacobi_ds(u, m) = I    --------------------------- dt
611                              ]           2            2
612                              /    sqrt((t  + m - 1) (t  + m))
613                               u
614 @end example
618 @opencatbox{Categories:}
619 @category{Elliptic functions}
620 @closecatbox
621 @end deffn
623 @anchor{inverse_jacobi_dc}
624 @deffn {Function} inverse_jacobi_dc (@var{u}, @var{m})
625 The inverse of the Jacobian elliptic function 
626 m4_mathdot(<<<{\rm
627 dc}(u,m)>>>, <<<dc(u,m)>>>) 
628 For 
629 m4_mathcomma(1 \le u, 1 <= u) 
630 it can also be written (@urldlmf{22.15.E18}):
631 m4_displaymath(
632 {\rm inverse\_jacobi\_dc}(u, m) = \int_1^u {dt\over \sqrt{(t^2-1)(t^2-m)}},
633 @example
634                                   u
635                                  /
636                                  [             1
637      inverse_jacobi_dc(u, m) =   I  ----------------------- dt
638                                  ]         2        2
639                                  /  sqrt((t  - 1) (t  - m))
640                                   1
641 @end example
645 @opencatbox{Categories:}
646 @category{Elliptic functions}
647 @closecatbox
648 @end deffn
651 @node Functions and Variables for Elliptic Integrals,  , Functions and Variables for Elliptic Functions, Elliptic Functions
652 @comment  node-name,  next,  previous,  up
653 @section Functions and Variables for Elliptic Integrals
655 @anchor{elliptic_f}
656 @deffn {Function} elliptic_f (@var{phi}, @var{m})
657 The incomplete elliptic integral of the first kind, defined as
659 m4_displaymath(
660 <<<\int_0^{\phi} {\frac{d\theta}{\sqrt{1-m\sin^2\theta}}}>>>
662 <<<@math{integrate(1/sqrt(1 - m*sin(x)^2), x, 0, phi)}>>>
665 See also @ref{elliptic_e} and @ref{elliptic_kc}.
667 @opencatbox{Categories:}
668 @category{Elliptic integrals}
669 @closecatbox
670 @end deffn
672 @anchor{elliptic_e}
673 @deffn {Function} elliptic_e (@var{phi}, @var{m})
674 The incomplete elliptic integral of the second kind, defined as
676 m4_displaymath(
677 <<<\int_0^\phi {\sqrt{1 - m\sin^2\theta}}\, d\theta>>>
679 <<<@math{elliptic_e(phi, m) = integrate(sqrt(1 - m*sin(x)^2), x, 0, phi)}>>>
682 See also @ref{elliptic_f} and @ref{elliptic_ec}.
684 @opencatbox{Categories:}
685 @category{Elliptic integrals}
686 @closecatbox
687 @end deffn
689 @anchor{elliptic_eu}
690 @deffn {Function} elliptic_eu (@var{u}, @var{m})
691 The incomplete elliptic integral of the second kind, defined as
693 m4_displaymath(
694 <<<E(u, m) = \int_0^u {\rm dn}(v, m)\, dv  = \int_0^\tau \sqrt{\frac{1-m t^2}{1-t^2}}\, dt>>>
696 <<<@math{elliptic_eu(u, m) = integrate(dn(v,m)^2,v,0,u) = integrate(sqrt(1-m*t^2)/sqrt(1-t^2), t, 0, tau)}>>>
699 where 
700 m4_mathdot(
701 <<<\tau = {\rm sn}(u,m)>>>
703 <<<tau = sn(u,m)>>>
707 This is related to @code{elliptic_e} by
709 m4_displaymath(
710 <<<E(u,m) = E(\sin^{-1} {\rm sn}(u, m), m)>>>
712 <<<@math{elliptic_eu(u, m) = elliptic_e(asin(sn(u,m)),m)}>>>
715 See also @ref{elliptic_e}.
716 @opencatbox{Categories:}
717 @category{Elliptic integrals}
718 @closecatbox
719 @end deffn
721 @anchor{elliptic_pi}
722 @deffn {Function} elliptic_pi (@var{n}, @var{phi}, @var{m})
723 The incomplete elliptic integral of the third kind, defined as
725 m4_displaymath(
726 <<<\int_0^\phi {{d\theta}\over{(1-n\sin^2 \theta)\sqrt{1 - m\sin^2\theta}}}>>>
728 <<<@math{integrate(1/(1-n*sin(x)^2)/sqrt(1 - m*sin(x)^2), x, 0, phi)}>>>
731 @opencatbox{Categories:}
732 @category{Elliptic integrals}
733 @closecatbox
734 @end deffn
736 @anchor{elliptic_kc}
737 @deffn {Function} elliptic_kc (@var{m})
738 The complete elliptic integral of the first kind, defined as
740 m4_displaymath(
741 <<<\int_0^{\frac{\pi}{2}} {{d\theta}\over{\sqrt{1 - m\sin^2\theta}}}>>>
743 <<<@math{integrate(1/sqrt(1 - m*sin(x)^2), x, 0, pi/2)}>>>
746 For certain values of @math{m}, the value of the integral is known in
747 terms of @math{Gamma} functions.  Use @mref{makegamma} to evaluate them.
749 @opencatbox{Categories:}
750 @category{Elliptic integrals}
751 @closecatbox
752 @end deffn
754 @anchor{elliptic_ec}
755 @deffn {Function} elliptic_ec (@var{m})
756 The complete elliptic integral of the second kind, defined as
758 m4_displaymath(
759 <<<\int_0^{\frac{\pi}{2}} \sqrt{1 - m\sin^2\theta}\, d\theta>>>
761 <<<@math{integrate(sqrt(1 - m*sin(x)^2), x, 0, pi/2)}>>>
764 For certain values of @math{m}, the value of the integral is known in
765 terms of @math{Gamma} functions.  Use @mref{makegamma} to evaluate them.
767 @opencatbox{Categories:}
768 @category{Elliptic integrals}
769 @closecatbox
770 @end deffn
772 @anchor{carlson_rc}
773 @deffn {Function} carlson_rc (@var{x}, @var{y})
774 Carlson's RC integral is defined by
776 m4_displaymath(
777 <<<R_C(x, y) = \frac{1}{2} \int_0^{\infty} \frac{1}{\sqrt{t+x}(t+y)}\, dt>>>
779 <<<@math{integrate(1/2*(t+x)^(-1/2)/(t+y), t, 0, inf)}>>>
782 This integral is related to many elementary functions in the following
783 way:
785 m4_displaymath(
786 <<<\eqalign{
787 \log x &= (x-1) R_C\left(\left({\frac{1+x}{2}}\right)^2, x\right), \quad x > 0 \cr
788 \sin^{-1} x &= x R_C(1-x^2, 1), \quad |x| \le 1 \cr
789 \cos^{-1} x &= \sqrt{1-x^2} R_C(x^2,1), \quad 0 \le x \le 1  \cr
790 \tan^{-1} x &= x  R_C(1,1+x^2)  \cr
791 \sinh^{-1} x &= x  R_C(1+x^2,1)  \cr
792 \cosh^{-1} x &= \sqrt{x^2-1}  R_C(x^2,1), \quad x \ge 1  \cr
793 \tanh^{-1}(x) &= x  R_C(1,1-x^2), \quad |x| \le 1
794 }>>>
796 <<<@math{log(x)  = (x-1)*rc(((1+x)/2)^2, x), x > 0}
798 @math{asin(x) = x * rc(1-x^2, 1), |x|<= 1}
800 @math{acos(x) = sqrt(1-x^2)*rc(x^2,1), 0 <= x <=1}
802 @math{atan(x) = x * rc(1,1+x^2)}
804 @math{asinh(x) = x * rc(1+x^2,1)}
806 @math{acosh(x) = sqrt(x^2-1) * rc(x^2,1), x >= 1}
808 @math{atanh(x) = x * rc(1,1-x^2), |x|<=1}>>>
811 Also, we have the relationship
813 m4_displaymath(
814 <<<R_C(x,y) = R_F(x,y,y)>>>
816 @math{R_C(x,y) = R_F(x,y,y)}
819 Some special values:
820 m4_displaymath(
821 <<<\eqalign{R_C(0, 1) &= \frac{\pi}{2} \cr
822 R_C(0, 1/4) &= \pi \cr
823 R_C(2,1) &= \log(\sqrt{2} + 1) \cr
824 R_C(i,i+1) &= \frac{\pi}{4} + \frac{i}{2} \log(\sqrt{2}-1) \cr
825 R_C(0,i) &= (1-i)\frac{\pi}{2\sqrt{2}} \cr
826 }>>>
828 @math{R_C(0,1) = pi/2}
830 @math{R_C(0,1/4) = pi}
832 @math{R_C(2,1) = log(sqrt(2)+1)}
834 @math{R_C(i, i+1) = pi/4 + i/2*log(sqrt(2)+1)}
836 @math{R_C(0, i) = (1-i)*pi/(2*sqrt(2))}
840 @opencatbox{Categories:}
841 @category{Elliptic integrals}
842 @closecatbox
843 @end deffn
845 @anchor{carlson_rd}
846 @deffn {Function} carlson_rd (@var{x}, @var{y}, @var{z})
847 Carlson's RD integral is defined by
849 m4_displaymath(
850 <<<R_D(x,y,z) = \frac{3}{2} \int_0^{\infty} \frac{1}{\sqrt{t+x}\sqrt{t+y}\sqrt{t+z}\,(t+z)}\, dt>>>
852 <<<@math{R_D(x,y,z) = 3/2*integrate(1/(sqrt(t+x)*sqrt(t+y)*sqrt(t+z)*(t+z)), t, 0, inf)}>>>
855 We also have the special values
857 m4_displaymath(
858 <<<\eqalign{
859 R_D(x,x,x) &= x^{-\frac{3}{2}} \cr
860 R_D(0,y,y) &= \frac{3}{4} \pi y^{-\frac{3}{2}} \cr
861 R_D(0,2,1) &= 3 \sqrt{\pi} \frac{\Gamma(\frac{3}{4})}{\Gamma(\frac{1}{4})}
862 }>>>
864 <<<@math{R_D(x,x,x) = x^(-3/2)}
866 @math{R_D(0,y,y) = 3/4*pi*y^(-3/2)}
868 @math{R_D(0,2,1) = 3 sqrt(pi) gamma(3/4)/gamma(1/4)}>>>
872 It is also related to the complete elliptic E function as follows
874 m4_displaymath(
875 <<<E(m) = R_F(0, 1 - m, 1) - \frac{m}{3} R_D(0, 1 - m, 1)>>>
877 <<<@math{E(m) = R_F(0, 1 - m, 1) - (m/3)* R_D(0, 1 - m, 1)}>>>
880 @opencatbox{Categories:}
881 @category{Elliptic integrals}
882 @closecatbox
883 @end deffn
885 @anchor{carlson_rf}
886 @deffn {Function} carlson_rf (@var{x}, @var{y}, @var{z})
887 Carlson's RF integral is defined by
889 m4_displaymath(
890 <<<R_F(x,y,z) = \frac{1}{2} \int_0^{\infty} \frac{1}{\sqrt{t+x}\sqrt{t+y}\sqrt{t+z}}\, dt>>>
892 <<<@math{R_F(x,y,z) = 1/2*integrate(1/(sqrt(t+x)*sqrt(t+y)*sqrt(t+z)), t, 0, inf)}>>>
895 We also have the special values
897 m4_displaymath(
898 <<<\eqalign{
899 R_F(0,1,2)  &= \frac{\Gamma({\frac{1}{4}})^2}{4\sqrt{2\pi}} \cr
900 R_F(i,-i,0) &= \frac{\Gamma({\frac{1}{4}})^2}{4\sqrt{\pi}}
901 }>>>
904 @math{R_F(0,1,2) = gamma(1/4)^2/(4*sqrt(2*pi))}
906 @math{R_F(i,-i,0) = gamma(1/4)^2/(4*sqrt(pi))}
910 It is also related to the complete elliptic E function as follows
912 m4_displaymath(
913 <<<E(m) = R_F(0, 1 - m, 1) - \frac{m}{3} R_D(0, 1 - m, 1)>>>
915 <<<@math{E(m) = R_F(0, 1 - m, 1) - (m/3)* R_D(0, 1 - m, 1)}>>>
918 @opencatbox{Categories:}
919 @category{Elliptic integrals}
920 @closecatbox
921 @end deffn
923 @anchor{carlson_rj}
924 @deffn {Function} carlson_rj (@var{x}, @var{y}, @var{z}, @var{p})
925 Carlson's RJ integral is defined by
927 m4_displaymath(
928 <<<R_J(x,y,z) = \frac{1}{2} \int_0^{\infty} \frac{1}{\sqrt{t+x}\sqrt{t+y}\sqrt{t+z}\,(t+p)}\, dt>>>
931 @math{R_J(x,y,z) = 1/2*integrate(1/(sqrt(t+x)*sqrt(t+y)*sqrt(t+z)*(t+p)), t, 0, inf)}
932 >>>)
934 @opencatbox{Categories:}
935 @category{Elliptic integrals}
936 @closecatbox
937 @end deffn