File: maxima_62.html

package info (click to toggle)
maxima 5.10.0-6
  • links: PTS
  • area: main
  • in suites: etch, etch-m68k
  • size: 44,268 kB
  • ctags: 17,987
  • sloc: lisp: 152,894; fortran: 14,667; perl: 14,204; tcl: 10,103; sh: 3,376; makefile: 2,202; ansic: 471; awk: 7
file content (1065 lines) | stat: -rw-r--r-- 47,564 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
1059
1060
1061
1062
1063
1064
1065
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html401/loose.dtd">
<html>
<!-- Created on September, 20 2006 by texi2html 1.76 -->
<!--
Written by: Lionel Cons <Lionel.Cons@cern.ch> (original author)
            Karl Berry  <karl@freefriends.org>
            Olaf Bachmann <obachman@mathematik.uni-kl.de>
            and many others.
Maintained by: Many creative people <dev@texi2html.cvshome.org>
Send bugs and suggestions to <users@texi2html.cvshome.org>

-->
<head>
<title>Maxima Manual: 62. orthopoly</title>

<meta name="description" content="Maxima Manual: 62. orthopoly">
<meta name="keywords" content="Maxima Manual: 62. orthopoly">
<meta name="resource-type" content="document">
<meta name="distribution" content="global">
<meta name="Generator" content="texi2html 1.76">
<meta http-equiv="Content-Type" content="text/html; charset=us-ascii">
<style type="text/css">
<!--
a.summary-letter {text-decoration: none}
pre.display {font-family: serif}
pre.format {font-family: serif}
pre.menu-comment {font-family: serif}
pre.menu-preformatted {font-family: serif}
pre.smalldisplay {font-family: serif; font-size: smaller}
pre.smallexample {font-size: smaller}
pre.smallformat {font-family: serif; font-size: smaller}
pre.smalllisp {font-size: smaller}
span.sansserif {font-family:sans-serif; font-weight:normal;}
ul.toc {list-style: none}
body
{
    color: black;
    background: white; 
    margin-left: 8%;
    margin-right: 13%;
}

h1
{
    margin-left: +8%;
    font-size: 150%;
    font-family: sans-serif
}

h2
{
    font-size: 125%;
    font-family: sans-serif
}

h3
{
    font-size: 100%;
    font-family: sans-serif
}

h2,h3,h4,h5,h6 { margin-left: +4%; }

div.textbox
{
    border: solid;
    border-width: thin;
    /* width: 100%; */
    padding-top: 1em;
    padding-bottom: 1em;
    padding-left: 2em;
    padding-right: 2em
}

div.titlebox
{
    border: none;
    padding-top: 1em;
    padding-bottom: 1em;
    padding-left: 2em;
    padding-right: 2em;
    background: rgb(200,255,255);
    font-family: sans-serif
}

div.synopsisbox
{
    border: none;
    padding-top: 1em;
    padding-bottom: 1em;
    padding-left: 2em;
    padding-right: 2em;
     background: rgb(255,220,255);
    /*background: rgb(200,255,255); */
    /* font-family: fixed */
}

pre.example
{
    border: none;
    padding-top: 1em;
    padding-bottom: 1em;
    padding-left: 1em;
    padding-right: 1em;
    background: rgb(247,242,180); /* kind of sandy */
    /* background: rgb(200,255,255); */ /* sky blue */
    font-family: "Lucida Console", monospace
}

div.spacerbox
{
    border: none;
    padding-top: 2em;
    padding-bottom: 2em
}

div.image
{
    margin: 0;
    padding: 1em;
    text-align: center;
}
-->
</style>

<link rel="icon" href="http://maxima.sourceforge.net/favicon.ico"/>
</head>

<body lang="en" bgcolor="#FFFFFF" text="#000000" link="#0000FF" vlink="#800080" alink="#FF0000">

<a name="orthopoly"></a>
<a name="SEC217"></a>
<table cellpadding="1" cellspacing="1" border="0">
<tr><td valign="middle" align="left">[<a href="maxima_61.html#SEC216" title="Previous section in reading order"> &lt; </a>]</td>
<td valign="middle" align="left">[<a href="#SEC218" title="Next section in reading order"> &gt; </a>]</td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left">[<a href="maxima_61.html#SEC215" title="Beginning of this chapter or previous chapter"> &lt;&lt; </a>]</td>
<td valign="middle" align="left">[<a href="maxima.html#SEC_Top" title="Up section"> Up </a>]</td>
<td valign="middle" align="left">[<a href="maxima_63.html#SEC226" title="Next chapter"> &gt;&gt; </a>]</td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left">[<a href="maxima.html#SEC_Top" title="Cover (top) of document">Top</a>]</td>
<td valign="middle" align="left">[<a href="maxima_toc.html#SEC_Contents" title="Table of contents">Contents</a>]</td>
<td valign="middle" align="left">[<a href="maxima_72.html#SEC264" title="Index">Index</a>]</td>
<td valign="middle" align="left">[<a href="maxima_abt.html#SEC_About" title="About (help)"> ? </a>]</td>
</tr></table>
<h1 class="chapter"> 62. orthopoly </h1>

<table class="menu" border="0" cellspacing="0">
<tr><td align="left" valign="top"><a href="#SEC218">62.1 Introduction to orthogonal polynomials</a></td><td>&nbsp;&nbsp;</td><td align="left" valign="top">
</td></tr>
<tr><td align="left" valign="top"><a href="#SEC225">62.2 Definitions for orthogonal polynomials</a></td><td>&nbsp;&nbsp;</td><td align="left" valign="top">
</td></tr>
</table>

<hr size="6">
<a name="Introduction-to-orthogonal-polynomials"></a>
<a name="SEC218"></a>
<table cellpadding="1" cellspacing="1" border="0">
<tr><td valign="middle" align="left">[<a href="#SEC217" title="Previous section in reading order"> &lt; </a>]</td>
<td valign="middle" align="left">[<a href="#SEC219" title="Next section in reading order"> &gt; </a>]</td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left">[<a href="#SEC217" title="Beginning of this chapter or previous chapter"> &lt;&lt; </a>]</td>
<td valign="middle" align="left">[<a href="#SEC217" title="Up section"> Up </a>]</td>
<td valign="middle" align="left">[<a href="maxima_63.html#SEC226" title="Next chapter"> &gt;&gt; </a>]</td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left">[<a href="maxima.html#SEC_Top" title="Cover (top) of document">Top</a>]</td>
<td valign="middle" align="left">[<a href="maxima_toc.html#SEC_Contents" title="Table of contents">Contents</a>]</td>
<td valign="middle" align="left">[<a href="maxima_72.html#SEC264" title="Index">Index</a>]</td>
<td valign="middle" align="left">[<a href="maxima_abt.html#SEC_About" title="About (help)"> ? </a>]</td>
</tr></table>
<h2 class="section"> 62.1 Introduction to orthogonal polynomials </h2>

