This is maxima.info, produced by makeinfo version 4.0 from maxima.texi. This is a Texinfo Maxima Manual Copyright 1994,2001 William F. Schelter START-INFO-DIR-ENTRY * Maxima: (maxima). A computer algebra system. END-INFO-DIR-ENTRY  File: maxima.info, Node: Introduction to Series, Next: Definitions for Series, Prev: Series, Up: Series Introduction to Series ====================== Maxima contains functions `Taylor' and `Powerseries' for finding the series of differentiable functions. It also has tools such as `Nusum' capable of finding the closed form of some series. Operations such as addition and multiplication work as usual on series. This section presents the various global various variables which control the expansion.  File: maxima.info, Node: Definitions for Series, Prev: Introduction to Series, Up: Series Definitions for Series ====================== - Variable: CAUCHYSUM default: [FALSE] - When multiplying together sums with INF as their upper limit, if SUMEXPAND is TRUE and CAUCHYSUM is set to TRUE then the Cauchy product will be used rather than the usual product. In the Cauchy product the index of the inner summation is a function of the index of the outer one rather than varying independently. That is: SUM(F(I),I,0,INF)*SUM(G(J),J,0,INF) becomes SUM(SUM(F(I)*G(J-I),I,0,J),J,0,INF) - Function: DEFTAYLOR (function, exp) allows the user to define the Taylor series (about 0) of an arbitrary function of one variable as exp which may be a polynomial in that variable or which may be given implicitly as a power series using the SUM function. In order to display the information given to DEFTAYLOR one can use POWERSERIES(F(X),X,0). (see below). (C1) DEFTAYLOR(F(X),X**2+SUM(X**I/(2**I*I!**2), I,4,INF)); (D1) [F] (C2) TAYLOR(%E**SQRT(F(X)),X,0,4); 2 3 4 X 3073 X 12817 X (D2)/R/ 1 + X + -- + ------- + -------- + . . . 2 18432 307200 - Variable: MAXTAYORDER default: [TRUE] - if TRUE, then during algebraic manipulation of (truncated) Taylor series, TAYLOR will try to retain as many terms as are certain to be correct. - Function: NICEINDICES (expr) will take the expression and change all the indices of sums and products to something easily understandable. It makes each index it can "I" , unless "I" is in the internal expression, in which case it sequentially tries J,K,L,M,N,I0,I1,I2,I3,I4,... until it finds a legal index. - Variable: NICEINDICESPREF default: [I,J,K,L,M,N] - the list which NICEINDICES uses to find indices for sums and products. This allows the user to set the order of preference of how NICEINDICES finds the "nice indices". E.g. NICEINDICESPREF:[Q,R,S,T,INDEX]$. Then if NICEINDICES finds that it cannot use any of these as indices in a particular summation, it uses the first as a base to try and tack on numbers. Here, if the list is exhausted, Q0, then Q1, etc, will be tried. - Function: NUSUM (exp,var,low,high) performs indefinite summation of exp with respect to var using a decision procedure due to R.W. Gosper. exp and the potential answer must be expressible as products of nth powers, factorials, binomials, and rational functions. The terms "definite" and "indefinite summation" are used analogously to "definite" and "indefinite integration". To sum indefinitely means to give a closed form for the sum over intervals of variable length, not just e.g. 0 to inf. Thus, since there is no formula for the general partial sum of the binomial series, NUSUM can't do it. - Function: PADE (taylor-series,num-deg-bound,denom-deg-bound) returns a list of all rational functions which have the given taylor-series expansion where the sum of the degrees of the numerator and the denominator is less than or equal to the truncation level of the power series, i.e. are "best" approximants, and which additionally satisfy the specified degree bounds. Its first argument must be a univariate taylor-series; the second and third are positive integers specifying degree bounds on the numerator and denominator. PADE's first argument can also be a Laurent series, and the degree bounds can be INF which causes all rational functions whose total degree is less than or equal to the length of the power series to be returned. Total degree is num-degree + denom-degree. Length of a power series is "truncation level" + 1 - minimum(0,"order of series"). (C15) ff:taylor(1+x+x^2+x^3,x,0,3); 2 3 (D15)/T/ 1 + X + X + X + . . . (C16) pade(ff,1,1); 1 (D16) [- -----] X - 1 (c1) ff:taylor(-(83787*X^10-45552*X^9-187296*X^8 +387072*X^7+86016*X^6-1507328*X^5 +1966080*X^4+4194304*X^3-25165824*X^2 +67108864*X-134217728) /134217728,x,0,10); (C25) PADE(ff,4,4); (D25) [] There is no rational function of degree 4 numerator/denominator, with this power series expansion. You must in general have degree of the numerator and degree of the denominator adding up to at least the degree of the power series, in order to have enough unknown coefficients to solve. (C26) PADE(ff,5,5); (D26) [-(520256329*X^5-96719020632*X^4-489651410240*X^3 -1619100813312*X^2 -2176885157888*X-2386516803584) /(47041365435*X^5+381702613848*X^4+1360678489152*X^3 +2856700692480*X^2 +3370143559680*X+2386516803584)] - Variable: POWERDISP default: [FALSE] - if TRUE will cause sums to be displayed with their terms in the reverse order. Thus polynomials would display as truncated power series, i.e., with the lowest power first. - Function: POWERSERIES (exp, var, pt) generates the general form of the power series expansion for exp in the variable var about the point pt (which may be INF for infinity). If POWERSERIES is unable to expand exp, the TAYLOR function may give the first several terms of the series. VERBOSE[FALSE] - if TRUE will cause comments about the progress of POWERSERIES to be printed as the execution of it proceeds. (C1) VERBOSE:TRUE$ (C2) POWERSERIES(LOG(SIN(X)/X),X,0); Can't expand LOG(SIN(X)) So we'll try again after applying the rule: d / -- (SIN(X)) [ dX LOG(SIN(X)) = I ----------- dX ] SIN(X) / In the first simplification we have returned: / [ I COT(X) dX - LOG(X) ] / INF ==== I1 2 I1 2 I1 \ (- 1) 2 BERN(2 I1) X > ------------------------------ / I1 (2 I1)! ==== I1 = 1 (D2) ------------------------------------- 2 - Variable: PSEXPAND default: [FALSE] - if TRUE will cause extended rational function expressions to display fully expanded. (RATEXPAND will also cause this.) If FALSE, multivariate expressions will be displayed just as in the rational function package. If PSEXPAND:MULTI, then terms with the same total degree in the variables are grouped together. - Function: REVERT (expression,variable) Does reversion of Taylor Series. "Variable" is the variable the original Taylor expansion is in. Do LOAD(REVERT) to access this function. Try REVERT2(expression,variable,hipower) also. REVERT only works on expansions around 0. - Function: SRRAT (exp) this command has been renamed to TAYTORAT. - Function: TAYLOR (exp, var, pt, pow) expands the expression exp in a truncated Taylor series (or Laurent series, if required) in the variable var around the point pt. The terms through (var-pt)**pow are generated. If exp is of the form f(var)/g(var) and g(var) has no terms up to degree pow then TAYLOR will try to expand g(var) up to degree 2*pow. If there are still no non-zero terms TAYLOR will keep doubling the degree of the expansion of g(var) until reaching pow*2**n where n is the value of the variable TAYLORDEPTH[3]. If MAXTAYORDER[FALSE] is set to TRUE, then during algebraic manipulation of (truncated) Taylor series, TAYLOR will try to retain as many terms as are certain to be correct. Do EXAMPLE(TAYLOR); for examples. TAYLOR(exp,[var1,pt1,ord1],[var2,pt2,ord2],...) returns a truncated power series in the variables vari about the points pti, truncated at ordi. PSEXPAND[FALSE] if TRUE will cause extended rational function expressions to display fully expanded. (RATEXPAND will also cause this.) If FALSE, multivariate expressions will be displayed just as in the rational function package. If PSEXPAND:MULTI, then terms with the same total degree in the variables are grouped together. TAYLOR(exp, [var1, var2, . . .], pt, ord) where each of pt and ord may be replaced by a list which will correspond to the list of variables. that is, the nth items on each of the lists will be associated together. TAYLOR(exp, [x,pt,ord,ASYMP]) will give an expansion of exp in negative powers of (x-pt). The highest order term will be (x-pt)^(-ord). The ASYMP is a syntactic device and not to be assigned to. See also the TAYLOR_LOGEXPAND switch for controlling expansion. - Variable: TAYLORDEPTH default: [3] - If there are still no non-zero terms TAYLOR will keep doubling the degree of the expansion of g(var) until reaching pow*2**n where n is the value of the variable TAYLORDEPTH[3]. - Function: TAYLORINFO (exp) returns FALSE if exp is not a Taylor series. Otherwise, a list of lists is returned describing the particulars of the Taylor expansion. For example, (C3) TAYLOR((1-Y^2)/(1-X),X,0,3,[Y,A,INF]); 2 2 (D3)/R/ 1 - A - 2 A (Y - A) - (Y - A) 2 2 + (1 - A - 2 A (Y - A) - (Y - A) ) X 2 2 2 + (1 - A - 2 A (Y - A) - (Y - A) ) X 2 2 3 + (1 - A - 2 A (Y - A) - (Y - A) ) X + . . . (C4) TAYLORINFO(D3); (D4) [[Y, A, INF], [X, 0, 3]] - Function: TAYLORP (exp) a predicate function which returns TRUE if and only if the expression 'exp' is in Taylor series representation. - Variable: TAYLOR_LOGEXPAND default: [TRUE] controls expansions of logarithms in TAYLOR series. When TRUE all log's are expanded fully so that zero-recognition problems involving logarithmic identities do not disturb the expansion process. However, this scheme is not always mathematically correct since it ignores branch information. If TAYLOR_LOGEXPAND is set to FALSE, then the only expansion of log's that will occur is that necessary to obtain a formal power series. - Variable: TAYLOR_ORDER_COEFFICIENTS default: [TRUE] controls the ordering of coefficients in the expression. The default (TRUE) is that coefficients of taylor series will be ordered canonically. - Function: TAYLOR_SIMPLIFIER - A function of one argument which TAYLOR uses to simplify coefficients of power series. - Variable: TAYLOR_TRUNCATE_POLYNOMIALS default: [TRUE] When FALSE polynomials input to TAYLOR are considered to have infinite precison; otherwise (the default) they are truncated based upon the input truncation levels. - Function: TAYTORAT (exp) converts exp from TAYLOR form to CRE form, i.e. it is like RAT(RATDISREP(exp)) although much faster. - Function: TRUNC (exp) causes exp which is in general representation to be displayed as if its sums were truncated Taylor series. E.g. compare EXP1:X^2+X+1; with EXP2:TRUNC(X^2+X+1); . Note that IS(EXP1=EXP2); gives TRUE. - Function: UNSUM (fun,n) is the first backward difference fun(n) - fun(n-1). (C1) G(P):=P*4^N/BINOMIAL(2*N,N); N P 4 (D1) G(P) := ---------------- BINOMIAL(2 N, N) (C2) G(N^4); 4 N N 4 (D2) ---------------- BINOMIAL(2 N, N) (C3) NUSUM(D2,N,0,N); 4 3 2 N 2 (N + 1) (63 N + 112 N + 18 N - 22 N + 3) 4 2 (D3) ------------------------------------------------ - ------ 693 BINOMIAL(2 N, N) 3 11 7 (C4) UNSUM(%,N); 4 N N 4 (D4) ---------------- BINOMIAL(2 N, N) - Variable: VERBOSE default: [FALSE] - if TRUE will cause comments about the progress of POWERSERIES to be printed as the execution of it proceeds.  File: maxima.info, Node: Number Theory, Next: Symmetries, Prev: Series, Up: Top Number Theory ************* * Menu: * Definitions for Number Theory::  File: maxima.info, Node: Definitions for Number Theory, Prev: Number Theory, Up: Number Theory Definitions for Number Theory ============================= - Function: BERN (x) gives the Xth Bernoulli number for integer X. ZEROBERN[TRUE] if set to FALSE excludes the zero BERNOULLI numbers. (See also BURN). - Function: BERNPOLY (v, n) generates the nth Bernoulli polynomial in the variable v. - Function: BFZETA (exp,n) BFLOAT version of the Riemann Zeta function. The 2nd argument is how many digits to retain and return, it's a good idea to request a couple of extra. This function is available by doing LOAD(BFFAC); . - Function: BGZETA (S, FPPREC) BGZETA is like BZETA, but avoids arithmetic overflow errors on large arguments, is faster on medium size arguments (say S=55, FPPREC=69), and is slightly slower on small arguments. It may eventually replace BZETA. BGZETA is available by doing LOAD(BFAC);. - Function: BHZETA (S,H,FPPREC) gives FPPREC digits of SUM((K+H)^-S,K,0,INF) This is available by doing LOAD(BFFAC);. - Function: BINOMIAL (X, Y) the binomial coefficient X*(X-1)*...*(X-Y+1)/Y!. If X and Y are integers, then the numerical value of the binomial coefficient is computed. If Y, or the value X-Y, is an integer, the binomial coefficient is expressed as a polynomial. - Function: BURN (N) is like BERN(N), but without computing all of the uncomputed Bernoullis of smaller index. So BURN works efficiently for large, isolated N. (BERN(402) takes about 645 secs vs 13.5 secs for BURN(402). BERN's time growth seems to be exponential, while BURN's is about cubic. But if next you do BERN(404), it only takes 12 secs, since BERN remembers all in an array, whereas BURN(404) will take maybe 14 secs or maybe 25, depending on whether MACSYMA needs to BFLOAT a better value of %PI.) BURN is available by doing LOAD(BFFAC);. BURN uses an observation of WGD that (rational) Bernoulli numbers can be approximated by (transcendental) zetas with tolerable efficiency. - Function: BZETA - This function is obsolete, see BFZETA. - Function: CF (exp) converts exp into a continued fraction. exp is an expression composed of arithmetic operators and lists which represent continued fractions. A continued fraction a+1/(b+1/(c+...)) is represented by the list [a,b,c,...]. a,b,c,.. must be integers. Exp may also involve SQRT(n) where n is an integer. In this case CF will give as many terms of the continued fraction as the value of the variable CFLENGTH[1] times the period. Thus the default is to give one period. (CF binds LISTARITH to FALSE so that it may carry out its function.) - Function: CFDISREP (list) converts the continued fraction represented by list into general representation. (C1) CF([1,2,-3]+[1,-2,1]); (D1) [1, 1, 1, 2] (C2) CFDISREP(%); 1 (D2) 1 + --------- 1 1 + ----- 1 1 + - 2 - Function: CFEXPAND (x) gives a matrix of the numerators and denominators of the next-to-last and last convergents of the continued fraction x. (C1) CF(SQRT(3)); (D1) [1, 1, 2, 1, 2, 1, 2, 1] (C2) CFEXPAND(%); [71 97] (D2) [ ] [41 56] (C3) D2[1,2]/D2[2,2],NUMER; (D3) 1.7321429 - Variable: CFLENGTH default: [1] controls the number of terms of the continued fraction the function CF will give, as the value CFLENGTH[1] times the period. Thus the default is to give one period. - Function: CGAMMA - The Gamma function in the complex plane. Do LOAD(CGAMMA) to use these functions. Functions Cgamma, Cgamma2, and LogCgamma2. These functions evaluate the Gamma function over the complex plane using the algorithm of Kuki, CACM algorithm 421. Calculations are performed in single precision and the relative error is typically around 1.0E-7; evaluation at one point costs less than 1 msec. The algorithm provides for an error estimate, but the Macsyma implementation currently does not use it. Cgamma is the general function and may be called with a symbolic or numeric argument. With symbolic arguments, it returns as is; with real floating or rational arguments, it uses the Macsyma Gamma function; and for complex numeric arguments, it uses the Kuki algorithm. Cgamma2 of two arguments, real and imaginary, is for numeric arguments only; LogCgamma2 is the same, but the log-gamma function is calculated. These two functions are somewhat more efficient. - Function: CGAMMA2 - See CGAMMA. - Function: DIVSUM (n,k) adds up all the factors of n raised to the kth power. If only one argument is given then k is assumed to be 1. - Function: EULER (X) gives the Xth Euler number for integer X. For the Euler-Mascheroni constant, see %GAMMA. - Function: FACTORIAL (X) The factorial function. FACTORIAL(X) = X! . See also MINFACTORIAL and FACTCOMB. The factorial operator is !, and the double factorial operator is !!. - Function: FIB (X) the Xth Fibonacci number with FIB(0)=0, FIB(1)=1, and FIB(-N)=(-1)^(N+1) *FIB(N). PREVFIB is FIB(X-1), the Fibonacci number preceding the last one computed. - Function: FIBTOPHI (exp) converts FIB(n) to its closed form definition. This involves the constant %PHI (= (SQRT(5)+1)/2 = 1.618033989). If you want the Rational Function Package to know About %PHI do TELLRAT(%PHI^2-%PHI-1)$ ALGEBRAIC:TRUE$ . - Function: INRT (X,n) takes two integer arguments, X and n, and returns the integer nth root of the absolute value of X. - Function: JACOBI (p,q) is the Jacobi symbol of p and q. - Function: LCM (exp1,exp2,...) returns the Least Common Multiple of its arguments. Do LOAD(FUNCTS); to access this function. - Variable: MAXPRIME default: [489318] - the largest number which may be given to the PRIME(n) command, which returns the nth prime. - Function: MINFACTORIAL (exp) examines exp for occurrences of two factorials which differ by an integer. It then turns one into a polynomial times the other. If exp involves binomial coefficients then they will be converted into ratios of factorials. (C1) N!/(N+1)!; N! (D1) -------- (N + 1)! (C2) MINFACTORIAL(%); 1 (D2) ----- N + 1 - Function: PARTFRAC (exp, var) expands the expression exp in partial fractions with respect to the main variable, var. PARTFRAC does a complete partial fraction decomposition. The algorithm employed is based on the fact that the denominators of the partial fraction expansion (the factors of the original denominator) are relatively prime. The numerators can be written as linear combinations of denominators, and the expansion falls out. See EXAMPLE(PARTFRAC); for examples. - Function: PRIME (n) gives the nth prime. MAXPRIME[489318] is the largest number accepted as argument. Note: The PRIME command does not work in maxima, since it required a large file of primes, which most users do not want. PRIMEP does work however. - Function: PRIMEP (n) returns TRUE if n is a prime, FALSE if not. - Function: QUNIT (n) gives the principal unit of the real quadratic number field SQRT(n) where n is an integer, i.e. the element whose norm is unity. This amounts to solving Pell's equation A**2- n*B**2=1. (C1) QUNIT(17); (D1) SQRT(17)+4 (C2) EXPAND(%*(SQRT(17)-4)); (D2) 1 - Function: TOTIENT (n) is the number of integers less than or equal to n which are relatively prime to n. - Variable: ZEROBERN default: [TRUE] - if set to FALSE excludes the zero BERNOULLI numbers. (See the BERN function.) - Function: ZETA (X) gives the Riemann zeta function for certain integer values of X. - Variable: ZETA%PI default: [TRUE] - if FALSE, suppresses ZETA(n) giving coeff*%PI^n for n even.  File: maxima.info, Node: Symmetries, Next: Groups, Prev: Number Theory, Up: Top Symmetries ********** * Menu: * Definitions for Symmetries::