/usr/share/doc/maxima-doc/html/maxima_70.html is in maxima-doc 5.32.1-1.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
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 1066 1067 1068 1069 1070 1071 1072 1073 1074 1075 1076 1077 1078 1079 1080 1081 1082 1083 1084 1085 1086 1087 1088 1089 1090 1091 1092 1093 1094 1095 1096 1097 1098 1099 1100 1101 1102 1103 1104 1105 1106 1107 1108 1109 1110 1111 1112 1113 1114 1115 1116 1117 1118 1119 1120 1121 1122 1123 1124 1125 1126 1127 1128 1129 1130 1131 1132 1133 1134 1135 1136 1137 1138 1139 1140 1141 1142 1143 1144 1145 1146 1147 1148 1149 1150 1151 1152 1153 1154 1155 1156 1157 1158 1159 1160 1161 1162 1163 1164 1165 1166 1167 1168 1169 1170 1171 1172 1173 1174 1175 1176 1177 1178 1179 1180 1181 1182 1183 1184 1185 1186 1187 1188 1189 1190 1191 1192 1193 1194 1195 1196 1197 1198 1199 1200 1201 1202 1203 1204 1205 1206 1207 1208 1209 1210 1211 1212 1213 1214 1215 1216 1217 1218 1219 1220 1221 1222 1223 1224 1225 1226 1227 1228 1229 1230 1231 1232 1233 1234 1235 1236 1237 1238 1239 1240 1241 1242 1243 1244 1245 1246 1247 1248 1249 1250 1251 1252 1253 1254 1255 1256 1257 1258 1259 1260 1261 1262 1263 1264 1265 1266 | <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html401/loose.dtd">
<html>
<!-- Created on January, 10 2014 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 5.32.1 Manual: 70. orthopoly</title>
<meta name="description" content="Maxima 5.32.1 Manual: 70. orthopoly">
<meta name="keywords" content="Maxima 5.32.1 Manual: 70. 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: 1px solid gray;
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 */
background-color: #F1F5F9; /* light blue-gray */
/* font-family: "Lucida Console", monospace */
}
div.spacerbox
{
border: none;
padding-top: 2em;
padding-bottom: 2em
}
div.image
{
margin: 0;
padding: 1em;
text-align: center;
}
div.categorybox
{
border: 1px solid gray;
padding-top: 0px;
padding-bottom: 0px;
padding-left: 1em;
padding-right: 1em;
background: rgb(247,242,220);
}
-->
</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="SEC328"></a>
<table cellpadding="1" cellspacing="1" border="0">
<tr><td valign="middle" align="left">[<a href="maxima_69.html#SEC327" title="Previous section in reading order"> < </a>]</td>
<td valign="middle" align="left">[<a href="#SEC329" title="Next section in reading order"> > </a>]</td>
<td valign="middle" align="left"> </td>
<td valign="middle" align="left">[<a href="maxima_69.html#SEC326" title="Beginning of this chapter or previous chapter"> << </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_71.html#SEC337" title="Next chapter"> >> </a>]</td>
<td valign="middle" align="left"> </td>
<td valign="middle" align="left"> </td>
<td valign="middle" align="left"> </td>
<td valign="middle" align="left"> </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_82.html#SEC380" 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"> 70. orthopoly </h1>
<table class="menu" border="0" cellspacing="0">
<tr><td align="left" valign="top"><a href="#SEC329">70.1 Introduction to orthogonal polynomials</a></td><td> </td><td align="left" valign="top">
</td></tr>
<tr><td align="left" valign="top"><a href="#SEC336">70.2 Functions and Variables for orthogonal polynomials</a></td><td> </td><td align="left" valign="top">
</td></tr>
</table>
<p><a name="Item_003a-Introduction-to-orthogonal-polynomials"></a>
</p><hr size="6">
<a name="Introduction-to-orthogonal-polynomials"></a>
<a name="SEC329"></a>
<table cellpadding="1" cellspacing="1" border="0">
<tr><td valign="middle" align="left">[<a href="#SEC328" title="Previous section in reading order"> < </a>]</td>
<td valign="middle" align="left">[<a href="#SEC330" title="Next section in reading order"> > </a>]</td>
<td valign="middle" align="left"> </td>
<td valign="middle" align="left">[<a href="#SEC328" title="Beginning of this chapter or previous chapter"> << </a>]</td>
<td valign="middle" align="left">[<a href="#SEC328" title="Up section"> Up </a>]</td>
<td valign="middle" align="left">[<a href="maxima_71.html#SEC337" title="Next chapter"> >> </a>]</td>
<td valign="middle" align="left"> </td>
<td valign="middle" align="left"> </td>
<td valign="middle" align="left"> </td>
<td valign="middle" align="left"> </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_82.html#SEC380" 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"> 70.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>
<div class=categorybox>
·
<p>@ref{Category: Orthogonal polynomials} ·
@ref{Category: Share packages} ·
@ref{Category: Package orthopoly}
</div>
</p>
<hr size="6">
<a name="SEC330"></a>
<table cellpadding="1" cellspacing="1" border="0">
<tr><td valign="middle" align="left">[<a href="#SEC329" title="Previous section in reading order"> < </a>]</td>
<td valign="middle" align="left">[<a href="#SEC331" title="Next section in reading order"> > </a>]</td>
<td valign="middle" align="left"> </td>
<td valign="middle" align="left">[<a href="#SEC328" title="Beginning of this chapter or previous chapter"> << </a>]</td>
<td valign="middle" align="left">[<a href="#SEC329" title="Up section"> Up </a>]</td>
<td valign="middle" align="left">[<a href="maxima_71.html#SEC337" title="Next chapter"> >> </a>]</td>
<td valign="middle" align="left"> </td>
<td valign="middle" align="left"> </td>
<td valign="middle" align="left"> </td>
<td valign="middle" align="left"> </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_82.html#SEC380" 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"> 70.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>
<pre class="example">(%i1) legendre_p (3, x);
3 2
5 (1 - x) 15 (1 - x)
(%o1) - ---------- + ----------- - 6 (1 - x) + 1
2 2
</pre>
<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>
<pre class="example">(%i2) [ratsimp (%), rat (%)];
3 3
5 x - 3 x 5 x - 3 x
(%o2)/R/ [----------, ----------]
2 2
</pre>
<p>Alternatively, make the second argument to <code>legendre_p</code> (its "main" variable)
a canonical rational expression (CRE).
</p>
<pre class="example">(%i1) legendre_p (3, rat (x));
3
5 x - 3 x
(%o1)/R/ ----------
2
</pre>
<p>For floating point evaluation, <code>orthopoly</code> uses a running error analysis
to estimate an upper bound for the error. For example,
</p>
<pre class="example">(%i1) jacobi_p (150, 2, 3, 0.2);
(%o1) interval(- 0.062017037936715, 1.533267919277521E-11)
</pre>
<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>
<pre class="example">(%i1) orthopoly_returns_intervals : false;
(%o1) false
(%i2) jacobi_p (150, 2, 3, 0.2);
(%o2) - 0.062017037936715
</pre>
<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>
<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>
<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>
<pre class="example">(%i3) ev (%, n = 0);
(%o3) 0
</pre>
<p>The <code>gradef</code> property only applies to the "main" variable; derivatives with
respect other arguments usually result in an error message; for example
</p>
<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>
<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>
<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>
<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>
<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>
<p>If you evaluate a function at a point outside its domain, generally
<code>orthopoly</code> returns the function unevaluated. For example,
</p>
<pre class="example">(%i1) legendre_p (2/3, x);
(%o1) P (x)
2/3
</pre>
<p><code>orthopoly</code> supports translation into TeX; it also does two-dimensional
output on a terminal.
</p>
<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>
<hr size="6">
<a name="SEC331"></a>
<table cellpadding="1" cellspacing="1" border="0">
<tr><td valign="middle" align="left">[<a href="#SEC330" title="Previous section in reading order"> < </a>]</td>
<td valign="middle" align="left">[<a href="#SEC332" title="Next section in reading order"> > </a>]</td>
<td valign="middle" align="left"> </td>
<td valign="middle" align="left">[<a href="#SEC328" title="Beginning of this chapter or previous chapter"> << </a>]</td>
<td valign="middle" align="left">[<a href="#SEC329" title="Up section"> Up </a>]</td>
<td valign="middle" align="left">[<a href="maxima_71.html#SEC337" title="Next chapter"> >> </a>]</td>
<td valign="middle" align="left"> </td>
<td valign="middle" align="left"> </td>
<td valign="middle" align="left"> </td>
<td valign="middle" align="left"> </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_82.html#SEC380" 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"> 70.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>
<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>
<p>For a specific <var>n</var>, we can reduce the expression to zero.
</p>
<pre class="example">(%i2) ev (% ,n = 10, ratsimp);
(%o2) 0
</pre>
<p>Generally, the polynomial form of an orthogonal polynomial is ill-suited
for floating point evaluation. Here's an example.
</p>
<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>
<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><pre class="example">(%i5) p : expand(p)$
(%i6) subst (0.2, x, p);
(%o6) 0.18413609766122982
</pre>
<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 indiscriminate; if you apply
<code>float</code> to 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>
<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>
<p>The expression in (%o3) will not evaluate to a float; <code>orthopoly</code> 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>
<pre class="example">(%i1) x : pochhammer (1, 10), pochhammer_max_index : 5;
(%o1) (1)
10
</pre>
<p>Applying <code>float</code> doesn't evaluate <var>x</var> to a float
</p>
<pre class="example">(%i2) float (x);
(%o2) (1.0)
10.0
</pre>
<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>
<pre class="example">(%i3) float (x), pochhammer_max_index : 11;
(%o3) 3628800.0
</pre>
<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 <code>orthopoly</code>.
Definitions often differ by a normalization; occasionally, authors
use "shifted" 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>
<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>
<p><a name="Floating-point-Evaluation"></a>
</p><hr size="6">
<a name="SEC332"></a>
<table cellpadding="1" cellspacing="1" border="0">
<tr><td valign="middle" align="left">[<a href="#SEC331" title="Previous section in reading order"> < </a>]</td>
<td valign="middle" align="left">[<a href="#SEC333" title="Next section in reading order"> > </a>]</td>
<td valign="middle" align="left"> </td>
<td valign="middle" align="left">[<a href="#SEC328" title="Beginning of this chapter or previous chapter"> << </a>]</td>
<td valign="middle" align="left">[<a href="#SEC329" title="Up section"> Up </a>]</td>
<td valign="middle" align="left">[<a href="maxima_71.html#SEC337" title="Next chapter"> >> </a>]</td>
<td valign="middle" align="left"> </td>
<td valign="middle" align="left"> </td>
<td valign="middle" align="left"> </td>
<td valign="middle" align="left"> </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_82.html#SEC380" 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"> 70.1.3 Floating point Evaluation </h3>
<p>Most functions in <code>orthopoly</code> 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 example.
</p>
<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>
<p>Let's test that the actual error is smaller than the error estimate
</p>
<pre class="example">(%i4) is (abs (part (y0, 1) - y1) < part (y0, 2));
(%o4) true
</pre>
<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>
<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>
<p>A user could define arithmetic operators that do interval math. To
define interval addition, we can define
</p>
<pre class="example">(%i1) infix ("@+")$
(%i2) "@+"(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>
<p>The special floating point routines get called when the arguments
are complex. For example,
</p>
<pre class="example">(%i1) legendre_p (10, 2 + 3.0*%i);
(%o1) interval(- 3.876378825E+7 %i - 6.0787748E+7,
1.2089173052721777E-6)
</pre>
<p>Let's compare this to the true value.
</p>
<pre class="example">(%i1) float (expand (legendre_p (10, 2 + 3*%i)));
(%o1) - 3.876378825E+7 %i - 6.0787748E+7
</pre>
<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>
<pre class="example">(%i1) ultraspherical (150, 0.5b0, 0.9b0);
(%o1) interval(- 0.043009481257265, 3.3750051301228864E-14)
</pre>
<hr size="6">
<a name="SEC333"></a>
<table cellpadding="1" cellspacing="1" border="0">
<tr><td valign="middle" align="left">[<a href="#SEC332" title="Previous section in reading order"> < </a>]</td>
<td valign="middle" align="left">[<a href="#SEC334" title="Next section in reading order"> > </a>]</td>
<td valign="middle" align="left"> </td>
<td valign="middle" align="left">[<a href="#SEC328" title="Beginning of this chapter or previous chapter"> << </a>]</td>
<td valign="middle" align="left">[<a href="#SEC329" title="Up section"> Up </a>]</td>
<td valign="middle" align="left">[<a href="maxima_71.html#SEC337" title="Next chapter"> >> </a>]</td>
<td valign="middle" align="left"> </td>
<td valign="middle" align="left"> </td>
<td valign="middle" align="left"> </td>
<td valign="middle" align="left"> </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_82.html#SEC380" 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"> 70.1.4 Graphics and <code>orthopoly</code> </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>
<pre class="example">(%i1) plot2d ('(legendre_p (5, x)), [x, 0, 1]),
orthopoly_returns_intervals : false;
(%o1)
</pre>
<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>
<div class=categorybox>
·
<p>@ref{Category: Plotting}
</div>
</p>
<hr size="6">
<a name="SEC334"></a>
<table cellpadding="1" cellspacing="1" border="0">
<tr><td valign="middle" align="left">[<a href="#SEC333" title="Previous section in reading order"> < </a>]</td>
<td valign="middle" align="left">[<a href="#SEC335" title="Next section in reading order"> > </a>]</td>
<td valign="middle" align="left"> </td>
<td valign="middle" align="left">[<a href="#SEC328" title="Beginning of this chapter or previous chapter"> << </a>]</td>
<td valign="middle" align="left">[<a href="#SEC329" title="Up section"> Up </a>]</td>
<td valign="middle" align="left">[<a href="maxima_71.html#SEC337" title="Next chapter"> >> </a>]</td>
<td valign="middle" align="left"> </td>
<td valign="middle" align="left"> </td>
<td valign="middle" align="left"> </td>
<td valign="middle" align="left"> </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_82.html#SEC380" 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"> 70.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
<code>gradef</code> statements.
</p>
<p>To convert Pochhammer symbols into quotients of gamma functions,
use <code>makegamma</code>.
</p>
<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>
<p>Derivatives of the Pochhammer symbol are given in terms of the <code>psi</code>
function.
</p>
<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>
<p>You need to be careful with the expression in (%o1); the difference of the
<code>psi</code> functions has polynomials when <code><var>x</var> = -1, -2, .., -<var>n</var></code>. These polynomials
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>
<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>
<p>Alternatively, we can get this result directly.
</p>
<pre class="example">(%i1) pochhammer (11/3, -6);
729
(%o1) - ----
2240
</pre>
<p>The unit step function is left-continuous; thus
</p>
<pre class="example">(%i1) [unit_step (-1/10), unit_step (0), unit_step (1/10)];
(%o1) [0, 0, 1]
</pre>
<p>If you need a unit step function that is neither left or right continuous
at zero, define your own using <code>signum</code>; for example,
</p>
<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>
<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="SEC335"></a>
<table cellpadding="1" cellspacing="1" border="0">
<tr><td valign="middle" align="left">[<a href="#SEC334" title="Previous section in reading order"> < </a>]</td>
<td valign="middle" align="left">[<a href="#SEC336" title="Next section in reading order"> > </a>]</td>
<td valign="middle" align="left"> </td>
<td valign="middle" align="left">[<a href="#SEC328" title="Beginning of this chapter or previous chapter"> << </a>]</td>
<td valign="middle" align="left">[<a href="#SEC329" title="Up section"> Up </a>]</td>
<td valign="middle" align="left">[<a href="maxima_71.html#SEC337" title="Next chapter"> >> </a>]</td>
<td valign="middle" align="left"> </td>
<td valign="middle" align="left"> </td>
<td valign="middle" align="left"> </td>
<td valign="middle" align="left"> </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_82.html#SEC380" 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"> 70.1.6 Algorithms </h3>
<p>Generally, <code>orthopoly</code> does symbolic evaluation by using a hypergeometic
representation of the 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 half-integer Bessel functions are
evaluated using an explicit representation, and 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.
</p>
<p><a name="Item_003a-Functions-and-Variables-for-orthogonal-polynomials"></a>
</p><hr size="6">
<a name="Functions-and-Variables-for-orthogonal-polynomials"></a>
<a name="SEC336"></a>
<table cellpadding="1" cellspacing="1" border="0">
<tr><td valign="middle" align="left">[<a href="#SEC335" title="Previous section in reading order"> < </a>]</td>
<td valign="middle" align="left">[<a href="maxima_71.html#SEC337" title="Next section in reading order"> > </a>]</td>
<td valign="middle" align="left"> </td>
<td valign="middle" align="left">[<a href="#SEC328" title="Beginning of this chapter or previous chapter"> << </a>]</td>
<td valign="middle" align="left">[<a href="#SEC328" title="Up section"> Up </a>]</td>
<td valign="middle" align="left">[<a href="maxima_71.html#SEC337" title="Next chapter"> >> </a>]</td>
<td valign="middle" align="left"> </td>
<td valign="middle" align="left"> </td>
<td valign="middle" align="left"> </td>
<td valign="middle" align="left"> </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_82.html#SEC380" 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"> 70.2 Functions and Variables for orthogonal polynomials </h2>
<p><a name="Item_003a-assoc_005flegendre_005fp"></a>
</p><dl>
<dt><u>Function:</u> <b>assoc_legendre_p</b><i> (<var>n</var>, <var>m</var>, <var>x</var>)</i>
<a name="IDX2601"></a>
</dt>
<dd><p>The associated Legendre function of the first kind of degree <var>n</var> and
order <var>m</var>.
</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>
<div class=categorybox>
·
<p>@ref{Category: Package orthopoly}
</div>
</p>
</dd></dl>
<p><a name="Item_003a-assoc_005flegendre_005fq"></a>
</p><dl>
<dt><u>Function:</u> <b>assoc_legendre_q</b><i> (<var>n</var>, <var>m</var>, <var>x</var>)</i>
<a name="IDX2602"></a>
</dt>
<dd><p>The associated Legendre function of the second kind of degree <var>n</var>
and order <var>m</var>.
</p>
<p>Reference: Abramowitz and Stegun, equation 8.5.3 and 8.1.8.
</p>
<div class=categorybox>
·
<p>@ref{Category: Package orthopoly}
</div>
</p>
</dd></dl>
<p><a name="Item_003a-chebyshev_005ft"></a>
</p><dl>
<dt><u>Function:</u> <b>chebyshev_t</b><i> (<var>n</var>, <var>x</var>)</i>
<a name="IDX2603"></a>
</dt>
<dd><p>The Chebyshev function of the first kind.
</p>
<p>Reference: Abramowitz and Stegun, equation 22.5.47, page 779.
</p>
<div class=categorybox>
·
<p>@ref{Category: Package orthopoly}
</div>
</p>
</dd></dl>
<p><a name="Item_003a-chebyshev_005fu"></a>
</p><dl>
<dt><u>Function:</u> <b>chebyshev_u</b><i> (<var>n</var>, <var>x</var>)</i>
<a name="IDX2604"></a>
</dt>
<dd><p>The Chebyshev function of the second kind.
</p>
<p>Reference: Abramowitz and Stegun, equation 22.5.48, page 779.
</p>
<div class=categorybox>
·
<p>@ref{Category: Package orthopoly}
</div>
</p>
</dd></dl>
<p><a name="Item_003a-gen_005flaguerre"></a>
</p><dl>
<dt><u>Function:</u> <b>gen_laguerre</b><i> (<var>n</var>, <var>a</var>, <var>x</var>)</i>
<a name="IDX2605"></a>
</dt>
<dd><p>The generalized Laguerre polynomial of degree <var>n</var>.
</p>
<p>Reference: Abramowitz and Stegun, equation 22.5.54, page 780.
</p>
<div class=categorybox>
·
<p>@ref{Category: Package orthopoly}
</div>
</p>
</dd></dl>
<p><a name="Item_003a-hermite"></a>
</p><dl>
<dt><u>Function:</u> <b>hermite</b><i> (<var>n</var>, <var>x</var>)</i>
<a name="IDX2606"></a>
</dt>
<dd><p>The Hermite polynomial.
</p>
<p>Reference: Abramowitz and Stegun, equation 22.5.55, page 780.
</p>
<div class=categorybox>
·
<p>@ref{Category: Package orthopoly}
</div>
</p>
</dd></dl>
<p><a name="Item_003a-intervalp"></a>
</p><dl>
<dt><u>Function:</u> <b>intervalp</b><i> (<var>e</var>)</i>
<a name="IDX2607"></a>
</dt>
<dd><p>Return <code>true</code> if the input is an interval and return false if it isn't.
</p>
<div class=categorybox>
·
<p>@ref{Category: Package orthopoly} ·
@ref{Category: Predicate functions}
</div>
</p>
</dd></dl>
<p><a name="Item_003a-jacobi_005fp"></a>
</p><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="IDX2608"></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> <= -1</code> or
<code><var>b</var> <= -1</code>.
</p>
<p>Reference: Abramowitz and Stegun, equation 22.5.42, page 779.
</p>
<div class=categorybox>
·
<p>@ref{Category: Package orthopoly}
</div>
</p>
</dd></dl>
<p><a name="Item_003a-laguerre"></a>
</p><dl>
<dt><u>Function:</u> <b>laguerre</b><i> (<var>n</var>, <var>x</var>)</i>
<a name="IDX2609"></a>
</dt>
<dd><p>The Laguerre polynomial.
</p>
<p>Reference: Abramowitz and Stegun, equations 22.5.16 and 22.5.54, page 780.
</p>
<div class=categorybox>
·
<p>@ref{Category: Package orthopoly}
</div>
</p>
</dd></dl>
<p><a name="Item_003a-legendre_005fp"></a>
</p><dl>
<dt><u>Function:</u> <b>legendre_p</b><i> (<var>n</var>, <var>x</var>)</i>
<a name="IDX2610"></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>
<div class=categorybox>
·
<p>@ref{Category: Package orthopoly}
</div>
</p>
</dd></dl>
<p><a name="Item_003a-legendre_005fq"></a>
</p><dl>
<dt><u>Function:</u> <b>legendre_q</b><i> (<var>n</var>, <var>x</var>)</i>
<a name="IDX2611"></a>
</dt>
<dd><p>The Legendre polynomial of the second kind.
</p>
<p>Reference: Abramowitz and Stegun, equations 8.5.3 and 8.1.8.
</p>
<div class=categorybox>
·
<p>@ref{Category: Package orthopoly}
</div>
</p>
</dd></dl>
<p><a name="Item_003a-orthopoly_005frecur"></a>
</p><dl>
<dt><u>Function:</u> <b>orthopoly_recur</b><i> (<var>f</var>, <var>args</var>)</i>
<a name="IDX2612"></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>
<pre class="example">(%i1) orthopoly_recur (legendre_p, [n, x]);
(2 n + 1) P (x) x - n P (x)
n n - 1
(%o1) P (x) = -------------------------------
n + 1 n + 1
</pre>
<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>
<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>
<p>Additionally, when <var>f</var> isn't the name of one of the
families of orthogonal polynomials, an error is signalled.
</p>
<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>
<div class=categorybox>
·
<p>@ref{Category: Package orthopoly}
</div>
</p>
</dd></dl>
<p><a name="Item_003a-orthopoly_005freturns_005fintervals"></a>
</p><dl>
<dt><u>Variable:</u> <b>orthopoly_returns_intervals</b>
<a name="IDX2613"></a>
</dt>
<dd><p>Default value: <code>true</code>
</p>
<p>When <code>orthopoly_returns_intervals</code> is <code>true</code>, 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>
<div class=categorybox>
·
<p>@ref{Category: Package orthopoly}
</div>
</p>
</dd></dl>
<p><a name="Item_003a-orthopoly_005fweight"></a>
</p><dl>
<dt><u>Function:</u> <b>orthopoly_weight</b><i> (<var>f</var>, <var>args</var>)</i>
<a name="IDX2614"></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>
<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>
<p>The main variable of <var>f</var> must be a symbol; if it isn't, Maxima
signals an error.
</p>
<div class=categorybox>
·
<p>@ref{Category: Package orthopoly}
</div>
</p>
</dd></dl>
<p><a name="Item_003a-pochhammer"></a>
</p><dl>
<dt><u>Function:</u> <b>pochhammer</b><i> (<var>n</var>, <var>x</var>)</i>
<a name="IDX2615"></a>
</dt>
<dd><p>The Pochhammer symbol. For nonnegative integers <var>n</var> with
<code><var>n</var> <= 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> > 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>
<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>
<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>
<pre class="example">(%i1) makegamma (pochhammer (x, n));
gamma(x + n)
(%o1) ------------
gamma(x)
</pre>
<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>
<pre class="example">(%i1) pochhammer (x, n);
(%o1) (x)
n
</pre>
<div class=categorybox>
·
<p>@ref{Category: Package orthopoly} ·
@ref{Category: Gamma and factorial functions}
</div>
</p>
</dd></dl>
<p><a name="Item_003a-pochhammer_005fmax_005findex"></a>
</p><dl>
<dt><u>Variable:</u> <b>pochhammer_max_index</b>
<a name="IDX2616"></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> <= pochhammer_max_index</code>.
</p>
<p>Examples:
</p>
<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>
<p>Reference: Abramowitz and Stegun, equation 6.1.16, page 256.
</p>
<div class=categorybox>
·
<p>@ref{Category: Package orthopoly} ·
@ref{Category: Gamma and factorial functions}
</div>
</p>
</dd></dl>
<p><a name="Item_003a-spherical_005fbessel_005fj"></a>
</p><dl>
<dt><u>Function:</u> <b>spherical_bessel_j</b><i> (<var>n</var>, <var>x</var>)</i>
<a name="IDX2617"></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>
<div class=categorybox>
·
<p>@ref{Category: Package orthopoly} ·
@ref{Category: Bessel functions}
</div>
</p>
</dd></dl>
<p><a name="Item_003a-spherical_005fbessel_005fy"></a>
</p><dl>
<dt><u>Function:</u> <b>spherical_bessel_y</b><i> (<var>n</var>, <var>x</var>)</i>
<a name="IDX2618"></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>
<div class=categorybox>
·
<p>@ref{Category: Package orthopoly} ·
@ref{Category: Bessel functions}
</div>
</p>
</dd></dl>
<p><a name="Item_003a-spherical_005fhankel1"></a>
</p><dl>
<dt><u>Function:</u> <b>spherical_hankel1</b><i> (<var>n</var>, <var>x</var>)</i>
<a name="IDX2619"></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>
<div class=categorybox>
·
<p>@ref{Category: Package orthopoly} ·
@ref{Category: Bessel functions}
</div>
</p>
</dd></dl>
<p><a name="Item_003a-spherical_005fhankel2"></a>
</p><dl>
<dt><u>Function:</u> <b>spherical_hankel2</b><i> (<var>n</var>, <var>x</var>)</i>
<a name="IDX2620"></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>
<div class=categorybox>
·
<p>@ref{Category: Package orthopoly} ·
@ref{Category: Bessel functions}
</div>
</p>
</dd></dl>
<p><a name="Item_003a-spherical_005fharmonic"></a>
</p><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="IDX2621"></a>
</dt>
<dd><p>The spherical harmonic function.
</p>
<p>Reference: Merzbacher 9.64.
</p>
<div class=categorybox>
·
<p>@ref{Category: Package orthopoly}
</div>
</p>
</dd></dl>
<p><a name="Item_003a-unit_005fstep"></a>
</p><dl>
<dt><u>Function:</u> <b>unit_step</b><i> (<var>x</var>)</i>
<a name="IDX2622"></a>
</dt>
<dd><p>The left-continuous unit step function; thus
<code>unit_step (<var>x</var>)</code> vanishes for <code><var>x</var> <= 0</code> and equals
1 for <code><var>x</var> > 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>
<div class=categorybox>
·
<p>@ref{Category: Package orthopoly} ·
@ref{Category: Mathematical functions}
</div>
</p>
</dd></dl>
<p><a name="Item_003a-ultraspherical"></a>
</p><dl>
<dt><u>Function:</u> <b>ultraspherical</b><i> (<var>n</var>, <var>a</var>, <var>x</var>)</i>
<a name="IDX2623"></a>
</dt>
<dd><p>The ultraspherical polynomial (also known as the Gegenbauer polynomial).
</p>
<p>Reference: Abramowitz and Stegun, equation 22.5.46, page 779.
</p>
<div class=categorybox>
·
<p>@ref{Category: Package orthopoly}
</div>
</p>
</dd></dl>
<p><a name="Item_003a-romberg"></a>
</p><hr size="6">
<table cellpadding="1" cellspacing="1" border="0">
<tr><td valign="middle" align="left">[<a href="#SEC328" title="Beginning of this chapter or previous chapter"> << </a>]</td>
<td valign="middle" align="left">[<a href="maxima_71.html#SEC337" title="Next chapter"> >> </a>]</td>
<td valign="middle" align="left"> </td>
<td valign="middle" align="left"> </td>
<td valign="middle" align="left"> </td>
<td valign="middle" align="left"> </td>
<td valign="middle" align="left"> </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_82.html#SEC380" 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>root</em> on <em>January, 10 2014</em> using <a href="http://texi2html.cvshome.org/"><em>texi2html 1.76</em></a>.
</font>
<br>
</p>
</body>
</html>
|