<p><code>orthopoly</code> is a package for symbolic and numerical evaluation of
several kinds of orthogonal polynomials, including Chebyshev,
Laguerre, Hermite, Jacobi, Legendre, and ultraspherical (Gegenbauer) 
polynomials. Additionally, <code>orthopoly</code> includes support for the spherical Bessel, 
spherical Hankel, and spherical harmonic functions.
</p>
<p>For the most part, <code>orthopoly</code> follows the conventions of Abramowitz and Stegun
<i>Handbook of Mathematical Functions</i>, Chapter 22 (10th printing, December 1972);
additionally, we use Gradshteyn and Ryzhik, 
<i>Table of Integrals, Series, and Products</i> (1980 corrected and 
enlarged edition), and Eugen Merzbacher <i>Quantum Mechanics</i> (2nd edition, 1970).
</p>


<p>Barton Willis of the University of Nebraska at Kearney (UNK) wrote
the <code>orthopoly</code> package and its documentation. The package 
is released under the GNU General Public License (GPL).
</p>
<hr size="6">
<a name="SEC219"></a>
<table cellpadding="1" cellspacing="1" border="0">
<tr><td valign="middle" align="left">[<a href="#SEC218" title="Previous section in reading order"> &lt; </a>]</td>
<td valign="middle" align="left">[<a href="#SEC220" title="Next section in reading order"> &gt; </a>]</td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left">[<a href="#SEC217" title="Beginning of this chapter or previous chapter"> &lt;&lt; </a>]</td>
<td valign="middle" align="left">[<a href="#SEC218" title="Up section"> Up </a>]</td>
<td valign="middle" align="left">[<a href="maxima_63.html#SEC226" title="Next chapter"> &gt;&gt; </a>]</td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left">[<a href="maxima.html#SEC_Top" title="Cover (top) of document">Top</a>]</td>
<td valign="middle" align="left">[<a href="maxima_toc.html#SEC_Contents" title="Table of contents">Contents</a>]</td>
<td valign="middle" align="left">[<a href="maxima_72.html#SEC264" title="Index">Index</a>]</td>
<td valign="middle" align="left">[<a href="maxima_abt.html#SEC_About" title="About (help)"> ? </a>]</td>
</tr></table>
<h3 class="subsection"> 62.1.1 Getting Started with orthopoly </h3>

<p><code>load (orthopoly)</code> loads the <code>orthopoly</code> package.
</p>
<p>To find the third-order Legendre polynomial,
</p>
<table><tr><td>&nbsp;</td><td><pre class="example">(%i1) legendre_p (3, x);
                      3             2
             5 (1 - x)    15 (1 - x)
(%o1)      - ---------- + ----------- - 6 (1 - x) + 1
                 2             2
</pre></td></tr></table>
<p>To express this as a sum of powers of <var>x</var>, apply <var>ratsimp</var> or <var>rat</var>
to the result.
</p>
<table><tr><td>&nbsp;</td><td><pre class="example">(%i2) [ratsimp (%), rat (%)];
                        3           3
                     5 x  - 3 x  5 x  - 3 x
(%o2)/R/            [----------, ----------]
                         2           2
</pre></td></tr></table>
<p>Alternatively, make the second argument to <code>legendre_p</code> (its &quot;main&quot; variable) 
a canonical rational expression (CRE).
</p>
<table><tr><td>&nbsp;</td><td><pre class="example">(%i1) legendre_p (3, rat (x));
                              3
                           5 x  - 3 x
(%o1)/R/                   ----------
                               2
</pre></td></tr></table>
<p>For floating point evaluation, <code>orthopoly</code> uses a running error analysis
to estimate an upper bound for the error. For example,
</p>
<table><tr><td>&nbsp;</td><td><pre class="example">(%i1) jacobi_p (150, 2, 3, 0.2);
(%o1) interval(- 0.062017037936715, 1.533267919277521E-11)
</pre></td></tr></table>
<p>Intervals have the form <code>interval (<var>c</var>, <var>r</var>)</code>, where <var>c</var> is the
center and <var>r</var> is the radius of the interval. Since Maxima
does not support arithmetic on intervals, in some situations, such
as graphics, you want to suppress the error and output only the 
center of the interval. To do this, set the option
variable <code>orthopoly_returns_intervals</code> to <code>false</code>.
</p>
<table><tr><td>&nbsp;</td><td><pre class="example">(%i1) orthopoly_returns_intervals : false;
(%o1)                         false
(%i2) jacobi_p (150, 2, 3, 0.2);
(%o2)                  - 0.062017037936715
</pre></td></tr></table>
<p>Refer to the section see <a href="#Floating-point-Evaluation">Floating point Evaluation</a> for more information.
</p>
<p>Most functions in <code>orthopoly</code> have a <code>gradef</code> property; thus
</p>
<table><tr><td>&nbsp;</td><td><pre class="example">(%i1) diff (hermite (n, x), x);
(%o1)                     2 n H     (x)
                               n - 1
(%i2) diff (gen_laguerre (n, a, x), x);
              (a)               (a)
           n L   (x) - (n + a) L     (x) unit_step(n)
              n                 n - 1
(%o2)      ------------------------------------------
                               x
</pre></td></tr></table>
<p>The unit step function in the second example prevents an error that would
otherwise arise by evaluating with <var>n</var> equal to 0.
</p>
<table><tr><td>&nbsp;</td><td><pre class="example">(%i3) ev (%, n = 0);
(%o3)                           0
</pre></td></tr></table>
<p>The gradef property only applies to the &quot;main&quot; variable; derivatives with 
respect other arguments usually result in an error message; for example
</p>
<table><tr><td>&nbsp;</td><td><pre class="example">(%i1) diff (hermite (n, x), x);
(%o1)                     2 n H     (x)
                               n - 1
