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 1267 1268 1269 1270 1271 1272 1273 1274 1275 1276 1277 1278 1279 1280 1281 1282 1283 1284 1285 1286 1287
|
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<!-- Created by GNU Texinfo 5.1, http://www.gnu.org/software/texinfo/ -->
<head>
<title>Maxima 5.47.0 Manual: Gamma and Factorial Functions</title>
<meta name="description" content="Maxima 5.47.0 Manual: Gamma and Factorial Functions">
<meta name="keywords" content="Maxima 5.47.0 Manual: Gamma and Factorial Functions">
<meta name="resource-type" content="document">
<meta name="distribution" content="global">
<meta name="Generator" content="makeinfo">
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<link href="maxima_toc.html#Top" rel="start" title="Top">
<link href="maxima_423.html#Function-and-Variable-Index" rel="index" title="Function and Variable Index">
<link href="maxima_toc.html#SEC_Contents" rel="contents" title="Table of Contents">
<link href="maxima_83.html#Special-Functions" rel="up" title="Special Functions">
<link href="maxima_88.html#Exponential-Integrals" rel="next" title="Exponential Integrals">
<link href="maxima_86.html#Airy-Functions" rel="previous" title="Airy Functions">
<style type="text/css">
<!--
a.summary-letter {text-decoration: none}
blockquote.smallquotation {font-size: smaller}
div.display {margin-left: 3.2em}
div.example {margin-left: 3.2em}
div.indentedblock {margin-left: 3.2em}
div.lisp {margin-left: 3.2em}
div.smalldisplay {margin-left: 3.2em}
div.smallexample {margin-left: 3.2em}
div.smallindentedblock {margin-left: 3.2em; font-size: smaller}
div.smalllisp {margin-left: 3.2em}
kbd {font-style:oblique}
pre.display {font-family: inherit}
pre.format {font-family: inherit}
pre.menu-comment {font-family: serif}
pre.menu-preformatted {font-family: serif}
pre.smalldisplay {font-family: inherit; font-size: smaller}
pre.smallexample {font-size: smaller}
pre.smallformat {font-family: inherit; font-size: smaller}
pre.smalllisp {font-size: smaller}
span.nocodebreak {white-space:nowrap}
span.nolinebreak {white-space:nowrap}
span.roman {font-family:serif; font-weight:normal}
span.sansserif {font-family:sans-serif; font-weight:normal}
ul.no-bullet {list-style: none}
body {color: black; background: white; margin-left: 8%; margin-right: 13%;
font-family: "FreeSans", sans-serif}
h1 {font-size: 150%; font-family: "FreeSans", sans-serif}
h2 {font-size: 125%; font-family: "FreeSans", sans-serif}
h3 {font-size: 100%; font-family: "FreeSans", sans-serif}
a[href] {color: rgb(0,0,255); text-decoration: none;}
a[href]:hover {background: rgb(220,220,220);}
div.textbox {border: solid; border-width: thin; 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);}
pre.example {border: 1px solid rgb(180,180,180); padding-top: 1em;
padding-bottom: 1em; padding-left: 1em; padding-right: 1em;
background-color: rgb(238,238,255)}
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: 1em; padding-bottom: 1em;
padding-left: 1em; padding-right: 1em; background: rgb(247,242,220)}
img {max-width:80%; max-height: 80%; display: block; margin-left: auto; margin-right: auto}
-->
</style>
<link rel="icon" href="figures/favicon.ico">
<script src="https://polyfill.io/v3/polyfill.min.js?features=es6>"></script>
<script id="MathJax-script" async src="https://cdn.jsdelivr.net/npm/mathjax@3/es5/tex-mml-chtml.js"></script>
</head>
<body lang="en" bgcolor="#FFFFFF" text="#000000" link="#0000FF" vlink="#800080" alink="#FF0000">
<a name="Gamma-and-Factorial-Functions"></a>
<div class="header">
<p>
Next: <a href="maxima_88.html#Exponential-Integrals" accesskey="n" rel="next">Exponential Integrals</a>, Previous: <a href="maxima_86.html#Airy-Functions" accesskey="p" rel="previous">Airy Functions</a>, Up: <a href="maxima_83.html#Special-Functions" accesskey="u" rel="up">Special Functions</a> [<a href="maxima_toc.html#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="maxima_423.html#Function-and-Variable-Index" title="Index" rel="index">Index</a>]</p>
</div>
<a name="Gamma-and-Factorial-Functions-1"></a>
<h3 class="section">15.4 Gamma and Factorial Functions</h3>
<p>The gamma function and the related beta, psi and incomplete gamma
functions are defined in Abramowitz and Stegun,
<i>Handbook of Mathematical Functions</i>, Chapter 6.
</p>
<a name="bffac"></a><a name="Item_003a-Special_002fdeffn_002fbffac"></a><dl>
<dt><a name="index-bffac"></a>Function: <strong>bffac</strong> <em>(<var>expr</var>, <var>n</var>)</em></dt>
<dd>
<p>Bigfloat version of the factorial (shifted gamma)
function. The second argument is how many digits to retain and return,
it’s a good idea to request a couple of extra.
</p>
<div class="example">
<pre class="example">(%i1) bffac(1/2,16);
(%o1) 8.862269254527584b-1
(%i2) (1/2)!,numer;
(%o2) 0.886226925452758
(%i3) bffac(1/2,32);
(%o3) 8.862269254527580136490837416707b-1
</pre></div>
<div class=categorybox>
Categories:<a href="maxima_424.html#Category_003a-Gamma-and-factorial-functions">Gamma and factorial functions</a>
·<a href="maxima_424.html#Category_003a-Numerical-evaluation">Numerical evaluation</a>
·</div></dd></dl>
<a name="bfpsi"></a><a name="Item_003a-Special_002fdeffn_002fbfpsi"></a><dl>
<dt><a name="index-bfpsi"></a>Function: <strong>bfpsi</strong> <em>(<var>n</var>, <var>z</var>, <var>fpprec</var>)</em></dt>
<dd><a name="Item_003a-Special_002fdeffn_002fbfpsi0"></a></dd><dt><a name="index-bfpsi0"></a>Function: <strong>bfpsi0</strong> <em>(<var>z</var>, <var>fpprec</var>)</em></dt>
<dd>
<p><code>bfpsi</code> is the polygamma function of real argument <var>z</var> and
integer order <var>n</var>. See <a href="#polygamma">psi</a> for further
information. <code>bfpsi0</code> is the digamma function.
<code>bfpsi0(<var>z</var>, <var>fpprec</var>)</code> is equivalent to <code>bfpsi(0,
<var>z</var>, <var>fpprec</var>)</code>.
</p>
<p>These functions return bigfloat values.
<var>fpprec</var> is the bigfloat precision of the return value.
</p>
<div class="example">
<pre class="example">(%i1) bfpsi0(1/3, 15);
(%o1) - 3.13203378002081b0
(%i2) bfpsi0(1/3, 32);
(%o2) - 3.1320337800208063229964190742873b0
(%i3) bfpsi(0,1/3,32);
(%o3) - 3.1320337800208063229964190742873b0
(%i4) psi[0](1/3);
3 log(3) %pi
(%o4) (- --------) - --------- - %gamma
2 2 sqrt(3)
(%i5) float(%);
(%o5) - 3.132033780020806
</pre></div>
<div class=categorybox>
Categories:<a href="maxima_424.html#Category_003a-Gamma-and-factorial-functions">Gamma and factorial functions</a>
·<a href="maxima_424.html#Category_003a-Numerical-evaluation">Numerical evaluation</a>
·</div></dd></dl>
<a name="cbffac"></a><a name="Item_003a-Special_002fdeffn_002fcbffac"></a><dl>
<dt><a name="index-cbffac"></a>Function: <strong>cbffac</strong> <em>(<var>z</var>, <var>fpprec</var>)</em></dt>
<dd><p>Complex bigfloat factorial.
</p>
<p><code>load ("bffac")</code> loads this function.
</p>
<div class="example">
<pre class="example">(%i1) cbffac(1+%i,16);
(%o1) 3.430658398165453b-1 %i + 6.529654964201666b-1
(%i2) (1+%i)!,numer;
(%o2) 0.3430658398165453 %i + 0.6529654964201667
</pre></div>
<div class=categorybox>
Categories:<a href="maxima_424.html#Category_003a-Gamma-and-factorial-functions">Gamma and factorial functions</a>
·<a href="maxima_424.html#Category_003a-Complex-variables">Complex variables</a>
·<a href="maxima_424.html#Category_003a-Numerical-evaluation">Numerical evaluation</a>
·</div></dd></dl>
<a name="gamma"></a><a name="Item_003a-Special_002fdeffn_002fgamma"></a><dl>
<dt><a name="index-gamma"></a>Function: <strong>gamma</strong> <em>(<var>z</var>)</em></dt>
<dd>
<p>The basic definition of the gamma function (<a href="https://dlmf.nist.gov/5.2.E1">DLMF 5.2.E1</a> and <a href="https://personal.math.ubc.ca/~cbm/aands/page_255.htm">A&S eqn 6.1.1</a>) is
</p>
$$
\Gamma\left(z\right)=\int_{0}^{\infty }{t^{z-1}\,e^ {- t }\;dt}
$$
<p>Maxima simplifies <code>gamma</code> for positive integer and positive and negative
rational numbers. For half integral values the result is a rational number
times
\(\sqrt{\pi}\). The simplification for integer values is controlled by
<code>factlim</code>. For integers greater than <code>factlim</code> the numerical result of
the factorial function, which is used to calculate <code>gamma</code>, will overflow.
The simplification for rational numbers is controlled by <code>gammalim</code> to
avoid internal overflow. See <code>factlim</code> and <code>gammalim</code>.
</p>
<p>For negative integers <code>gamma</code> is not defined.
</p>
<p>Maxima can evaluate <code>gamma</code> numerically for real and complex values in float
and bigfloat precision.
</p>
<p><code>gamma</code> has mirror symmetry.
</p>
<p>When <code><a href="#gamma_005fexpand">gamma_expand</a></code> is <code>true</code>, Maxima expands <code>gamma</code> for
arguments <code>z+n</code> and <code>z-n</code> where <code>n</code> is an integer.
</p>
<p>Maxima knows the derivative of <code>gamma</code>.
</p>
<p>Examples:
</p>
<p>Simplification for integer, half integral, and rational numbers:
</p>
<div class="example">
<pre class="example">(%i1) map('gamma,[1,2,3,4,5,6,7,8,9]);
(%o1) [1, 1, 2, 6, 24, 120, 720, 5040, 40320]
(%i2) map('gamma,[1/2,3/2,5/2,7/2]);
sqrt(%pi) 3 sqrt(%pi) 15 sqrt(%pi)
(%o2) [sqrt(%pi), ---------, -----------, ------------]
2 4 8
(%i3) map('gamma,[2/3,5/3,7/3]);
2 1
2 gamma(-) 4 gamma(-)
2 3 3
(%o3) [gamma(-), ----------, ----------]
3 3 9
</pre></div>
<p>Numerical evaluation for real and complex values:
</p>
<div class="example">
<pre class="example">(%i4) map('gamma,[2.5,2.5b0]);
(%o4) [1.329340388179137, 1.3293403881791370205b0]
(%i5) map('gamma,[1.0+%i,1.0b0+%i]);
(%o5) [0.498015668118356 - .1549498283018107 %i,
4.9801566811835604272b-1 - 1.5494982830181068513b-1 %i]
</pre></div>
<p><code>gamma</code> has mirror symmetry:
</p>
<div class="example">
<pre class="example">(%i6) declare(z,complex)$
(%i7) conjugate(gamma(z));
(%o7) gamma(conjugate(z))
</pre></div>
<p>Maxima expands <code>gamma(z+n)</code> and <code>gamma(z-n)</code>, when <code><a href="#gamma_005fexpand">gamma_expand</a></code>
is <code>true</code>:
</p>
<div class="example">
<pre class="example">(%i8) gamma_expand:true$
(%i9) [gamma(z+1),gamma(z-1),gamma(z+2)/gamma(z+1)];
gamma(z)
(%o9) [z gamma(z), --------, z + 1]
z - 1
</pre></div>
<p>The derivative of <code>gamma</code>:
</p>
<div class="example">
<pre class="example">(%i10) diff(gamma(z),z);
(%o10) psi (z) gamma(z)
0
</pre></div>
<p>See also <code><a href="#makegamma">makegamma</a></code>.
</p>
<p>The Euler-Mascheroni constant is <code>%gamma</code>.
</p>
<div class=categorybox>
Categories:<a href="maxima_424.html#Category_003a-Gamma-and-factorial-functions">Gamma and factorial functions</a>
·<a href="maxima_424.html#Category_003a-Special-functions">Special functions</a>
·</div></dd></dl>
<a name="Item_003a-Special_002fdeffn_002flog_005fgamma"></a><dl>
<dt><a name="index-log_005fgamma"></a>Function: <strong>log_gamma</strong> <em>(<var>z</var>)</em></dt>
<dd>
<p>The natural logarithm of the gamma function.
</p>
<div class="example">
<pre class="example">(%i1) gamma(6);
(%o1) 120
(%i2) log_gamma(6);
(%o2) log(120)
(%i3) log_gamma(0.5);
(%o3) 0.5723649429247004
</pre></div>
<div class=categorybox>
Categories:<a href="maxima_424.html#Category_003a-Gamma-and-factorial-functions">Gamma and factorial functions</a>
·<a href="maxima_424.html#Category_003a-Special-functions">Special functions</a>
·</div></dd></dl>
<a name="Item_003a-Special_002fdeffn_002fgamma_005fincomplete_005flower"></a><dl>
<dt><a name="index-gamma_005fincomplete_005flower"></a>Function: <strong>gamma_incomplete_lower</strong> <em>(<var>a</var>, <var>z</var>)</em></dt>
<dd>
<p>The lower incomplete gamma function (<a href="https://dlmf.nist.gov/8.2.E1">DLMF 8.2.E1</a> and <a href="https://personal.math.ubc.ca/~cbm/aands/page_260.htm">A&S eqn 6.5.2</a>):
</p>
$$
\gamma\left(a , z\right)=\int_{0}^{z}{t^{a-1}\,e^ {- t }\;dt}
$$
<p>See also <code><a href="#gamma_005fincomplete">gamma_incomplete</a></code> (upper incomplete gamma function).
</p>
<div class=categorybox>
Categories:<a href="maxima_424.html#Category_003a-Gamma-and-factorial-functions">Gamma and factorial functions</a>
·<a href="maxima_424.html#Category_003a-Special-functions">Special functions</a>
·</div></dd></dl>
<a name="gamma_005fincomplete"></a><a name="Item_003a-Special_002fdeffn_002fgamma_005fincomplete"></a><dl>
<dt><a name="index-gamma_005fincomplete"></a>Function: <strong>gamma_incomplete</strong> <em>(<var>a</var>, <var>z</var>)</em></dt>
<dd>
<p>The incomplete upper gamma function (<a href="https://dlmf.nist.gov/8.2.E2">DLMF 8.2.E2</a> and <a href="https://personal.math.ubc.ca/~cbm/aands/page_260.htm">A&S eqn 6.5.3</a>):
</p>
$$
\Gamma\left(a , z\right)=\int_{z}^{\infty }{t^{a-1}\,e^ {- t }\;dt}
$$
<p>See also <code><a href="#gamma_005fexpand">gamma_expand</a></code> for controlling how
<code>gamma_incomplete</code> is expressed in terms of elementary functions
and <code>erfc</code>.
</p>
<p>Also see the related functions <code><a href="#gamma_005fincomplete_005fregularized">gamma_incomplete_regularized</a></code> and
<code><a href="#gamma_005fincomplete_005fgeneralized">gamma_incomplete_generalized</a></code>.
</p>
<div class=categorybox>
Categories:<a href="maxima_424.html#Category_003a-Gamma-and-factorial-functions">Gamma and factorial functions</a>
·<a href="maxima_424.html#Category_003a-Special-functions">Special functions</a>
·</div></dd></dl>
<a name="gamma_005fincomplete_005fregularized"></a><a name="Item_003a-Special_002fdeffn_002fgamma_005fincomplete_005fregularized"></a><dl>
<dt><a name="index-gamma_005fincomplete_005fregularized"></a>Function: <strong>gamma_incomplete_regularized</strong> <em>(<var>a</var>, <var>z</var>)</em></dt>
<dd>
<p>The regularized incomplete upper gamma function (<a href="https://dlmf.nist.gov/8.2.E4">DLMF 8.2.E4</a>):
</p>
$$
Q\left(a , z\right)={{\Gamma\left(a , z\right)}\over{\Gamma\left(a\right)}}
$$
<p>See also <code><a href="#gamma_005fexpand">gamma_expand</a></code> for controlling how
<code><a href="#gamma_005fincomplete">gamma_incomplete</a></code> is expressed in terms of elementary functions
and <code><a href="maxima_89.html#erfc">erfc</a></code>.
</p>
<p>Also see <code><a href="#gamma_005fincomplete">gamma_incomplete</a></code>.
</p>
<div class=categorybox>
Categories:<a href="maxima_424.html#Category_003a-Gamma-and-factorial-functions">Gamma and factorial functions</a>
·<a href="maxima_424.html#Category_003a-Special-functions">Special functions</a>
·</div></dd></dl>
<a name="gamma_005fincomplete_005fgeneralized"></a><a name="Item_003a-Special_002fdeffn_002fgamma_005fincomplete_005fgeneralized"></a><dl>
<dt><a name="index-gamma_005fincomplete_005fgeneralized"></a>Function: <strong>gamma_incomplete_generalized</strong> <em>(<var>a</var>, <var>z1</var>, <var>z1</var>)</em></dt>
<dd>
<p>The generalized incomplete gamma function.
</p>
$$
\Gamma\left(a , z_{1}, z_{2}\right)=\int_{z_{1}}^{z_{2}}{t^{a-1}\,e^ {- t }\;dt}
$$
<p>Also see <code><a href="#gamma_005fincomplete">gamma_incomplete</a></code> and <code><a href="#gamma_005fincomplete_005fregularized">gamma_incomplete_regularized</a></code>.
</p>
<div class=categorybox>
Categories:<a href="maxima_424.html#Category_003a-Gamma-and-factorial-functions">Gamma and factorial functions</a>
·<a href="maxima_424.html#Category_003a-Special-functions">Special functions</a>
·</div></dd></dl>
<a name="gamma_005fexpand"></a><a name="Item_003a-Special_002fdefvr_002fgamma_005fexpand"></a><dl>
<dt><a name="index-gamma_005fexpand"></a>Option variable: <strong>gamma_expand</strong></dt>
<dd><p>Default value: <code>false</code>
</p>
<p><code>gamma_expand</code> controls expansion of <code><a href="#gamma_005fincomplete">gamma_incomplete</a></code>.
When <code>gamma_expand</code> is <code>true</code>, <code>gamma_incomplete(v,z)</code>
is expanded in terms of
<code>z</code>, <code>exp(z)</code>, and <code><a href="#gamma_005fincomplete">gamma_incomplete</a></code> or <code><a href="maxima_89.html#erfc">erfc</a></code> when possible.
</p>
<div class="example">
<pre class="example">(%i1) gamma_incomplete(2,z);
(%o1) gamma_incomplete(2, z)
(%i2) gamma_expand:true;
(%o2) true
(%i3) gamma_incomplete(2,z);
- z
(%o3) (z + 1) %e
</pre><pre class="example">(%i4) gamma_incomplete(3/2,z);
- z sqrt(%pi) erfc(sqrt(z))
(%o4) sqrt(z) %e + -----------------------
2
</pre><pre class="example">(%i5) gamma_incomplete(4/3,z);
1
gamma_incomplete(-, z)
1/3 - z 3
(%o5) z %e + ----------------------
3
</pre><pre class="example">(%i6) gamma_incomplete(a+2,z);
a - z
(%o6) z (z + a + 1) %e + a (a + 1) gamma_incomplete(a, z)
(%i7) gamma_incomplete(a-2, z);
gamma_incomplete(a, z) a - 2 z 1 - z
(%o7) ---------------------- - z (--------------- + -----) %e
(1 - a) (2 - a) (a - 2) (a - 1) a - 2
</pre></div>
<div class=categorybox>
Categories:<a href="maxima_424.html#Category_003a-Gamma-and-factorial-functions">Gamma and factorial functions</a>
·<a href="maxima_424.html#Category_003a-Simplification-flags-and-variables">Simplification flags and variables</a>
·</div>
</dd></dl>
<a name="gammalim"></a><a name="Item_003a-Special_002fdefvr_002fgammalim"></a><dl>
<dt><a name="index-gammalim"></a>Option variable: <strong>gammalim</strong></dt>
<dd><p>Default value: 10000
</p>
<p><code>gammalim</code> controls simplification of the gamma
function for integral and rational number arguments. If the absolute
value of the argument is not greater than <code>gammalim</code>, then
simplification will occur. Note that the <code>factlim</code> switch controls
simplification of the result of <code>gamma</code> of an integer argument as well.
</p>
<div class=categorybox>
Categories:<a href="maxima_424.html#Category_003a-Gamma-and-factorial-functions">Gamma and factorial functions</a>
·<a href="maxima_424.html#Category_003a-Simplification-flags-and-variables">Simplification flags and variables</a>
·</div>
</dd></dl>
<a name="makegamma"></a><a name="Item_003a-Special_002fdeffn_002fmakegamma"></a><dl>
<dt><a name="index-makegamma"></a>Function: <strong>makegamma</strong> <em>(<var>expr</var>)</em></dt>
<dd><p>Transforms instances of binomial, factorial, and beta
functions in <var>expr</var> into gamma functions.
</p>
<p>See also <code><a href="#makefact">makefact</a></code>.
</p>
<div class="example">
<pre class="example">(%i1) makegamma(binomial(n,k));
gamma(n + 1)
(%o1) -----------------------------
gamma(k + 1) gamma(n - k + 1)
(%i2) makegamma(x!);
(%o2) gamma(x + 1)
(%i3) makegamma(beta(a,b));
gamma(a) gamma(b)
(%o3) -----------------
gamma(b + a)
</pre></div>
<div class=categorybox>
Categories:<a href="maxima_424.html#Category_003a-Gamma-and-factorial-functions">Gamma and factorial functions</a>
·</div></dd></dl>
<a name="beta"></a><a name="Item_003a-Special_002fdeffn_002fbeta"></a><dl>
<dt><a name="index-beta"></a>Function: <strong>beta</strong> <em>(<var>a</var>, <var>b</var>)</em></dt>
<dd><p>The beta function is defined as
$$
{\rm B}(a, b) = {{\Gamma(a) \Gamma(b)}\over{\Gamma(a+b)}}
$$</p>
<p>(<a href="https://dlmf.nist.gov/5.12.E1">DLMF 5.12.E1</a> and <a href="https://personal.math.ubc.ca/~cbm/aands/page_258.htm">A&S eqn 6.2.1</a>).
</p>
<p>Maxima simplifies the beta function for positive integers and rational
numbers, which sum to an integer. When <code>beta_args_sum_to_integer</code> is
<code>true</code>, Maxima simplifies also general expressions which sum to an integer.
</p>
<p>For <var>a</var> or <var>b</var> equal to zero the beta function is not defined.
</p>
<p>In general the beta function is not defined for negative integers as an
argument. The exception is for <var>a=-n</var>, <var>n</var> a positive integer
and <var>b</var> a positive integer with <code>b<=n</code>, it is possible to define an
analytic continuation. Maxima gives for this case a result.
</p>
<p>When <code><a href="#beta_005fexpand">beta_expand</a></code> is <code>true</code>, expressions like <code>beta(a+n,b)</code> and
<code>beta(a-n,b)</code> or <code>beta(a,b+n)</code> and <code>beta(a,b-n)</code> with <code>n</code>
an integer are simplified.
</p>
<p>Maxima can evaluate the beta function for real and complex values in float and
bigfloat precision. For numerical evaluation Maxima uses <code>log_gamma</code>:
</p>
<div class="example">
<pre class="example"> - log_gamma(b + a) + log_gamma(b) + log_gamma(a)
%e
</pre></div>
<p>Maxima knows that the beta function is symmetric and has mirror symmetry.
</p>
<p>Maxima knows the derivatives of the beta function with respect to <var>a</var> or
<var>b</var>.
</p>
<p>To express the beta function as a ratio of gamma functions see <code>makegamma</code>.
</p>
<p>Examples:
</p>
<p>Simplification, when one of the arguments is an integer:
</p>
<div class="example">
<pre class="example">(%i1) [beta(2,3),beta(2,1/3),beta(2,a)];
1 9 1
(%o1) [--, -, ---------]
12 4 a (a + 1)
</pre></div>
<p>Simplification for two rational numbers as arguments which sum to an integer:
</p>
<div class="example">
<pre class="example">(%i2) [beta(1/2,5/2),beta(1/3,2/3),beta(1/4,3/4)];
3 %pi 2 %pi
(%o2) [-----, -------, sqrt(2) %pi]
8 sqrt(3)
</pre></div>
<p>When setting <code>beta_args_sum_to_integer</code> to <code>true</code> more general
expression are simplified, when the sum of the arguments is an integer:
</p>
<div class="example">
<pre class="example">(%i3) beta_args_sum_to_integer:true$
(%i4) beta(a+1,-a+2);
%pi (a - 1) a
(%o4) ------------------
2 sin(%pi (2 - a))
</pre></div>
<p>The possible results, when one of the arguments is a negative integer:
</p>
<div class="example">
<pre class="example">(%i5) [beta(-3,1),beta(-3,2),beta(-3,3)];
1 1 1
(%o5) [- -, -, - -]
3 6 3
</pre></div>
<p><code>beta(a+n,b)</code> or <code>beta(a-n,b)</code> with <code>n</code> an integer simplifies when
<code><a href="#beta_005fexpand">beta_expand</a></code> is <code>true</code>:
</p>
<div class="example">
<pre class="example">(%i6) beta_expand:true$
(%i7) [beta(a+1,b),beta(a-1,b),beta(a+1,b)/beta(a,b+1)];
a beta(a, b) beta(a, b) (b + a - 1) a
(%o7) [------------, ----------------------, -]
b + a a - 1 b
</pre></div>
<p>Beta is not defined, when one of the arguments is zero:
</p>
<div class="example">
<pre class="example">(%i7) beta(0,b);
beta: expected nonzero arguments; found 0, b
-- an error. To debug this try debugmode(true);
</pre></div>
<p>Numerical evaluation for real and complex arguments in float or bigfloat
precision:
</p>
<div class="example">
<pre class="example">(%i8) beta(2.5,2.3);
(%o8) .08694748611299981
(%i9) beta(2.5,1.4+%i);
(%o9) 0.0640144950796695 - .1502078053286415 %i
(%i10) beta(2.5b0,2.3b0);
(%o10) 8.694748611299969b-2
(%i11) beta(2.5b0,1.4b0+%i);
(%o11) 6.401449507966944b-2 - 1.502078053286415b-1 %i
</pre></div>
<p>Beta is symmetric and has mirror symmetry:
</p>
<div class="example">
<pre class="example">(%i14) beta(a,b)-beta(b,a);
(%o14) 0
(%i15) declare(a,complex,b,complex)$
(%i16) conjugate(beta(a,b));
(%o16) beta(conjugate(a), conjugate(b))
</pre></div>
<p>The derivative of the beta function wrt <code>a</code>:
</p>
<div class="example">
<pre class="example">(%i17) diff(beta(a,b),a);
(%o17) - beta(a, b) (psi (b + a) - psi (a))
0 0
</pre></div>
<div class=categorybox>
Categories:<a href="maxima_424.html#Category_003a-Gamma-and-factorial-functions">Gamma and factorial functions</a>
·</div></dd></dl>
<a name="Item_003a-Special_002fdeffn_002fbeta_005fincomplete"></a><dl>
<dt><a name="index-beta_005fincomplete"></a>Function: <strong>beta_incomplete</strong> <em>(<var>a</var>, <var>b</var>, <var>z</var>)</em></dt>
<dd>
<p>The basic definition of the incomplete beta function
(<a href="https://dlmf.nist.gov/8.17.E1">DLMF 8.17.E1</a> and <a href="https://personal.math.ubc.ca/~cbm/aands/page_263.htm">A&S eqn 6.6.1</a>) is
</p>
$$
{\rm B}_z(a,b) = \int_0^z t^{a-1}(1-t)^{b-1}\; dt
$$
<p>This definition is possible for
\({\rm Re}(a) > 0\) and
\({\rm Re}(b) > 0\) and
\(|z| < 1\).
For other values the incomplete beta function can be
defined through a generalized hypergeometric function:
</p>
<div class="example">
<pre class="example"> gamma(a) hypergeometric_generalized([a, 1 - b], [a + 1], z) z
</pre></div>
<p>(See <a href="https://functions.wolfram.com/GammaBetaErf/Beta3/">https://functions.wolfram.com/GammaBetaErf/Beta3/</a> for a complete definition of the incomplete beta
function.)
</p>
<p>For negative integers <em>a = -n</em> and positive integers <em>b=m</em> with
\(m \le n\) the incomplete beta function is defined through
</p>
$$
z^{n-1}\sum_{k=0}^{m-1} {{(1-m)_k z^k} \over {k! (n-k)}}
$$
<p>Maxima uses this definition to simplify <code>beta_incomplete</code> for <var>a</var> a
negative integer.
</p>
<p>For <var>a</var> a positive integer, <code>beta_incomplete</code> simplifies for any
argument <var>b</var> and <var>z</var> and for <var>b</var> a positive integer for any
argument <var>a</var> and <var>z</var>, with the exception of <var>a</var> a negative integer.
</p>
<p>For <em>z=0</em> and
\({\rm Re}(a) > 0\), <code>beta_incomplete</code> has the
specific value zero. For <em>z=1</em> and
\({\rm Re}(b) > 0\),
<code>beta_incomplete</code> simplifies to the beta function <code>beta(a,b)</code>.
</p>
<p>Maxima evaluates <code>beta_incomplete</code> numerically for real and complex values
in float or bigfloat precision. For the numerical evaluation an expansion of the
incomplete beta function in continued fractions is used.
</p>
<p>When the option variable <code><a href="#beta_005fexpand">beta_expand</a></code> is <code>true</code>, Maxima expands
expressions like <code>beta_incomplete(a+n,b,z)</code> and
<code>beta_incomplete(a-n,b,z)</code> where n is a positive integer.
</p>
<p>Maxima knows the derivatives of <code>beta_incomplete</code> with respect to the
variables <var>a</var>, <var>b</var> and <var>z</var> and the integral with respect to the
variable <var>z</var>.
</p>
<p>Examples:
</p>
<p>Simplification for <var>a</var> a positive integer:
</p>
<div class="example">
<pre class="example">(%i1) beta_incomplete(2,b,z);
b
1 - (1 - z) (b z + 1)
(%o1) ----------------------
b (b + 1)
</pre></div>
<p>Simplification for <var>b</var> a positive integer:
</p>
<div class="example">
<pre class="example">(%i2) beta_incomplete(a,2,z);
a
(a (1 - z) + 1) z
(%o2) ------------------
a (a + 1)
</pre></div>
<p>Simplification for <var>a</var> and <var>b</var> a positive integer:
</p>
<div class="example">
<pre class="example">(%i3) beta_incomplete(3,2,z);
</pre><pre class="example"> 3
(3 (1 - z) + 1) z
(%o3) ------------------
12
</pre></div>
<p><var>a</var> is a negative integer and <em>b<=(-a)</em>, Maxima simplifies:
</p>
<div class="example">
<pre class="example">(%i4) beta_incomplete(-3,1,z);
1
(%o4) - ----
3
3 z
</pre></div>
<p>For the specific values <em>z=0</em> and <em>z=1</em>, Maxima simplifies:
</p>
<div class="example">
<pre class="example">(%i5) assume(a>0,b>0)$
(%i6) beta_incomplete(a,b,0);
(%o6) 0
(%i7) beta_incomplete(a,b,1);
(%o7) beta(a, b)
</pre></div>
<p>Numerical evaluation in float or bigfloat precision:
</p>
<div class="example">
<pre class="example">(%i8) beta_incomplete(0.25,0.50,0.9);
(%o8) 4.594959440269333
(%i9) fpprec:25$
(%i10) beta_incomplete(0.25,0.50,0.9b0);
(%o10) 4.594959440269324086971203b0
</pre></div>
<p>For <em>abs(z)>1</em> <code>beta_incomplete</code> returns a complex result:
</p>
<div class="example">
<pre class="example">(%i11) beta_incomplete(0.25,0.50,1.7);
(%o11) 5.244115108584249 - 1.45518047787844 %i
</pre></div>
<p>Results for more general complex arguments:
</p>
<div class="example">
<pre class="example">(%i14) beta_incomplete(0.25+%i,1.0+%i,1.7+%i);
(%o14) 2.726960675662536 - .3831175704269199 %i
(%i15) beta_incomplete(1/2,5/4*%i,2.8+%i);
(%o15) 13.04649635168716 %i - 5.802067956270001
(%i16)
</pre></div>
<p>Expansion, when <code><a href="#beta_005fexpand">beta_expand</a></code> is <code>true</code>:
</p>
<div class="example">
<pre class="example">(%i23) beta_incomplete(a+1,b,z),beta_expand:true;
b a
a beta_incomplete(a, b, z) (1 - z) z
(%o23) -------------------------- - -----------
b + a b + a
(%i24) beta_incomplete(a-1,b,z),beta_expand:true;
b a - 1
beta_incomplete(a, b, z) (- b - a + 1) (1 - z) z
(%o24) -------------------------------------- - ---------------
1 - a 1 - a
</pre></div>
<p>Derivative and integral for <code>beta_incomplete</code>:
</p>
<div class="example">
<pre class="example">(%i34) diff(beta_incomplete(a, b, z), z);
</pre><pre class="example"> b - 1 a - 1
(%o34) (1 - z) z
</pre><pre class="example">(%i35) integrate(beta_incomplete(a, b, z), z);
b a
(1 - z) z
(%o35) ----------- + beta_incomplete(a, b, z) z
b + a
a beta_incomplete(a, b, z)
- --------------------------
b + a
(%i36) factor(diff(%, z));
(%o36) beta_incomplete(a, b, z)
</pre></div>
<div class=categorybox>
Categories:<a href="maxima_424.html#Category_003a-Gamma-and-factorial-functions">Gamma and factorial functions</a>
·</div></dd></dl>
<a name="beta_005fincomplete_005fregularized"></a><a name="Item_003a-Special_002fdeffn_002fbeta_005fincomplete_005fregularized"></a><dl>
<dt><a name="index-beta_005fincomplete_005fregularized"></a>Function: <strong>beta_incomplete_regularized</strong> <em>(<var>a</var>, <var>b</var>, <var>z</var>)</em></dt>
<dd>
<p>The regularized incomplete beta function (<a href="https://dlmf.nist.gov/8.17.E2">DLMF 8.17.E2</a> and
<a href="https://personal.math.ubc.ca/~cbm/aands/page_263.htm">A&S eqn 6.6.2</a>), defined as
</p>
$$
I_z(a,b) = {{\rm B}_z(a,b)\over {\rm B}(a,b)}
$$
<p>As for <code>beta_incomplete</code> this definition is not complete. See
<a href="https://functions.wolfram.com/GammaBetaErf/BetaRegularized/">https://functions.wolfram.com/GammaBetaErf/BetaRegularized/</a> for a complete definition of
<code>beta_incomplete_regularized</code>.
</p>
<p><code>beta_incomplete_regularized</code> simplifies <var>a</var> or <var>b</var> a positive
integer.
</p>
<p>For <em>z=0</em> and
\({\rm Re}(a)>0\),
<code>beta_incomplete_regularized</code> has
the specific value 0. For <em>z=1</em> and
\({\rm Re}(b) > 0\),
<code>beta_incomplete_regularized</code> simplifies to 1.
</p>
<p>Maxima can evaluate <code>beta_incomplete_regularized</code> for real and complex
arguments in float and bigfloat precision.
</p>
<p>When <code><a href="#beta_005fexpand">beta_expand</a></code> is <code>true</code>, Maxima expands
<code>beta_incomplete_regularized</code> for arguments <em>a+n</em> or <em>a-n</em>,
where n is an integer.
</p>
<p>Maxima knows the derivatives of <code>beta_incomplete_regularized</code> with respect
to the variables <var>a</var>, <var>b</var>, and <var>z</var> and the integral with respect to
the variable <var>z</var>.
</p>
<p>Examples:
</p>
<p>Simplification for <var>a</var> or <var>b</var> a positive integer:
</p>
<div class="example">
<pre class="example">(%i1) beta_incomplete_regularized(2,b,z);
b
(%o1) 1 - (1 - z) (b z + 1)
(%i2) beta_incomplete_regularized(a,2,z);
a
(%o2) (a (1 - z) + 1) z
(%i3) beta_incomplete_regularized(3,2,z);
3
(%o3) (3 (1 - z) + 1) z
</pre></div>
<p>For the specific values <em>z=0</em> and <em>z=1</em>, Maxima simplifies:
</p>
<div class="example">
<pre class="example">(%i4) assume(a>0,b>0)$
(%i5) beta_incomplete_regularized(a,b,0);
(%o5) 0
(%i6) beta_incomplete_regularized(a,b,1);
(%o6) 1
</pre></div>
<p>Numerical evaluation for real and complex arguments in float and bigfloat
precision:
</p>
<div class="example">
<pre class="example">(%i7) beta_incomplete_regularized(0.12,0.43,0.9);
(%o7) .9114011367359802
(%i8) fpprec:32$
(%i9) beta_incomplete_regularized(0.12,0.43,0.9b0);
(%o9) 9.1140113673598075519946998779975b-1
(%i10) beta_incomplete_regularized(1+%i,3/3,1.5*%i);
(%o10) .2865367499935403 %i - 0.122995963334684
(%i11) fpprec:20$
(%i12) beta_incomplete_regularized(1+%i,3/3,1.5b0*%i);
(%o12) 2.8653674999354036142b-1 %i - 1.2299596333468400163b-1
</pre></div>
<p>Expansion, when <code><a href="#beta_005fexpand">beta_expand</a></code> is <code>true</code>:
</p>
<div class="example">
<pre class="example">(%i13) beta_incomplete_regularized(a+1,b,z);
b a
(1 - z) z
(%o13) beta_incomplete_regularized(a, b, z) - ------------
a beta(a, b)
(%i14) beta_incomplete_regularized(a-1,b,z);
(%o14) beta_incomplete_regularized(a, b, z)
b a - 1
(1 - z) z
- ----------------------
beta(a, b) (b + a - 1)
</pre></div>
<p>The derivative and the integral wrt <var>z</var>:
</p>
<div class="example">
<pre class="example">(%i15) diff(beta_incomplete_regularized(a,b,z),z);
b - 1 a - 1
(1 - z) z
(%o15) -------------------
beta(a, b)
(%i16) integrate(beta_incomplete_regularized(a,b,z),z);
(%o16) beta_incomplete_regularized(a, b, z) z
b a
(1 - z) z
a (beta_incomplete_regularized(a, b, z) - ------------)
a beta(a, b)
- -------------------------------------------------------
b + a
</pre></div>
<div class=categorybox>
Categories:<a href="maxima_424.html#Category_003a-Gamma-and-factorial-functions">Gamma and factorial functions</a>
·</div></dd></dl>
<a name="Item_003a-Special_002fdeffn_002fbeta_005fincomplete_005fgeneralized"></a><dl>
<dt><a name="index-beta_005fincomplete_005fgeneralized"></a>Function: <strong>beta_incomplete_generalized</strong> <em>(<var>a</var>, <var>b</var>, <var>z1</var>, <var>z2</var>)</em></dt>
<dd>
<p>The basic definition of the generalized incomplete beta function is
</p>
$$
\int_{z_1}^{z_2} t^{a-1}(1-t)^{b-1}\; dt
$$
<p>Maxima simplifies <code>beta_incomplete_regularized</code> for <var>a</var> and <var>b</var>
a positive integer.
</p>
<p>For
\({\rm Re}(a) > 0\) and
\(z_1 = 0\) or
\(z_2 = 0\), Maxima simplifies
<code>beta_incomplete_generalized</code> to <code>beta_incomplete</code>.
For
\({\rm Re}(b) > 0\) and
\(z_1 = 1\) or
\(z_2 = 1\), Maxima simplifies to an
expression with <code>beta</code> and <code>beta_incomplete</code>.
</p>
<p>Maxima evaluates <code>beta_incomplete_regularized</code> for real and complex values
in float and bigfloat precision.
</p>
<p>When <code><a href="#beta_005fexpand">beta_expand</a></code> is <code>true</code>, Maxima expands
<code>beta_incomplete_generalized</code> for <em>a+n</em> and <em>a-n</em>, <var>n</var> a
positive integer.
</p>
<p>Maxima knows the derivative of <code>beta_incomplete_generalized</code> with respect
to the variables <var>a</var>, <var>b</var>, <var>z1</var>, and <var>z2</var> and the integrals with
respect to the variables <var>z1</var> and <var>z2</var>.
</p>
<p>Examples:
</p>
<p>Maxima simplifies <code>beta_incomplete_generalized</code> for <var>a</var> and <var>b</var> a
positive integer:
</p>
<div class="example">
<pre class="example">(%i1) beta_incomplete_generalized(2,b,z1,z2);
b b
(1 - z1) (b z1 + 1) - (1 - z2) (b z2 + 1)
(%o1) -------------------------------------------
b (b + 1)
(%i2) beta_incomplete_generalized(a,2,z1,z2);
</pre><pre class="example"> a a
(a (1 - z2) + 1) z2 - (a (1 - z1) + 1) z1
(%o2) -------------------------------------------
a (a + 1)
</pre><pre class="example">(%i3) beta_incomplete_generalized(3,2,z1,z2);
2 2 2 2
(1 - z1) (3 z1 + 2 z1 + 1) - (1 - z2) (3 z2 + 2 z2 + 1)
(%o3) -----------------------------------------------------------
12
</pre></div>
<p>Simplification for specific values <em>z1=0</em>, <em>z2=0</em>, <em>z1=1</em>, or
<em>z2=1</em>:
</p>
<div class="example">
<pre class="example">(%i4) assume(a > 0, b > 0)$
(%i5) beta_incomplete_generalized(a,b,z1,0);
(%o5) - beta_incomplete(a, b, z1)
(%i6) beta_incomplete_generalized(a,b,0,z2);
(%o6) - beta_incomplete(a, b, z2)
(%i7) beta_incomplete_generalized(a,b,z1,1);
(%o7) beta(a, b) - beta_incomplete(a, b, z1)
(%i8) beta_incomplete_generalized(a,b,1,z2);
(%o8) beta_incomplete(a, b, z2) - beta(a, b)
</pre></div>
<p>Numerical evaluation for real arguments in float or bigfloat precision:
</p>
<div class="example">
<pre class="example">(%i9) beta_incomplete_generalized(1/2,3/2,0.25,0.31);
(%o9) .09638178086368676
(%i10) fpprec:32$
(%i10) beta_incomplete_generalized(1/2,3/2,0.25,0.31b0);
(%o10) 9.6381780863686935309170054689964b-2
</pre></div>
<p>Numerical evaluation for complex arguments in float or bigfloat precision:
</p>
<div class="example">
<pre class="example">(%i11) beta_incomplete_generalized(1/2+%i,3/2+%i,0.25,0.31);
(%o11) - .09625463003205376 %i - .003323847735353769
(%i12) fpprec:20$
(%i13) beta_incomplete_generalized(1/2+%i,3/2+%i,0.25,0.31b0);
(%o13) - 9.6254630032054178691b-2 %i - 3.3238477353543591914b-3
</pre></div>
<p>Expansion for <em>a+n</em> or <em>a-n</em>, <var>n</var> a positive integer, when
<code><a href="#beta_005fexpand">beta_expand</a></code> is <code>true</code>:
</p>
<div class="example">
<pre class="example">(%i14) beta_expand:true$
(%i15) beta_incomplete_generalized(a+1,b,z1,z2);
b a b a
(1 - z1) z1 - (1 - z2) z2
(%o15) -----------------------------
b + a
a beta_incomplete_generalized(a, b, z1, z2)
+ -------------------------------------------
b + a
(%i16) beta_incomplete_generalized(a-1,b,z1,z2);
beta_incomplete_generalized(a, b, z1, z2) (- b - a + 1)
(%o16) -------------------------------------------------------
1 - a
b a - 1 b a - 1
(1 - z2) z2 - (1 - z1) z1
- -------------------------------------
1 - a
</pre></div>
<p>Derivative wrt the variable <var>z1</var> and integrals wrt <var>z1</var> and <var>z2</var>:
</p>
<div class="example">
<pre class="example">(%i17) diff(beta_incomplete_generalized(a,b,z1,z2),z1);
b - 1 a - 1
(%o17) - (1 - z1) z1
(%i18) integrate(beta_incomplete_generalized(a,b,z1,z2),z1);
(%o18) beta_incomplete_generalized(a, b, z1, z2) z1
+ beta_incomplete(a + 1, b, z1)
(%i19) integrate(beta_incomplete_generalized(a,b,z1,z2),z2);
(%o19) beta_incomplete_generalized(a, b, z1, z2) z2
- beta_incomplete(a + 1, b, z2)
</pre></div>
<div class=categorybox>
Categories:<a href="maxima_424.html#Category_003a-Gamma-and-factorial-functions">Gamma and factorial functions</a>
·</div></dd></dl>
<a name="beta_005fexpand"></a><a name="Item_003a-Special_002fdefvr_002fbeta_005fexpand"></a><dl>
<dt><a name="index-beta_005fexpand"></a>Option variable: <strong>beta_expand</strong></dt>
<dd><p>Default value: false
</p>
<p>When <code>beta_expand</code> is <code>true</code>, <code>beta(a,b)</code> and related
functions are expanded for arguments like <em>a+n</em> or <em>a-n</em>,
where <em>n</em> is an integer.
</p>
<p>See <a href="#beta">beta</a> for examples.
</p>
<div class=categorybox>
Categories:<a href="maxima_424.html#Category_003a-Gamma-and-factorial-functions">Gamma and factorial functions</a>
·<a href="maxima_424.html#Category_003a-Simplification-flags-and-variables">Simplification flags and variables</a>
·</div></dd></dl>
<a name="Item_003a-Special_002fdefvr_002fbeta_005fargs_005fsum_005fto_005finteger"></a><dl>
<dt><a name="index-beta_005fargs_005fsum_005fto_005finteger"></a>Option variable: <strong>beta_args_sum_to_integer</strong></dt>
<dd><p>Default value: false
</p>
<p>When <code>beta_args_sum_to_integer</code> is <code>true</code>, Maxima simplifies
<code>beta(a,b)</code>, when the arguments <var>a</var> and <var>b</var> sum to an integer.
</p>
<p>See <a href="#beta">beta</a> for examples.
</p>
<div class=categorybox>
Categories:<a href="maxima_424.html#Category_003a-Gamma-and-factorial-functions">Gamma and factorial functions</a>
·<a href="maxima_424.html#Category_003a-Simplification-flags-and-variables">Simplification flags and variables</a>
·</div></dd></dl>
<a name="polygamma"></a><a name="Item_003a-Special_002fdeffn_002fpsi"></a><dl>
<dt><a name="index-psi"></a>Function: <strong>psi</strong> <em>[<var>n</var>](<var>x</var>)</em></dt>
<dd>
<p><code>psi[n](x)</code> is the polygamma function (<a href="https://dlmf.nist.gov/5.2E2">DLMF 5.2E2</a>,
<a href="https://dlmf.nist.gov/5.15">DLMF 5.15</a>, <a href="https://personal.math.ubc.ca/~cbm/aands/page_258.htm">A&S eqn 6.3.1</a> and <a href="https://personal.math.ubc.ca/~cbm/aands/page_260.htm">A&S eqn 6.4.1</a>) defined by
$$
\psi^{(n)}(x) = {d^{n+1}\over{dx^{n+1}}} \log\Gamma(x)
$$</p>
<p>Thus, <code>psi[0](<var>x</var>)</code> is the first derivative,
<code>psi[1](<var>x</var>)</code> is the second derivative, etc.
</p>
<p>Maxima can compute some exact values for rational args as well for
float and bfloat args. Several variables control what range of
rational args
\(\psi^{(n)}(x)\)) will return an
exact value, if possible. See <code><a href="#maxpsiposint">maxpsiposint</a></code>,
<code><a href="#maxpsinegint">maxpsinegint</a></code>, <code><a href="#maxpsifracnum">maxpsifracnum</a></code>, and
<code><a href="#maxpsifracdenom">maxpsifracdenom</a></code>. That is, <em>x</em> must lie between
<code>maxpsinegint</code> and <code>maxpsiposint</code>. If the absolute value of
the fractional part of <em>x</em> is rational and has a numerator less
than <code>maxpsifracnum</code> and has a denominator less than
<code>maxpsifracdenom</code>,
\(\psi^{(0)}(x)\) will
return an exact value.
</p>
<p>The function <code><a href="#bfpsi">bfpsi</a></code> in the <code>bffac</code> package can compute
numerical values.
</p>
<div class="example">
<pre class="example">(%i1) psi[0](.25);
(%o1) - 4.227453533376265
(%i2) psi[0](1/4);
%pi
(%o2) (- 3 log(2)) - --- - %gamma
2
(%i3) float(%);
(%o3) - 4.227453533376265
(%i4) psi[2](0.75);
(%o4) - 5.30263321633764
(%i5) psi[2](3/4);
1 3
(%o5) psi (-) + 4 %pi
2 4
(%i6) float(%);
(%o6) - 5.30263321633764
</pre></div>
<div class=categorybox>
Categories:<a href="maxima_424.html#Category_003a-Gamma-and-factorial-functions">Gamma and factorial functions</a>
·</div></dd></dl>
<a name="maxpsiposint"></a><a name="Item_003a-Special_002fdefvr_002fmaxpsiposint"></a><dl>
<dt><a name="index-maxpsiposint"></a>Option variable: <strong>maxpsiposint</strong></dt>
<dd><p>Default value: 20
</p>
<p><code>maxpsiposint</code> is the largest positive integer value for
which
\(\psi^{(n)}(m)\) gives an exact value for
rational <em>x</em>.
</p>
<div class="example">
<pre class="example">(%i1) psi[0](20);
275295799
(%o1) --------- - %gamma
77597520
(%i2) psi[0](21);
(%o2) psi (21)
0
(%i3) psi[2](20);
1683118856778495358491487
(%o3) 2 (------------------------- - zeta(3))
1401731326612193601024000
(%i4) psi[2](21);
(%o4) psi (21)
2
</pre></div>
<div class=categorybox>
Categories:<a href="maxima_424.html#Category_003a-Gamma-and-factorial-functions">Gamma and factorial functions</a>
·</div>
</dd></dl>
<a name="maxpsinegint"></a><a name="Item_003a-Special_002fdefvr_002fmaxpsinegint"></a><dl>
<dt><a name="index-maxpsinegint"></a>Option variable: <strong>maxpsinegint</strong></dt>
<dd><p>Default value: -10
</p>
<p><code>maxpsinegint</code> is the most negative value for
which
\(\psi^{(0)}(x)\) will try to compute an exact
value for rational <em>x</em>. That is if <em>x</em> is less than
<code>maxpsinegint</code>,
\(\psi^{(n)}(x)\) will not
return simplified answer, even if it could.
</p>
<div class="example">
<pre class="example">(%i1) psi[0](-100/9);
100
(%o1) psi (- ---)
0 9
(%i2) psi[0](-100/11);
100 %pi 1 5231385863539
(%o2) %pi cot(-------) + psi (--) + -------------
11 0 11 381905105400
(%i3) psi[2](-100/9);
100
(%o3) psi (- ---)
2 9
(%i4) psi[2](-100/11);
3 100 %pi 2 100 %pi 1
(%o4) 2 %pi cot(-------) csc (-------) + psi (--)
11 11 2 11
74191313259470963498957651385614962459
+ --------------------------------------
27850718060013605318710152732000000
</pre></div>
<div class=categorybox>
Categories:<a href="maxima_424.html#Category_003a-Gamma-and-factorial-functions">Gamma and factorial functions</a>
·</div>
</dd></dl>
<a name="maxpsifracnum"></a><a name="Item_003a-Special_002fdefvr_002fmaxpsifracnum"></a><dl>
<dt><a name="index-maxpsifracnum"></a>Option variable: <strong>maxpsifracnum</strong></dt>
<dd><p>Default value: 6
</p>
<p>Let <em>x</em> be a rational number of the form <em>p/q</em>.
If <em>p</em> is greater than <code>maxpsifracnum</code>,
then
\(\psi^{(0)}(x)\) will not try to
return a simplified value.
</p>
<div class="example">
<pre class="example">(%i1) psi[0](3/4);
%pi
(%o1) (- 3 log(2)) + --- - %gamma
2
(%i2) psi[2](3/4);
1 3
(%o2) psi (-) + 4 %pi
2 4
(%i3) maxpsifracnum:2;
(%o3) 2
(%i4) psi[0](3/4);
3
(%o4) psi (-)
0 4
(%i5) psi[2](3/4);
1 3
(%o5) psi (-) + 4 %pi
2 4
</pre></div>
<div class=categorybox>
Categories:<a href="maxima_424.html#Category_003a-Gamma-and-factorial-functions">Gamma and factorial functions</a>
·</div>
</dd></dl>
<a name="maxpsifracdenom"></a><a name="Item_003a-Special_002fdefvr_002fmaxpsifracdenom"></a><dl>
<dt><a name="index-maxpsifracdenom"></a>Option variable: <strong>maxpsifracdenom</strong></dt>
<dd><p>Default value: 6
</p>
<p>Let <em>x</em> be a rational number of the form <em>p/q</em>.
If <em>q</em> is greater than <code>maxpsifracdenom</code>,
then
\(\psi^{(0)}(x)\) will
not try to return a simplified value.
</p>
<div class="example">
<pre class="example">(%i1) psi[0](3/4);
%pi
(%o1) (- 3 log(2)) + --- - %gamma
2
(%i2) psi[2](3/4);
1 3
(%o2) psi (-) + 4 %pi
2 4
(%i3) maxpsifracdenom:2;
(%o3) 2
(%i4) psi[0](3/4);
3
(%o4) psi (-)
0 4
(%i5) psi[2](3/4);
1 3
(%o5) psi (-) + 4 %pi
2 4
</pre></div>
<div class=categorybox>
Categories:<a href="maxima_424.html#Category_003a-Gamma-and-factorial-functions">Gamma and factorial functions</a>
·</div>
</dd></dl>
<a name="makefact"></a><a name="Item_003a-Special_002fdeffn_002fmakefact"></a><dl>
<dt><a name="index-makefact"></a>Function: <strong>makefact</strong> <em>(<var>expr</var>)</em></dt>
<dd><p>Transforms instances of binomial, gamma, and beta
functions in <var>expr</var> into factorials.
</p>
<p>See also <code><a href="#makegamma">makegamma</a></code>.
</p>
<div class="example">
<pre class="example">(%i1) makefact(binomial(n,k));
n!
(%o1) -----------
k! (n - k)!
(%i2) makefact(gamma(x));
(%o2) (x - 1)!
(%i3) makefact(beta(a,b));
(a - 1)! (b - 1)!
(%o3) -----------------
(b + a - 1)!
</pre></div>
<div class=categorybox>
Categories:<a href="maxima_424.html#Category_003a-Gamma-and-factorial-functions">Gamma and factorial functions</a>
·</div></dd></dl>
<a name="Item_003a-Special_002fdeffn_002fnumfactor"></a><dl>
<dt><a name="index-numfactor"></a>Function: <strong>numfactor</strong> <em>(<var>expr</var>)</em></dt>
<dd><p>Returns the numerical factor multiplying the expression
<var>expr</var>, which should be a single term.
</p>
<p><code><a href="maxima_80.html#content">content</a></code> returns the greatest common divisor (gcd) of all terms in a sum.
</p>
<div class="example">
<pre class="example">(%i1) gamma (7/2);
15 sqrt(%pi)
(%o1) ------------
8
(%i2) numfactor (%);
15
(%o2) --
8
</pre></div>
<div class=categorybox>
Categories:<a href="maxima_424.html#Category_003a-Expressions">Expressions</a>
·</div></dd></dl>
<a name="Item_003a-Special_002fnode_002fExponential-Integrals"></a><hr>
<div class="header">
<p>
Next: <a href="maxima_88.html#Exponential-Integrals" accesskey="n" rel="next">Exponential Integrals</a>, Previous: <a href="maxima_86.html#Airy-Functions" accesskey="p" rel="previous">Airy Functions</a>, Up: <a href="maxima_83.html#Special-Functions" accesskey="u" rel="up">Special Functions</a> [<a href="maxima_toc.html#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="maxima_423.html#Function-and-Variable-Index" title="Index" rel="index">Index</a>]</p>
</div>
</body>
</html>
|