(%i2) diff (hermite (n, x), n);

Maxima doesn't know the derivative of hermite with respect the first argument
 -- an error.  Quitting.  To debug this try debugmode(true);
</pre></td></tr></table>
<p>Generally, functions in <code>orthopoly</code> map over lists and matrices. For
the mapping to fully evaluate, the option variables 
<code>doallmxops</code> and <code>listarith</code> must both be <code>true</code> (the defaults).
To illustrate the mapping over matrices, consider
</p>
<table><tr><td>&nbsp;</td><td><pre class="example">(%i1) hermite (2, x);
                                     2
(%o1)                    - 2 (1 - 2 x )
(%i2) m : matrix ([0, x], [y, 0]);
                            [ 0  x ]
(%o2)                       [      ]
                            [ y  0 ]
(%i3) hermite (2, m);
               [                             2  ]
               [      - 2        - 2 (1 - 2 x ) ]
(%o3)          [                                ]
               [             2                  ]
               [ - 2 (1 - 2 y )       - 2       ]
</pre></td></tr></table>
<p>In the second example, the <code>i, j</code> element of the value
is <code>hermite (2, m[i,j])</code>; this is not the same as computing
<code>-2 + 4 m . m</code>, as seen in the next example.
</p>
<table><tr><td>&nbsp;</td><td><pre class="example">(%i4) -2 * matrix ([1, 0], [0, 1]) + 4 * m . m;
                    [ 4 x y - 2      0     ]
(%o4)               [                      ]
                    [     0      4 x y - 2 ]
</pre></td></tr></table>
<p>If you evaluate a function at a point outside its domain, generally
<code>orthopoly</code> returns the function unevaluated. For example,
</p>
<table><tr><td>&nbsp;</td><td><pre class="example">(%i1) legendre_p (2/3, x);
(%o1)                        P   (x)
                              2/3
</pre></td></tr></table>
<p><code>orthopoly</code> supports translation into TeX; it also does two-dimensional
output on a terminal.
</p>
<table><tr><td>&nbsp;</td><td><pre class="example">(%i1) spherical_harmonic (l, m, theta, phi);
                          m
(%o1)                    Y (theta, phi)
                          l
(%i2) tex (%);
$$Y_{l}^{m}\left(\vartheta,\varphi\right)$$
(%o2)                         false
(%i3) jacobi_p (n, a, a - b, x/2);
                          (a, a - b) x
(%o3)                    P          (-)
                          n          2
(%i4) tex (%);
$$P_{n}^{\left(a,a-b\right)}\left({{x}\over{2}}\right)$$
(%o4)                         false
</pre></td></tr></table>
<hr size="6">
<a name="SEC220"></a>
<table cellpadding="1" cellspacing="1" border="0">
<tr><td valign="middle" align="left">[<a href="#SEC219" title="Previous section in reading order"> &lt; </a>]</td>
<td valign="middle" align="left">[<a href="#SEC221" title="Next section in reading order"> &gt; </a>]</td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left">[<a href="#SEC217" title="Beginning of this chapter or previous chapter"> &lt;&lt; </a>]</td>
<td valign="middle" align="left">[<a href="#SEC218" title="Up section"> Up </a>]</td>
<td valign="middle" align="left">[<a href="maxima_63.html#SEC226" title="Next chapter"> &gt;&gt; </a>]</td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left">[<a href="maxima.html#SEC_Top" title="Cover (top) of document">Top</a>]</td>
<td valign="middle" align="left">[<a href="maxima_toc.html#SEC_Contents" title="Table of contents">Contents</a>]</td>
<td valign="middle" align="left">[<a href="maxima_72.html#SEC264" title="Index">Index</a>]</td>
<td valign="middle" align="left">[<a href="maxima_abt.html#SEC_About" title="About (help)"> ? </a>]</td>
</tr></table>
<h3 class="subsection"> 62.1.2 Limitations </h3>

<p>When an expression involves several orthogonal polynomials with
symbolic orders, it's possible that the expression actually
vanishes, yet Maxima is unable to simplify it to zero. If you
divide by such a quantity, you'll be in trouble. For example,
the following expression vanishes for integers <var>n</var> greater than 1, yet Maxima
is unable to simplify it to zero.
</p>
<table><tr><td>&nbsp;</td><td><pre class="example">(%i1) (2*n - 1) * legendre_p (n - 1, x) * x - n * legendre_p (n, x) + (1 - n) * legendre_p (n - 2, x);
(%o1)  (2 n - 1) P     (x) x - n P (x) + (1 - n) P     (x)
                  n - 1           n               n - 2
</pre></td></tr></table>
<p>For a specific <var>n</var>, we can reduce the expression to zero.
</p>
<table><tr><td>&nbsp;</td><td><pre class="example">(%i2) ev (% ,n = 10, ratsimp);
(%o2)                           0
</pre></td></tr></table>
<p>Generally, the polynomial form of an orthogonal polynomial is ill-suited
for floating point evaluation. Here's an example.
</p>
<table><tr><td>&nbsp;</td><td><pre class="example">(%i1) p : jacobi_p (100, 2, 3, x)$

(%i2) subst (0.2, x, p);
(%o2)                3.4442767023833592E+35
(%i3) jacobi_p (100, 2, 3, 0.2);
(%o3)  interval(0.18413609135169, 6.8990300925815987E-12)
(%i4) float(jacobi_p (100, 2, 3, 2/10));
(%o4)                   0.18413609135169
</pre></td></tr></table>
<p>The true value is about 0.184; this calculation suffers from extreme
subtractive cancellation error. Expanding the polynomial and then
evaluating, gives a better result.
</p><table><tr><td>&nbsp;</td><td><pre class="example">(%i5) p : expand(p)$
(%i6) subst (0.2, x, p);
(%o6) 0.18413609766122982
</pre></td></tr></table>
<p>This isn't a general rule; expanding the polynomial does not always
result in an expression that is better suited for numerical evaluation.
By far, the best way to do numerical evaluation is to make one or more
of the function arguments floating point numbers. By doing that, 
specialized floating point algorithms are used for evaluation.
</p>
<p>Maxima's <code>float</code> function is somewhat indiscriminant; if you apply 
<code>float</code> to an an expression involving an orthogonal polynomial with a
symbolic degree or order parameter, these parameters may be 
converted into floats; after that, the expression will not evaluate 
fully. Consider
</p>
<table><tr><td>&nbsp;</td><td><pre class="example">(%i1) assoc_legendre_p (n, 1, x);
                               1
(%o1)                         P (x)
                               n
(%i2) float (%);
                              1.0
(%o2)                        P   (x)
                              n
(%i3) ev (%, n=2, x=0.9);
                             1.0
(%o3)                       P   (0.9)
                             2
</pre></td></tr></table>
<p>The expression in (%o3) will not evaluate to a float; orthopoly doesn't
recognize floating point values where it requires an integer. Similarly, 
numerical evaluation of the <code>pochhammer</code> function for orders that
exceed <code>pochhammer_max_index</code> can be troublesome; consider
</p>
<table><tr><td>&nbsp;</td><td><pre class="example">(%i1) x :  pochhammer (1, 10), pochhammer_max_index : 5;
(%o1)                         (1)
                                 10
</pre></td></tr></table>
<p>Applying <code>float</code> doesn't evaluate <var>x</var> to a float
</p>
<table><tr><td>&nbsp;</td><td><pre class="example">(%i2) float (x);
(%o2)                       (1.0)
                                 10.0
</pre></td></tr></table>
<p>To evaluate <var>x</var> to a float, you'll need to bind
<code>pochhammer_max_index</code> to 11 or greater and apply <code>float</code> to <var>x</var>.
</p>
<table><tr><td>&nbsp;</td><td><pre class="example">(%i3) float (x), pochhammer_max_index : 11;
(%o3)                       3628800.0
</pre></td></tr></table>
<p>The default value of <code>pochhammer_max_index</code> is 100;
change its value after loading <code>orthopoly</code>.
</p>
<p>Finally, be aware that reference books vary on the definitions of the 
orthogonal polynomials; we've generally used the conventions 
of conventions of Abramowitz and Stegun.
</p>
<p>Before you suspect a bug in orthopoly, check some special cases 
to determine if your definitions match those used by orthonormal. 
Definitions often differ by a normalization; occasionally, authors
use &quot;shifted&quot; versions of the functions that makes the family
orthogonal on an interval other than <em>(-1, 1)</em>. To define, for example,
a Legendre polynomial that is orthogonal on <em>(0, 1)</em>, define
</p>
<table><tr><td>&nbsp;</td><td><pre class="example">(%i1) shifted_legendre_p (n, x) := legendre_p (n, 2*x - 1)$

(%i2) shifted_legendre_p (2, rat (x));
                            2
(%o2)/R/                 6 x  - 6 x + 1
(%i3) legendre_p (2, rat (x));
                               2
                            3 x  - 1
(%o3)/R/                    --------
                               2
</pre></td></tr></table>
<p><a name="Floating-point-Evaluation"></a>
</p><hr size="6">
<a name="SEC221"></a>
<table cellpadding="1" cellspacing="1" border="0">
<tr><td valign="middle" align="left">[<a href="#SEC220" title="Previous section in reading order"> &lt; </a>]</td>
<td valign="middle" align="left">[<a href="#SEC222" title="Next section in reading order"> &gt; </a>]</td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left">[<a href="#SEC217" title="Beginning of this chapter or previous chapter"> &lt;&lt; </a>]</td>
<td valign="middle" align="left">[<a href="#SEC218" title="Up section"> Up </a>]</td>
<td valign="middle" align="left">[<a href="maxima_63.html#SEC226" title="Next chapter"> &gt;&gt; </a>]</td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left">[<a href="maxima.html#SEC_Top" title="Cover (top) of document">Top</a>]</td>
<td valign="middle" align="left">[<a href="maxima_toc.html#SEC_Contents" title="Table of contents">Contents</a>]</td>
<td valign="middle" align="left">[<a href="maxima_72.html#SEC264" title="Index">Index</a>]</td>
<td valign="middle" align="left">[<a href="maxima_abt.html#SEC_About" title="About (help)"> ? </a>]</td>
</tr></table>
<h3 class="subsection"> 62.1.3 Floating point Evaluation </h3>

<p>Most functions in orthopoly use a running error analysis to 
estimate the error in floating point evaluation; the 
exceptions are the spherical Bessel functions and the associated Legendre 
polynomials of the second kind. For numerical evaluation, the spherical 
Bessel functions call SLATEC functions. No specialized method is used
for numerical evaluation of the associated Legendre polynomials of the
second kind.
</p>
<p>The running error analysis ignores errors that are second or higher order
in the machine epsilon (also known as unit roundoff). It also
ignores a few other errors. It's possible (although unlikely) 
that the actual error exceeds the estimate.
</p>
<p>Intervals have the form <code>interval (<var>c</var>, <var>r</var>)</code>, where <var>c</var> is the 
center of the interval and <var>r</var> is its radius. The 
center of an interval can be a complex number, and the radius is always a positive real number.
</p>
<p>Here is an an example.
</p>
<p>=
</p><table><tr><td>&nbsp;</td><td><pre class="example">(%i1) fpprec : 50$

(%i2) y0 : jacobi_p (100, 2, 3, 0.2);
(%o2) interval(0.1841360913516871, 6.8990300925815987E-12)
(%i3) y1 : bfloat (jacobi_p (100, 2, 3, 1/5));
(%o3) 1.8413609135168563091370224958913493690868904463668b-1
</pre></td></tr></table>
<p>Let's test that the actual error is smaller than the error estimate
</p>
<table><tr><td>&nbsp;</td><td><pre class="example">(%i4) is (abs (part (y0, 1) - y1) &lt; part (y0, 2));
(%o4)                         true
</pre></td></tr></table>
<p>Indeed, for this example the error estimate is an upper bound for the
true error.
</p>
<p>Maxima does not support arithmetic on intervals.
</p>
<table><tr><td>&nbsp;</td><td><pre class="example">(%i1) legendre_p (7, 0.1) + legendre_p (8, 0.1);
(%o1) interval(0.18032072148437508, 3.1477135311021797E-15)
        + interval(- 0.19949294375000004, 3.3769353084291579E-15)
</pre></td></tr></table>
<p>A user could define arithmetic operators that do interval math. To
define interval addition, we can define
</p>
<table><tr><td>&nbsp;</td><td><pre class="example">(%i1) infix (&quot;@+&quot;)$

(%i2) &quot;@+&quot;(x,y) := interval (part (x, 1) + part (y, 1), part (x, 2) + part (y, 2))$

(%i3) legendre_p (7, 0.1) @+ legendre_p (8, 0.1);
(%o3) interval(- 0.019172222265624955, 6.5246488395313372E-15)
</pre></td></tr></table>
<p>The special floating point routines get called when the arguments
are complex.  For example,
</p>
<table><tr><td>&nbsp;</td><td><pre class="example">(%i1) legendre_p (10, 2 + 3.0*%i);
(%o1) interval(- 3.876378825E+7 %i - 6.0787748E+7, 
                                           1.2089173052721777E-6)
</pre></td></tr></table>
<p>Let's compare this to the true value.
</p>
<table><tr><td>&nbsp;</td><td><pre class="example">(%i1) float (expand (legendre_p (10, 2 + 3*%i)));
(%o1)          - 3.876378825E+7 %i - 6.0787748E+7
</pre></td></tr></table>
<p>Additionally, when the arguments are big floats, the special floating point
routines get called; however, the big floats are converted into double floats
and the final result is a double.
</p>
<table><tr><td>&nbsp;</td><td><pre class="example">(%i1) ultraspherical (150, 0.5b0, 0.9b0);
(%o1) interval(- 0.043009481257265, 3.3750051301228864E-14)
</pre></td></tr></table>
<hr size="6">
<a name="SEC222"></a>
<table cellpadding="1" cellspacing="1" border="0">
<tr><td valign="middle" align="left">[<a href="#SEC221" title="Previous section in reading order"> &lt; </a>]</td>
<td valign="middle" align="left">[<a href="#SEC223" title="Next section in reading order"> &gt; </a>]</td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left">[<a href="#SEC217" title="Beginning of this chapter or previous chapter"> &lt;&lt; </a>]</td>
<td valign="middle" align="left">[<a href="#SEC218" title="Up section"> Up </a>]</td>
<td valign="middle" align="left">[<a href="maxima_63.html#SEC226" title="Next chapter"> &gt;&gt; </a>]</td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left">[<a href="maxima.html#SEC_Top" title="Cover (top) of document">Top</a>]</td>
<td valign="middle" align="left">[<a href="maxima_toc.html#SEC_Contents" title="Table of contents">Contents</a>]</td>
<td valign="middle" align="left">[<a href="maxima_72.html#SEC264" title="Index">Index</a>]</td>
<td valign="middle" align="left">[<a href="maxima_abt.html#SEC_About" title="About (help)"> ? </a>]</td>
</tr></table>
<h3 class="subsection"> 62.1.4 Graphics and orthopoly </h3>

<p>To plot expressions that involve the orthogonal polynomials, you 
must do two things:
</p><ol>
<li> 
Set the option variable <code>orthopoly_returns_intervals</code> to <code>false</code>,
</li><li>
Quote any calls to <code>orthopoly</code> functions.
</li></ol>
<p>If function calls aren't quoted, Maxima evaluates them to polynomials before 
plotting; consequently, the specialized floating point code doesn't get called.
Here is an example of how to plot an expression that involves
a Legendre polynomial.
</p>
<table><tr><td>&nbsp;</td><td><pre class="example">(%i1) plot2d ('(legendre_p (5, x)), [x, 0, 1]), orthopoly_returns_intervals : false;
(%o1)
</pre></td></tr></table>
<p><div class="image"><img src="./figures/orthopoly1.gif" alt="figures/orthopoly1"></div>
</p>
<p>The <i>entire</i> expression <code>legendre_p (5, x)</code> is quoted; this is 
different than just quoting the function name using <code>'legendre_p (5, <var>x</var>)</code>.
</p>
<hr size="6">
<a name="SEC223"></a>
<table cellpadding="1" cellspacing="1" border="0">
<tr><td valign="middle" align="left">[<a href="#SEC222" title="Previous section in reading order"> &lt; </a>]</td>
<td valign="middle" align="left">[<a href="#SEC224" title="Next section in reading order"> &gt; </a>]</td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left">[<a href="#SEC217" title="Beginning of this chapter or previous chapter"> &lt;&lt; </a>]</td>
<td valign="middle" align="left">[<a href="#SEC218" title="Up section"> Up </a>]</td>
<td valign="middle" align="left">[<a href="maxima_63.html#SEC226" title="Next chapter"> &gt;&gt; </a>]</td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left">[<a href="maxima.html#SEC_Top" title="Cover (top) of document">Top</a>]</td>
<td valign="middle" align="left">[<a href="maxima_toc.html#SEC_Contents" title="Table of contents">Contents</a>]</td>
<td valign="middle" align="left">[<a href="maxima_72.html#SEC264" title="Index">Index</a>]</td>
<td valign="middle" align="left">[<a href="maxima_abt.html#SEC_About" title="About (help)"> ? </a>]</td>
</tr></table>
<h3 class="subsection"> 62.1.5 Miscellaneous Functions </h3>

<p>The <code>orthopoly</code> package defines the
Pochhammer symbol and a unit step function. <code>orthopoly</code> uses 
the Kronecker delta function and the unit step function in
gradef statements.
</p>
<p>To convert Pochhammer symbols into quotients of gamma functions,
use <code>makegamma</code>.
</p>
<table><tr><td>&nbsp;</td><td><pre class="example">(%i1) makegamma (pochhammer (x, n));
                          gamma(x + n)
(%o1)                     ------------
                            gamma(x)
(%i2) makegamma (pochhammer (1/2, 1/2));
                                1
(%o2)                       ---------
                            sqrt(%pi)
</pre></td></tr></table>
<p>Derivatives of the pochhammer symbol are given in terms of the <code>psi</code>
function.
</p>
<table><tr><td>&nbsp;</td><td><pre class="example">(%i1) diff (pochhammer (x, n), x);
(%o1)             (x)  (psi (x + n) - psi (x))
                     n     0             0
(%i2) diff (pochhammer (x, n), n);
(%o2)                   (x)  psi (x + n)
                           n    0
</pre></td></tr></table>
<p>You need to be careful with the expression in (%o1); the difference of the
<code>psi</code> functions has poles when <code><var>x</var> = -1, -2, .., -<var>n</var></code>. These poles
cancel with factors in <code>pochhammer (<var>x</var>, <var>n</var>)</code> making the derivative a degree
<code><var>n</var> - 1</code> polynomial when <var>n</var> is a positive integer.
</p>
<p>The Pochhammer symbol is defined for negative orders through its
representation as a quotient of gamma functions. Consider
</p>
<table><tr><td>&nbsp;</td><td><pre class="example">(%i1) q : makegamma (pochhammer (x, n));
                          gamma(x + n)
(%o1)                     ------------
                            gamma(x)
(%i2) sublis ([x=11/3, n= -6], q);
                               729
(%o2)                        - ----
                               2240
</pre></td></tr></table>
<p>Alternatively, we can get this result directly.
</p>
<table><tr><td>&nbsp;</td><td><pre class="example">(%i1) pochhammer (11/3, -6);
                               729
(%o1)                        - ----
                               2240
</pre></td></tr></table>
<p>The unit step function is left-continuous; thus
</p>
<table><tr><td>&nbsp;</td><td><pre class="example">(%i1) [unit_step (-1/10), unit_step (0), unit_step (1/10)];
(%o1)                       [0, 0, 1]
</pre></td></tr></table>
<p>If you need a unit step function that is neither left or right continuous
at zero, define your own using signum; for example,
</p>
<table><tr><td>&nbsp;</td><td><pre class="example">(%i1) xunit_step (x) := (1 + signum (x))/2$

(%i2) [xunit_step (-1/10), xunit_step (0), xunit_step (1/10)];
                                1
(%o2)                       [0, -, 1]
                                2
</pre></td></tr></table>
<p>Do not redefine <code>unit_step</code> itself; some code in <code>orthopoly</code>
requires that the unit step function be left-continuous.
</p>
<hr size="6">
<a name="SEC224"></a>
<table cellpadding="1" cellspacing="1" border="0">
<tr><td valign="middle" align="left">[<a href="#SEC223" title="Previous section in reading order"> &lt; </a>]</td>
<td valign="middle" align="left">[<a href="#SEC225" title="Next section in reading order"> &gt; </a>]</td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left">[<a href="#SEC217" title="Beginning of this chapter or previous chapter"> &lt;&lt; </a>]</td>
<td valign="middle" align="left">[<a href="#SEC218" title="Up section"> Up </a>]</td>
<td valign="middle" align="left">[<a href="maxima_63.html#SEC226" title="Next chapter"> &gt;&gt; </a>]</td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left">[<a href="maxima.html#SEC_Top" title="Cover (top) of document">Top</a>]</td>
<td valign="middle" align="left">[<a href="maxima_toc.html#SEC_Contents" title="Table of contents">Contents</a>]</td>
<td valign="middle" align="left">[<a href="maxima_72.html#SEC264" title="Index">Index</a>]</td>
<td valign="middle" align="left">[<a href="maxima_abt.html#SEC_About" title="About (help)"> ? </a>]</td>
</tr></table>
<h3 class="subsection"> 62.1.6 Algorithms </h3>

<p>Generally, <code>orthopoly</code> does symbolic evaluation by using a hypergeometic 
representation of the various orthogonal polynomials. The hypergeometic 
functions are evaluated using the (undocumented) functions <code>hypergeo11</code> 
and <code>hypergeo21</code>. The exceptions are the half-integer Bessel functions 
and the associated Legendre function of the second kind. The Bessel functions are
evaluated using an explicit representation, while the associated Legendre 
function of the second kind is evaluated using recursion.
</p>
<p>For floating point evaluation, we again convert most functions into
a hypergeometic form; we evaluate the hypergeometic functions using 
forward recursion. Again, the exceptions are the half-integer Bessel functions 
and the associated Legendre function of the second kind. Numerically, 
the half-integer Bessel functions are evaluated using the SLATEC code, and the 
associated Legendre functions of the second kind is numerically evaluated using 
the same algorithm as its symbolic evaluation uses.
</p>

<hr size="6">
<a name="Definitions-for-orthogonal-polynomials"></a>
<a name="SEC225"></a>
<table cellpadding="1" cellspacing="1" border="0">
<tr><td valign="middle" align="left">[<a href="#SEC224" title="Previous section in reading order"> &lt; </a>]</td>
<td valign="middle" align="left">[<a href="maxima_63.html#SEC226" title="Next section in reading order"> &gt; </a>]</td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left">[<a href="#SEC217" title="Beginning of this chapter or previous chapter"> &lt;&lt; </a>]</td>
<td valign="middle" align="left">[<a href="#SEC217" title="Up section"> Up </a>]</td>
<td valign="middle" align="left">[<a href="maxima_63.html#SEC226" title="Next chapter"> &gt;&gt; </a>]</td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left">[<a href="maxima.html#SEC_Top" title="Cover (top) of document">Top</a>]</td>
<td valign="middle" align="left">[<a href="maxima_toc.html#SEC_Contents" title="Table of contents">Contents</a>]</td>
<td valign="middle" align="left">[<a href="maxima_72.html#SEC264" title="Index">Index</a>]</td>
<td valign="middle" align="left">[<a href="maxima_abt.html#SEC_About" title="About (help)"> ? </a>]</td>
</tr></table>
<h2 class="section"> 62.2 Definitions for orthogonal polynomials </h2>

<dl>
<dt><u>Function:</u> <b>assoc_legendre_p</b><i> (<var>n</var>, <var>m</var>, <var>x</var>)</i>
<a name="IDX1807"></a>
</dt>
<dd><p>The associated Legendre function of the first kind. 
</p>
<p>Reference: Abramowitz and Stegun, equations 22.5.37, page 779, 8.6.6
(second equation), page 334, and 8.2.5, page 333.
</p></dd></dl>

<dl>
<dt><u>Function:</u> <b>assoc_legendre_q</b><i> (<var>n</var>, <var>m</var>, <var>x</var>)</i>
<a name="IDX1808"></a>
</dt>
<dd><p>The associated Legendre function of the second kind.
</p>
<p>Reference: Abramowitz and Stegun, equation 8.5.3 and 8.1.8.
</p></dd></dl>

<dl>
<dt><u>Function:</u> <b>chebyshev_t</b><i> (<var>n</var>, <var>x</var>)</i>
<a name="IDX1809"></a>
</dt>
<dd><p>The Chebyshev function of the first kind.
</p>
<p>Reference: Abramowitz and Stegun, equation 22.5.47, page 779.
</p></dd></dl>

<dl>
<dt><u>Function:</u> <b>chebyshev_u</b><i> (<var>n</var>, <var>x</var>)</i>
<a name="IDX1810"></a>
</dt>
<dd><p>The Chebyshev function of the second kind.
</p>
<p>Reference: Abramowitz and Stegun, equation 22.5.48, page 779.
</p></dd></dl>

<dl>
<dt><u>Function:</u> <b>gen_laguerre</b><i> (<var>n</var>, <var>a</var>, <var>x</var>)</i>
<a name="IDX1811"></a>
</dt>
<dd><p>The generalized Laguerre polynomial.
</p>
<p>Reference: Abramowitz and Stegun, equation 22.5.54, page 780.
</p></dd></dl>

<dl>
<dt><u>Function:</u> <b>hermite</b><i> (<var>n</var>, <var>x</var>)</i>
<a name="IDX1812"></a>
</dt>
<dd><p>The Hermite polynomial.
</p>
<p>Reference: Abramowitz and Stegun, equation 22.5.55, page 780.
</p></dd></dl>

<dl>
<dt><u>Function:</u> <b>intervalp</b><i> (<var>e</var>)</i>
<a name="IDX1813"></a>
</dt>
<dd><p>Return true if the input is an interval and return false if it isn't. 
</p></dd></dl>

<dl>
<dt><u>Function:</u> <b>jacobi_p</b><i> (<var>n</var>, <var>a</var>, <var>b</var>, <var>x</var>)</i>
<a name="IDX1814"></a>
</dt>
<dd><p>The Jacobi polynomial.
</p>
<p>The Jacobi polynomials are actually defined for all
<var>a</var> and <var>b</var>; however, the Jacobi polynomial
weight <code>(1 - <var>x</var>)^<var>a</var> (1 + <var>x</var>)^<var>b</var></code> isn't integrable for <code><var>a</var> &lt;= -1</code> or
<code><var>b</var> &lt;= -1</code>. 
</p>
<p>Reference: Abramowitz and Stegun, equation 22.5.42, page 779.
</p></dd></dl>

<dl>
<dt><u>Function:</u> <b>laguerre</b><i> (<var>n</var>, <var>x</var>)</i>
<a name="IDX1815"></a>
</dt>
<dd><p>The Laguerre polynomial.
</p>
<p>Reference: Abramowitz and Stegun, equations 22.5.16 and 22.5.54, page 780.
</p></dd></dl>

<dl>
<dt><u>Function:</u> <b>legendre_p</b><i> (<var>n</var>, <var>x</var>)</i>
<a name="IDX1816"></a>
</dt>
<dd><p>The Legendre polynomial of the first kind.
</p>
<p>Reference: Abramowitz and Stegun, equations 22.5.50 and 22.5.51, page 779.
</p></dd></dl>

<dl>
<dt><u>Function:</u> <b>legendre_q</b><i> (<var>n</var>, <var>x</var>)</i>
<a name="IDX1817"></a>
</dt>
<dd><p>The Legendre polynomial of the first kind.
</p>
<p>Reference: Abramowitz and Stegun, equations 8.5.3 and 8.1.8.
</p></dd></dl>

<dl>
<dt><u>Function:</u> <b>orthopoly_recur</b><i> (<var>f</var>, <var>args</var>)</i>
<a name="IDX1818"></a>
</dt>
<dd><p>Returns a recursion relation for the orthogonal function family
<var>f</var> with arguments <var>args</var>. The recursion is with 
respect to the polynomial degree.
</p>
<table><tr><td>&nbsp;</td><td><pre class="example">(%i1) orthopoly_recur (legendre_p, [n, x]);
                (2 n - 1) P     (x) x + (1 - n) P     (x)
                           n - 1                 n - 2
(%o1)   P (x) = -----------------------------------------
         n                          n
</pre></td></tr></table>
<p>The second argument to <code>orthopoly_recur</code> must be a list with the 
correct number of arguments for the function <var>f</var>; if it isn't, 
Maxima signals an error.
</p>
<table><tr><td>&nbsp;</td><td><pre class="example">(%i1) orthopoly_recur (jacobi_p, [n, x]);

Function jacobi_p needs 4 arguments, instead it received 2
 -- an error.  Quitting.  To debug this try debugmode(true);
</pre></td></tr></table>
<p>Additionally, when <var>f</var> isn't the name of one of the 
families of orthogonal polynomials, an error is signalled.
</p>
<table><tr><td>&nbsp;</td><td><pre class="example">(%i1) orthopoly_recur (foo, [n, x]);

A recursion relation for foo isn't known to Maxima
 -- an error.  Quitting.  To debug this try debugmode(true);
</pre></td></tr></table></dd></dl>

<dl>
<dt><u>Variable:</u> <b>orthopoly_returns_intervals</b>
<a name="IDX1819"></a>
</dt>
<dd><p>Default value: <code>true</code>
</p>
<p>When <code>orthopoly_returns_intervals</code> is true, floating point results are returned in
the form <code>interval (<var>c</var>, <var>r</var>)</code>, where <var>c</var> is the center of an interval
and <var>r</var> is its radius. The center can be a complex number; in that
case, the interval is a disk in the complex plane.
</p></dd></dl>

<dl>
<dt><u>Function:</u> <b>orthopoly_weight</b><i> (<var>f</var>, <var>args</var>)</i>
<a name="IDX1820"></a>
</dt>
<dd><p>Returns a three element list; the first element is 
the formula of the weight for the orthogonal polynomial family
<var>f</var> with arguments given by the list <var>args</var>; the 
second and third elements give the lower and upper endpoints
of the interval of orthogonality. For example,
</p>
<table><tr><td>&nbsp;</td><td><pre class="example">(%i1) w : orthopoly_weight (hermite, [n, x]);
                            2
                         - x
(%o1)                 [%e    , - inf, inf]
(%i2) integrate (w[1] * hermite (3, x) * hermite (2, x), x, w[2], w[3]);
(%o2)                           0
</pre></td></tr></table>
<p>The main variable of <var>f</var> must be a symbol; if it isn't, Maxima
signals an error. 
</p>
</dd></dl>

<dl>
<dt><u>Function:</u> <b>pochhammer</b><i> (<var>n</var>, <var>x</var>)</i>
<a name="IDX1821"></a>
</dt>
<dd><p>The Pochhammer symbol. For nonnegative integers <var>n</var> with
<code><var>n</var> &lt;= pochhammer_max_index</code>, the expression <code>pochhammer (<var>x</var>, <var>n</var>)</code> 
evaluates to the product <code><var>x</var> (<var>x</var> + 1) (<var>x</var> + 2) ... (<var>x</var> + n - 1)</code>
when <code><var>n</var> &gt; 0</code> and
to 1 when <code><var>n</var> = 0</code>. For negative <var>n</var>,
<code>pochhammer (<var>x</var>, <var>n</var>)</code> is defined as <code>(-1)^<var>n</var> / pochhammer (1 - <var>x</var>, -<var>n</var>)</code>.
Thus
</p>
<table><tr><td>&nbsp;</td><td><pre class="example">(%i1) pochhammer (x, 3);
(%o1)                   x (x + 1) (x + 2)
(%i2) pochhammer (x, -3);
                                 1
(%o2)               - -----------------------
                      (1 - x) (2 - x) (3 - x)
</pre></td></tr></table>
<p>To convert a Pochhammer symbol into a quotient of gamma functions,
(see Abramowitz and Stegun, equation 6.1.22) use <code>makegamma</code>; for example 
</p>
<table><tr><td>&nbsp;</td><td><pre class="example">(%i1) makegamma (pochhammer (x, n));
                          gamma(x + n)
(%o1)                     ------------
                            gamma(x)
</pre></td></tr></table>
<p>When <var>n</var> exceeds <code>pochhammer_max_index</code> or when <var>n</var> 
is symbolic, <code>pochhammer</code> returns a noun form.
</p>
<table><tr><td>&nbsp;</td><td><pre class="example">(%i1) pochhammer (x, n);
(%o1)                         (x)
                                 n
</pre></td></tr></table></dd></dl>

<dl>
<dt><u>Variable:</u> <b>pochhammer_max_index</b>
<a name="IDX1822"></a>
</dt>
<dd><p>Default value: 100
</p>
<p><code>pochhammer (<var>n</var>, <var>x</var>)</code> expands to a product if and only if
<code><var>n</var> &lt;= pochhammer_max_index</code>.
</p>
<p>Examples:
</p>
<table><tr><td>&nbsp;</td><td><pre class="example">(%i1) pochhammer (x, 3), pochhammer_max_index : 3;
(%o1)                   x (x + 1) (x + 2)
(%i2) pochhammer (x, 4), pochhammer_max_index : 3;
(%o2)                         (x)
                                 4
</pre></td></tr></table>
<p>Reference: Abramowitz and Stegun, equation 6.1.16, page 256.
</p></dd></dl>

<dl>
<dt><u>Function:</u> <b>spherical_bessel_j</b><i> (<var>n</var>, <var>x</var>)</i>
<a name="IDX1823"></a>
</dt>
<dd><p>The spherical Bessel function of the first kind.
</p>
<p>Reference: Abramowitz and Stegun, equations 10.1.8, page 437 and 10.1.15, page 439.
</p></dd></dl>

<dl>
<dt><u>Function:</u> <b>spherical_bessel_y</b><i> (<var>n</var>, <var>x</var>)</i>
<a name="IDX1824"></a>
</dt>
<dd><p>The spherical Bessel function of the second kind. 
</p>
<p>Reference: Abramowitz and Stegun, equations 10.1.9, page 437 and 10.1.15, page 439.
</p></dd></dl>

<dl>
<dt><u>Function:</u> <b>spherical_hankel1</b><i> (<var>n</var>, <var>x</var>)</i>
<a name="IDX1825"></a>
</dt>
<dd><p>The spherical hankel function of the
first kind.
</p>
<p>Reference: Abramowitz and Stegun, equation 10.1.36, page 439.
</p></dd></dl>

<dl>
<dt><u>Function:</u> <b>spherical_hankel2</b><i> (<var>n</var>, <var>x</var>)</i>
<a name="IDX1826"></a>
</dt>
<dd><p>The spherical hankel function of the second kind.
</p>
<p>Reference: Abramowitz and Stegun, equation 10.1.17, page 439.
</p></dd></dl>

<dl>
<dt><u>Function:</u> <b>spherical_harmonic</b><i> (<var>n</var>, <var>m</var>, <var>x</var>, <var>y</var>)</i>
<a name="IDX1827"></a>
</dt>
<dd><p>The spherical harmonic function.
</p>
<p>Reference: Merzbacher 9.64.
</p></dd></dl>

<dl>
<dt><u>Function:</u> <b>unit_step</b><i> (<var>x</var>)</i>
<a name="IDX1828"></a>
</dt>
<dd><p>The left-continuous unit step function; thus
<code>unit_step (<var>x</var>)</code> vanishes for <code><var>x</var> &lt;= 0</code> and equals
1 for <code><var>x</var> &gt; 0</code>.
</p>
<p>If you want a unit step function that
takes on the value 1/2 at zero, use <code>(1 + signum (<var>x</var>))/2</code>.
</p></dd></dl>

<dl>
<dt><u>Function:</u> <b>ultraspherical</b><i> (<var>n</var>, <var>a</var>, <var>x</var>)</i>
<a name="IDX1829"></a>
</dt>
<dd><p>The ultraspherical polynomial (also known the Gegenbauer polynomial).
</p>
<p>Reference: Abramowitz and Stegun, equation 22.5.46, page 779.
</p></dd></dl>

<hr size="6">
<table cellpadding="1" cellspacing="1" border="0">
<tr><td valign="middle" align="left">[<a href="#SEC217" title="Beginning of this chapter or previous chapter"> &lt;&lt; </a>]</td>
<td valign="middle" align="left">[<a href="maxima_63.html#SEC226" title="Next chapter"> &gt;&gt; </a>]</td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left">[<a href="maxima.html#SEC_Top" title="Cover (top) of document">Top</a>]</td>
<td valign="middle" align="left">[<a href="maxima_toc.html#SEC_Contents" title="Table of contents">Contents</a>]</td>
<td valign="middle" align="left">[<a href="maxima_72.html#SEC264" title="Index">Index</a>]</td>
<td valign="middle" align="left">[<a href="maxima_abt.html#SEC_About" title="About (help)"> ? </a>]</td>
</tr></table>
<p>
 <font size="-1">
  This document was generated by <em>Robert Dodier</em> on <em>September, 20 2006</em> using <a href="http://texi2html.cvshome.org/"><em>texi2html 1.76</em></a>.
 </font>
 <br>

</p>
</body>
</html>