~ubuntu-branches/ubuntu/karmic/maxima/karmic

« back to all changes in this revision

Viewing changes to doc/info/maxima.info-2

  • Committer: Bazaar Package Importer
  • Author(s): Barry deFreese
  • Date: 2006-07-06 17:04:52 UTC
  • mfrom: (1.1.4 upstream)
  • Revision ID: james.westby@ubuntu.com-20060706170452-j9ypoqc1kjfnz221
Tags: 5.9.3-1ubuntu1
* Re-sync with Debian
* Comment out backward-delete-char-untabify in maxima.el (Closes Malone #5273)
* debian/control: build-dep automake -> automake1.9 (Closes BTS: #374663)

Show diffs side-by-side

added added

removed removed

Lines of Context:
609
609
     `num' evaluates its argument.
610
610
 
611
611
 
 
612
 -- Function: polydecomp (<p>, <x>)
 
613
     Decomposes the polynomial <p> in the variable <x> into the
 
614
     functional composition of polynomials in <x>.  `polydecomp'
 
615
     returns a list `[<p_1>, ..., <p_n>]' such that
 
616
 
 
617
          lambda ([x], p_1) (lambda ([x], p_2) (... (lambda ([x], p_n) (x)) ...))
 
618
 
 
619
     is equal to <p>.  The degree of <p_i> is greater than 1 for <i>
 
620
     less than <n>.
 
621
 
 
622
     Such a decomposition is not unique.
 
623
 
 
624
     Examples:
 
625
 
 
626
          (%i1) polydecomp (x^210, x);
 
627
                                    7   5   3   2
 
628
          (%o1)                   [x , x , x , x ]
 
629
          (%i2) p : expand (subst (x^3 - x - 1, x, x^2 - a));
 
630
                          6      4      3    2
 
631
          (%o2)          x  - 2 x  - 2 x  + x  + 2 x - a + 1
 
632
          (%i3) polydecomp (p, x);
 
633
                                  2       3
 
634
          (%o3)                 [x  - a, x  - x - 1]
 
635
 
 
636
     The following function composes `L = [e_1, ..., e_n]' as functions
 
637
     in `x'; it is the inverse of polydecomp:
 
638
 
 
639
          compose (L, x) :=
 
640
            block ([r : x], for e in L do r : subst (e, x, r), r) $
 
641
 
 
642
     Re-express above example using `compose':
 
643
 
 
644
          (%i3) polydecomp (compose ([x^2 - a, x^3 - x - 1], x), x);
 
645
                                  2       3
 
646
          (%o3)                 [x  - a, x  - x - 1]
 
647
 
 
648
     Note that though `compose (polydecomp (<p>, <x>), <x>)' always
 
649
     returns <p> (unexpanded), `polydecomp (compose ([<p_1>, ...,
 
650
     <p_n>], <x>), <x>)' does not necessarily return `[<p_1>, ...,
 
651
     <p_n>]':
 
652
 
 
653
          (%i4) polydecomp (compose ([x^2 + 2*x + 3, x^2], x), x);
 
654
                                    2       2
 
655
          (%o4)                   [x  + 2, x  + 1]
 
656
          (%i5) polydecomp (compose ([x^2 + x + 1, x^2 + x + 1], x), x);
 
657
                                2       2
 
658
                               x  + 3  x  + 5
 
659
          (%o5)               [------, ------, 2 x + 1]
 
660
                                 4       2
 
661
 
 
662
 
612
663
 -- Function: quotient (<p_1>, <p_2>)
613
664
 -- Function: quotient (<p_1>, <p_2>, <x_1>, ..., <x_n>)
614
665
     Returns the polynomial <p_1> divided by the polynomial <p_2>.  The
1239
1290
==============================
1240
1291
 
1241
1292
 -- Constant: %e
1242
 
     - The base of natural logarithms, e, is represented in Maxima as
 
1293
     - the base of natural logarithms, e, is represented in Maxima as
1243
1294
     `%e'.
1244
1295
 
1245
1296
 
1293
1344
     `logcontract' command "contracts" expressions containing `log'.
1294
1345
 
1295
1346
 
 
1347
 -- Function: li [<s>] (<z>)
 
1348
     Represents the polylogarithm function of order <s> and argument
 
1349
     <z>, defined by the infinite series
 
1350
 
 
1351
                                           inf
 
1352
                                           ====   k
 
1353
                                           \     z
 
1354
                                  Li (z) =  >    --
 
1355
                                    s      /      s
 
1356
                                           ====  k
 
1357
                                           k = 1
 
1358
 
 
1359
     `li [1]' is `- log (1 - z)'.  `li [2]' and `li [3]' are the
 
1360
     dilogarithm and trilogarithm functions, respectively.
 
1361
 
 
1362
     When the order is 1, the polylogarithm simplifies to `- log (1 -
 
1363
     z)', which in turn simplifies to a numerical value if <z> is a
 
1364
     real or complex floating point number or the `numer' evaluation
 
1365
     flag is present.
 
1366
 
 
1367
     When the order is 2 or 3, the polylogarithm simplifies to a
 
1368
     numerical value if <z> is a real floating point number or the
 
1369
     `numer' evaluation flag is present.
 
1370
 
 
1371
     Examples:
 
1372
 
 
1373
          (%i1) assume (x > 0);
 
1374
          (%o1)                        [x > 0]
 
1375
          (%i2) integrate ((log (1 - t)) / t, t, 0, x);
 
1376
          (%o2)                       - li (x)
 
1377
                                          2
 
1378
          (%i3) li [2] (7);
 
1379
          (%o3)                        li (7)
 
1380
                                         2
 
1381
          (%i4) li [2] (7), numer;
 
1382
          (%o4)        1.24827317833392 - 6.113257021832577 %i
 
1383
          (%i5) li [3] (7);
 
1384
          (%o5)                        li (7)
 
1385
                                         3
 
1386
          (%i6) li [2] (7), numer;
 
1387
          (%o6)        1.24827317833392 - 6.113257021832577 %i
 
1388
          (%i7) L : makelist (i / 4.0, i, 0, 8);
 
1389
          (%o7)   [0.0, 0.25, 0.5, 0.75, 1.0, 1.25, 1.5, 1.75, 2.0]
 
1390
          (%i8) map (lambda ([x], li [2] (x)), L);
 
1391
          (%o8) [0, .2676526384986274, .5822405249432515,
 
1392
          .9784693966661848, 1.64493407, 2.190177004178597
 
1393
           - .7010261407036192 %i, 2.374395264042415
 
1394
           - 1.273806203464065 %i, 2.448686757245154
 
1395
           - 1.758084846201883 %i, 2.467401098097648
 
1396
           - 2.177586087815347 %i]
 
1397
          (%i9) map (lambda ([x], li [3] (x)), L);
 
1398
          (%o9) [0, .2584613953442624, 0.537213192678042,
 
1399
          .8444258046482203, 1.2020569, 1.642866878950322
 
1400
           - .07821473130035025 %i, 2.060877505514697
 
1401
           - .2582419849982037 %i, 2.433418896388322
 
1402
           - .4919260182322965 %i, 2.762071904015935
 
1403
           - .7546938285978846 %i]
 
1404
 
 
1405
 
1296
1406
 -- Function: log (<x>)
1297
 
     Represents the natural logarithm of <x>.
 
1407
     Represents the natural (base e) logarithm of <x>.
 
1408
 
 
1409
     Maxima does not have a built-in function for the base 10 logarithm
 
1410
     or other bases.  `log10(x) := log(x) / log(10)' is a useful
 
1411
     definition.
1298
1412
 
1299
1413
     Simplification and evaluation of logarithms is governed by several
1300
1414
     global flags:
1753
1867
 
1754
1868
 
1755
1869
 
1756
 
File: maxima.info,  Node: Special Functions,  Next: Orthogonal Polynomials,  Prev: Trigonometric,  Up: Top
 
1870
File: maxima.info,  Node: Special Functions,  Next: Elliptic Functions,  Prev: Trigonometric,  Up: Top
1757
1871
 
1758
1872
16 Special Functions
1759
1873
********************
2207
2321
 
2208
2322
 
2209
2323
 
2210
 
File: maxima.info,  Node: Orthogonal Polynomials,  Next: Elliptic Functions,  Prev: Special Functions,  Up: Top
2211
 
 
2212
 
17 Orthogonal Polynomials
2213
 
*************************
2214
 
 
2215
 
* Menu:
2216
 
 
2217
 
* Introduction to Orthogonal Polynomials::
2218
 
* Definitions for Orthogonal Polynomials::
2219
 
 
2220
 
 
2221
 
File: maxima.info,  Node: Introduction to Orthogonal Polynomials,  Next: Definitions for Orthogonal Polynomials,  Up: Orthogonal Polynomials
2222
 
 
2223
 
17.1 Introduction to Orthogonal Polynomials
2224
 
===========================================
2225
 
 
2226
 
The `specfun' package contains Maxima code for the evaluation of all
2227
 
orthogonal polynomials listed in Chapter 22 of Abramowitz and Stegun.
2228
 
These include Chebyshev, Laguerre, Hermite, Jacobi, Legendre, and
2229
 
ultraspherical (Gegenbauer) polynomials.  Additionally, `specfun'
2230
 
contains code for spherical Bessel, spherical Hankel, and spherical
2231
 
harmonic functions.  The `specfun' package is not part of Maxima proper;
2232
 
it is loaded at request of the user via `load' or automatically via the
2233
 
`autoload' system.
2234
 
 
2235
 
   The following table lists each function in `specfun', its Maxima
2236
 
name, restrictions on its arguments, and a reference to the algorithm
2237
 
`specfun' uses to evaluate it.  With few exceptions, `specfun' follows
2238
 
the conventions of Abramowitz and Stegun.  In all cases, m and n must
2239
 
be integers.
2240
 
 
2241
 
   A&S refers to Abramowitz and Stegun, _Handbook of Mathematical
2242
 
Functions_ (10th printing, December 1972), G&R to Gradshteyn and Ryzhik,
2243
 
_Table of Integrals, Series, and Products_ (1980 corrected and enlarged
2244
 
edition), and Merzbacher to _Quantum Mechanics_ (second edition, 1970).
2245
 
 
2246
 
_Function_         _Maxima Name_      _Restrictions_     _Reference(s)_
2247
 
Chebyshev T        chebyshev_t(n, x)  n > -1             A&S 22.5.31
2248
 
Chebyshev U        chebyshev_u(n, x)  n > -1             A&S 22.5.32
2249
 
generalized        gen_laguerre(n,a,x)n > -1             A&S page 789
2250
 
Laguerre                                                 
2251
 
Laguerre           laguerre(n,x)      n > -1             A&S 22.5.67
2252
 
Hermite            hermite(n,x)        n > -1            A&S 22.4.40,
2253
 
                                                         22.5.41
2254
 
Jacobi             jacobi_p(n,a,b,x)   n > -1, a, b >    A&S page 789
2255
 
                                      -1                 
2256
 
associated         assoc_legendre_p(n,m,x)n > -1             A&S 22.5.37,
2257
 
Legendre P                                               8.6.6, 8.2.5
2258
 
associated         assoc_legendre_q(n,m,x)n > -1, m > -1     G & R 8.706
2259
 
Legendre Q                                               
2260
 
Legendre P         legendre_p(n,m,x)  n > -1             A&S 22.5.35
2261
 
Legendre Q         legendre_q(n,m,x)  n > -1             A&S 8.6.19
2262
 
spherical Hankel   spherical_hankel1(n,n > -1             A&S 10.1.36
2263
 
1st                x)                                    
2264
 
spherical Hankel   spherical_hankel2(n,n > -1             A&S 10.1.17
2265
 
2nd                x)                                    
2266
 
spherical Bessel   spherical_bessel_j(n,x)n > -1             A&S 10.1.8,
2267
 
J                                                        10.1.15
2268
 
spherical Bessel   spherical_bessel_y(n,x)n > -1             A&S 10.1.9,
2269
 
Y                                                        10.1.15
2270
 
spherical          spherical_harmonic(n,m,x,y)n > -1, |m| <= n   Merzbacher 9.64
2271
 
harmonic                                                 
2272
 
ultraspherical     ultraspherical(n,a,x) n > -1            A&S 22.5.27
2273
 
(Gegenbauer)                                             
2274
 
 
2275
 
   The `specfun' package is primarily intended for symbolic
2276
 
computation. It is hoped that it gives accurate floating point results
2277
 
as well; however, no claims are made that the algorithms are well
2278
 
suited for numerical evaluation.  Some effort, however, has been made
2279
 
to provide good numerical performance.  When all arguments, except for
2280
 
the order, are floats (but not bigfloats), many functions in `specfun'
2281
 
call a float modedeclared version of the Jacobi function.  This greatly
2282
 
speeds floating point evaluation of the orthogonal polynomials.
2283
 
 
2284
 
   `specfun' handles most domain errors by returning an unevaluated
2285
 
function.  No simplification rules (based on recursion relations) are
2286
 
defined for unevaluated functions.  It is possible for an expression
2287
 
involving sums of unevaluated special functions to vanish, yet Maxima
2288
 
is unable to reduce it to zero.
2289
 
 
2290
 
   `load ("specfun")' loads the `specfun' package.  Alternatively,
2291
 
`setup_autoload' causes the package to be loaded when one of the
2292
 
`specfun' functions appears in an expression.  `setup_autoload' may
2293
 
appear at the command line or in the `maxima-init.mac' file.  See
2294
 
`setup_autoload'.
2295
 
 
2296
 
   An example use of `specfun' is
2297
 
 
2298
 
     (%i1) load ("specfun")$
2299
 
     (%i2) [hermite (0, x), hermite (1, x), hermite (2, x)];
2300
 
                                              2
2301
 
     (%o2)               [1, 2 x, - 2 (1 - 2 x )]
2302
 
     (%i3) diff (hermite (n, x), x);
2303
 
     (%o3)                 2 n hermite(n - 1, x)
2304
 
 
2305
 
   Generally, compiled code runs faster than translated code; however,
2306
 
translated code may be better for program development.
2307
 
 
2308
 
   Some functions (namely `jacobi_p', `ultraspherical', `chebyshev_t',
2309
 
`chebyshev_u', and `legendre_p'), return a series representation when
2310
 
the order is a symbolic integer.  The series representation is not used
2311
 
by `specfun' for any computations, but it may be simplified by Maxima
2312
 
automatically, or it may be possible to use the series to evaluate the
2313
 
function through further manipulations.  For example:
2314
 
 
2315
 
     (%i1) load ("specfun")$
2316
 
     (%i2) legendre_p (n, x);
2317
 
     (%o2)                   legendre_p(n, x)
2318
 
     (%i3) ultraspherical (n, 3/2, 2);
2319
 
                  genfact(3, n, - 1) jacobi_p(n, 1, 1, 2)
2320
 
     (%o3)        ---------------------------------------
2321
 
                            genfact(2, n, - 1)
2322
 
     (%i4) declare (n, integer)$
2323
 
     (%i5) legendre_p (n, x);
2324
 
            n - 1
2325
 
            ====
2326
 
            \                                                 n - i%
2327
 
     (%o5) ( >     binomial(n, i%) binomial(n, n - i%) (x - 1)
2328
 
            /
2329
 
            ====
2330
 
            i% = 1
2331
 
 
2332
 
                                         i%          n          n   n
2333
 
                                  (x + 1)   + (x + 1)  + (x - 1) )/2
2334
 
     (%i6) ultraspherical (n, 3/2, 2);
2335
 
                               n - 1
2336
 
                               ====
2337
 
                               \       i%
2338
 
     (%o6) genfact(3, n, - 1) ( >     3   binomial(n + 1, i%)
2339
 
                               /
2340
 
                               ====
2341
 
                               i% = 1
2342
 
 
2343
 
                                         n
2344
 
      binomial(n + 1, n - i%) + (n + 1) 3  + n + 1)
2345
 
 
2346
 
                           n
2347
 
     /(genfact(2, n, - 1) 2 )
2348
 
 
2349
 
   The first and last terms of the sum are added outside the summation.
2350
 
Removing these two terms avoids Maxima bugs associated with 0^0 terms
2351
 
in a sum that should evaluate to 1, but evaluate to 0 in a Maxima
2352
 
summation. Because the sum index runs from 1 to n - 1, the lower sum
2353
 
index will exceed the upper sum index when n = 0; setting `sumhack' to
2354
 
true provides a fix. For example:
2355
 
 
2356
 
     (%i1) load ("specfun")$
2357
 
     (%i2) declare (n, integer)$
2358
 
     (%i3) e: legendre_p(n,x)$
2359
 
     (%i4) ev (e, sum, n=0);
2360
 
     Lower bound to sum: 1
2361
 
     is greater than the upper bound: - 1
2362
 
      -- an error.  Quitting.  To debug this try debugmode(true);
2363
 
     (%i5) ev (e, sum, n=0, sumhack=true);
2364
 
     (%o5)                           1
2365
 
 
2366
 
   Most functions in `specfun' have a `gradef' property; derivatives
2367
 
with respect to the order or other function parameters are undefined,
2368
 
and an attempt to compute such a derivative yields an error message.
2369
 
 
2370
 
   The `specfun' package and its documentation were written by Barton
2371
 
Willis of the University of Nebraska at Kearney. It is released under
2372
 
the terms of the General Public License (GPL).  Send bug reports and
2373
 
comments on this package to willisb@unk.edu.  In your report, please
2374
 
include the Maxima version, as reported by `build_info()', and the
2375
 
`specfun' version, as reported by `get ('specfun, 'version)'.
2376
 
 
2377
 
 
2378
 
File: maxima.info,  Node: Definitions for Orthogonal Polynomials,  Prev: Introduction to Orthogonal Polynomials,  Up: Orthogonal Polynomials
2379
 
 
2380
 
17.2 Definitions for Orthogonal Polynomials
2381
 
===========================================
2382
 
 
2383
 
 -- Function: assoc_legendre_p (<n>, <m>, <x>)
2384
 
     Returns the associated Legendre function of the first kind for
2385
 
     integers  n > -1  and  m > -1.  When  | m | > n  and  n >= 0, we
2386
 
     have   assoc_legendre_p (n, m, x) = 0.  Reference: A&S 22.5.37
2387
 
     page 779,  A&S 8.6.6 (second equation) page 334, and A&S 8.2.5
2388
 
     page 333.
2389
 
 
2390
 
     `load ("specfun")' loads this function.
2391
 
 
2392
 
     See *Note assoc_legendre_q::, *Note legendre_p::, and *Note
2393
 
     legendre_q::.
2394
 
 
2395
 
 -- Function: assoc_legendre_q (<n>, <m>, <x>)
2396
 
     Returns the associated Legendre function of the second kind for
2397
 
     integers  n > -1  and  m > -1.
2398
 
 
2399
 
     Reference: Gradshteyn and Ryzhik  8.706 page 1000.
2400
 
 
2401
 
     `load ("specfun")' loads this function.
2402
 
 
2403
 
     See also *Note assoc_legendre_p::, *Note legendre_p::, and *Note
2404
 
     legendre_q::.
2405
 
 
2406
 
 -- Function: chebyshev_t (<n>, <x>)
2407
 
     Returns the Chebyshev function of the first kind for  integers  n
2408
 
     > -1.
2409
 
 
2410
 
     Reference: A&S 22.5.31 page 778 and A&S 6.1.22 page 256.
2411
 
 
2412
 
     `load ("specfun")' loads this function.
2413
 
 
2414
 
     See also *Note chebyshev_u::.
2415
 
 
2416
 
 
2417
 
 -- Function: chebyshev_u (<n>, <x>)
2418
 
     Returns the Chebyshev function of the second kind for integers  n
2419
 
     > -1.
2420
 
 
2421
 
     Reference: A&S, 22.8.3 page 783  and A&S 6.1.22 page 256.
2422
 
 
2423
 
     `load ("specfun")' loads this function.
2424
 
 
2425
 
     See also *Note chebyshev_t::.
2426
 
 
2427
 
 
2428
 
 -- Function: gen_laguerre (<n>, <a>, <x>)
2429
 
     Returns the generalized Laguerre polynomial for  integers  n > -1.
2430
 
 
2431
 
     `load ("specfun")' loads this function.
2432
 
 
2433
 
     Reference: table on page 789 in A&S.
2434
 
 
2435
 
 -- Function: hermite (<n>, <x>)
2436
 
     Returns the Hermite polynomial for integers  n > -1.
2437
 
 
2438
 
     `load ("specfun")' loads this function.
2439
 
 
2440
 
     Reference:  A&S 22.5.40 and 22.5.41, page 779.
2441
 
 
2442
 
 
2443
 
 -- Function: jacobi_p (<n>, <a>, <b>, <x>)
2444
 
     Returns the Jacobi polynomial for integers  n > -1  and  a  and  b
2445
 
     symbolic or  a > -1  and b > -1.  (The Jacobi polynomials are
2446
 
     actually defined for all  a  and  b ; however, the Jacobi
2447
 
     polynomial weight  (1-x)^a(1+x)^b isn't integrable for  a <= -1 or
2448
 
     b <= -1.)
2449
 
 
2450
 
     When a, b, and  x  are floats (but not bfloats) specfun calls a
2451
 
     special modedeclared version of jacobi_p.  For numerical values,
2452
 
     the modedeclared version is much faster than the other version.
2453
 
     Many  functions in specfun are computed as a special case of the
2454
 
     Jacobi polynomials; they also enjoy the  speed boost from the
2455
 
     modedeclared version of  jacobi.
2456
 
 
2457
 
     If  n  has been declared to be an integer, jacobi_p (n, a, b, x)
2458
 
     returns a summation representation for the Jacobi function.
2459
 
     Because Maxima simplifies 0^0  to  0  in a sum, two terms of the
2460
 
     sum are added outside the summation.
2461
 
 
2462
 
     `load ("specfun")' loads this function.
2463
 
 
2464
 
     Reference:  table on page 789 in A&S.
2465
 
 
2466
 
 
2467
 
 -- Function: laguerre (<n>, <x>)
2468
 
     Returns the Laguerre polynomial for integers  n > -1.
2469
 
 
2470
 
     Reference: A&S 22.5.16, page 778 and A&S page 789.
2471
 
 
2472
 
     `load ("specfun")' loads this function.
2473
 
 
2474
 
     See also *Note gen_laguerre::.
2475
 
 
2476
 
 
2477
 
 -- Function: legendre_p (<n>, <x>)
2478
 
     Returns the Legendre polynomial of the first kind for  integers  n
2479
 
     > -1.
2480
 
 
2481
 
     Reference: A&S 22.5.35 page 779.
2482
 
 
2483
 
     `load ("specfun")' loads this function.
2484
 
 
2485
 
     See *Note legendre_q::.
2486
 
 
2487
 
 
2488
 
 -- Function: legendre_q (<n>, <x>)
2489
 
     Returns the Legendre polynomial of the first kind for  integers  n
2490
 
     > -1.
2491
 
 
2492
 
     Reference: A&S 8.6.19 page 334.
2493
 
 
2494
 
     `load ("specfun")' loads this function.
2495
 
 
2496
 
     See also *Note legendre_p::.
2497
 
 
2498
 
 
2499
 
 -- Function: spherical_bessel_j (<n>, <x>)
2500
 
     Returns the spherical Bessel function of the first kind for
2501
 
     integers  n > -1.
2502
 
 
2503
 
     Reference: A&S 10.1.8 page 437 and A&S 10.1.15 page 439.
2504
 
 
2505
 
     `load ("specfun")' loads this function.
2506
 
 
2507
 
     See also *Note spherical_hankel1::, *Note spherical_hankel2::, and
2508
 
     *Note spherical_bessel_y::.
2509
 
 
2510
 
 
2511
 
 -- Function: spherical_bessel_y (<n>, <x>)
2512
 
     Returns the spherical Bessel function of the second kind for
2513
 
     integers  n > -1.
2514
 
 
2515
 
     Reference: A&S 10.1.9 page 437 and 10.1.15 page 439.
2516
 
 
2517
 
     `load ("specfun")' loads this function.
2518
 
 
2519
 
     See also *Note spherical_hankel1::, *Note spherical_hankel2::, and
2520
 
     *Note spherical_bessel_y::.
2521
 
 
2522
 
 
2523
 
 -- Function: spherical_hankel1 (<n>, <x>)
2524
 
     Returns the spherical hankel function  of the first kind for
2525
 
     integers  n > -1.
2526
 
 
2527
 
     Reference: A&S 10.1.36 page 439.
2528
 
 
2529
 
     `load ("specfun")' loads this function.
2530
 
 
2531
 
     See also *Note spherical_hankel2::, *Note spherical_bessel_j::, and
2532
 
     *Note spherical_bessel_y::.
2533
 
 
2534
 
 
2535
 
 -- Function: spherical_hankel2 (<n>, <x>)
2536
 
     Returns the spherical hankel function  of the second kind for
2537
 
     integers  n > -1.
2538
 
 
2539
 
     Reference:  A&S 10.1.17 page 439.
2540
 
 
2541
 
     `load ("specfun")' loads this function.
2542
 
 
2543
 
     See also *Note spherical_hankel1::, *Note spherical_bessel_j::, and
2544
 
     *Note spherical_bessel_y::.
2545
 
 
2546
 
 
2547
 
 -- Function: spherical_harmonic (<n>, <m>, <x>, <y>)
2548
 
     Returns the spherical harmonic function for integers  n > -1 and
2549
 
     | m | <= n .
2550
 
 
2551
 
     Reference:  Merzbacher 9.64.
2552
 
 
2553
 
     `load ("specfun")' loads this function.
2554
 
 
2555
 
     See also *Note assoc_legendre_p::.
2556
 
 
2557
 
 
2558
 
 -- Function: ultraspherical (<n>, <a>, <x>)
2559
 
     Returns the ultraspherical polynomials for integers  n > -1.  The
2560
 
     ultraspherical polynomials are also known as Gegenbauer
2561
 
     polynomials.
2562
 
 
2563
 
     Reference: A&S 22.5.27
2564
 
 
2565
 
     `load ("specfun")' loads this function.
2566
 
 
2567
 
     See also *Note jacobi_p::.
2568
 
 
2569
 
 
2570
 
 
2571
 
File: maxima.info,  Node: Elliptic Functions,  Next: Limits,  Prev: Orthogonal Polynomials,  Up: Top
2572
 
 
2573
 
18 Elliptic Functions
 
2324
File: maxima.info,  Node: Elliptic Functions,  Next: Limits,  Prev: Special Functions,  Up: Top
 
2325
 
 
2326
17 Elliptic Functions
2574
2327
*********************
2575
2328
 
2576
2329
* Menu:
2582
2335
 
2583
2336
File: maxima.info,  Node: Introduction to Elliptic Functions and Integrals,  Next: Definitions for Elliptic Functions,  Up: Top
2584
2337
 
2585
 
18.1 Introduction to Elliptic Functions and Integrals
 
2338
17.1 Introduction to Elliptic Functions and Integrals
2586
2339
=====================================================
2587
2340
 
2588
2341
Maxima includes support for Jacobian elliptic functions and for
2674
2427
 
2675
2428
File: maxima.info,  Node: Definitions for Elliptic Functions,  Next: Definitions for Elliptic Integrals,  Prev: Introduction to Elliptic Functions and Integrals,  Up: Top
2676
2429
 
2677
 
18.2 Definitions for Elliptic Functions
 
2430
17.2 Definitions for Elliptic Functions
2678
2431
=======================================
2679
2432
 
2680
2433
 -- Function: jacobi_sn (<u>, <m>)
2752
2505
 
2753
2506
File: maxima.info,  Node: Definitions for Elliptic Integrals,  Prev: Definitions for Elliptic Functions,  Up: Top
2754
2507
 
2755
 
18.3 Definitions for Elliptic Integrals
 
2508
17.3 Definitions for Elliptic Integrals
2756
2509
=======================================
2757
2510
 
2758
2511
 -- Function: elliptic_f (<phi>, <m>)
2808
2561
 
2809
2562
File: maxima.info,  Node: Limits,  Next: Differentiation,  Prev: Elliptic Functions,  Up: Top
2810
2563
 
2811
 
19 Limits
 
2564
18 Limits
2812
2565
*********
2813
2566
 
2814
2567
* Menu:
2818
2571
 
2819
2572
File: maxima.info,  Node: Definitions for Limits,  Prev: Limits,  Up: Limits
2820
2573
 
2821
 
19.1 Definitions for Limits
 
2574
18.1 Definitions for Limits
2822
2575
===========================
2823
2576
 
2824
2577
 -- Option variable: lhospitallim
2887
2640
 
2888
2641
File: maxima.info,  Node: Differentiation,  Next: Integration,  Prev: Limits,  Up: Top
2889
2642
 
2890
 
20 Differentiation
 
2643
19 Differentiation
2891
2644
******************
2892
2645
 
2893
2646
* Menu:
2897
2650
 
2898
2651
File: maxima.info,  Node: Definitions for Differentiation,  Prev: Differentiation,  Up: Differentiation
2899
2652
 
2900
 
20.1 Definitions for Differentiation
 
2653
19.1 Definitions for Differentiation
2901
2654
====================================
2902
2655
 
2903
2656
 -- Function: antid (<expr>, <x>, <u(x)>)
3479
3232
 
3480
3233
File: maxima.info,  Node: Integration,  Next: Equations,  Prev: Differentiation,  Up: Top
3481
3234
 
3482
 
21 Integration
 
3235
20 Integration
3483
3236
**************
3484
3237
 
3485
3238
* Menu:
3490
3243
 
3491
3244
File: maxima.info,  Node: Introduction to Integration,  Next: Definitions for Integration,  Prev: Integration,  Up: Integration
3492
3245
 
3493
 
21.1 Introduction to Integration
 
3246
20.1 Introduction to Integration
3494
3247
================================
3495
3248
 
3496
3249
Maxima has several routines for handling integration.  The `integrate'
3510
3263
 
3511
3264
File: maxima.info,  Node: Definitions for Integration,  Prev: Introduction to Integration,  Up: Integration
3512
3265
 
3513
 
21.2 Definitions for Integration
 
3266
20.2 Definitions for Integration
3514
3267
================================
3515
3268
 
3516
3269
 -- Function: changevar (<expr>, <f(x,y)>, <y>, <x>)
4686
4439
 
4687
4440
File: maxima.info,  Node: Equations,  Next: Differential Equations,  Prev: Integration,  Up: Top
4688
4441
 
4689
 
22 Equations
 
4442
21 Equations
4690
4443
************
4691
4444
 
4692
4445
* Menu:
4696
4449
 
4697
4450
File: maxima.info,  Node: Definitions for Equations,  Prev: Equations,  Up: Equations
4698
4451
 
4699
 
22.1 Definitions for Equations
 
4452
21.1 Definitions for Equations
4700
4453
==============================
4701
4454
 
4702
4455
 -- System variable: %rnum_list
5007
4760
     Default value: `false'
5008
4761
 
5009
4762
     When `globalsolve' is `true', solved-for variables are assigned
5010
 
     the solution values found by `solve'.
 
4763
     the solution values found by `linsolve', and by `solve' when
 
4764
     solving two or more linear equations.
 
4765
 
 
4766
     When `globalsolve' is `false', solutions found by `linsolve' and
 
4767
     by `solve' when solving two or more linear equations are expressed
 
4768
     as equations, and the solved-for variables are not assigned.
 
4769
 
 
4770
     When solving anything other than two or more linear equations,
 
4771
     `solve' ignores `globalsolve'.  Other functions which solve
 
4772
     equations (e.g., `algsys') always ignore `globalsolve'.
5011
4773
 
5012
4774
     Examples:
5013
4775
 
5099
4861
     `ieqn' if an error prevented generation of further terms).
5100
4862
 
5101
4863
 
5102
 
 -- Function: lhs (<eqn>)
5103
 
     Returns the left side of the equation <eqn>.
 
4864
 -- Function: lhs (<expr>)
 
4865
     Returns the left-hand side (that is, the first argument) of the
 
4866
     expression <expr>, when the operator of <expr> is one of the
 
4867
     relational operators `< <= = # equal notequal >= >', one of the
 
4868
     assignment operators `:= ::= : ::', or a user-defined binary infix
 
4869
     operator, as declared by `infix'.
5104
4870
 
5105
 
     If the argument is not an equation, `lhs' returns the argument.
 
4871
     When <expr> is an atom or its operator is something other than the
 
4872
     ones listed above, `lhs' returns <expr>.
5106
4873
 
5107
4874
     See also `rhs'.
5108
4875
 
5109
 
     Example:
 
4876
     Examples:
5110
4877
 
5111
 
          (%i1) e: x^2 + y^2 = z^2;
5112
 
                                     2    2    2
5113
 
          (%o1)                     y  + x  = z
 
4878
          (%i1) e: aa + bb = cc;
 
4879
          (%o1)                     bb + aa = cc
5114
4880
          (%i2) lhs (e);
5115
 
                                        2    2
5116
 
          (%o2)                        y  + x
 
4881
          (%o2)                        bb + aa
5117
4882
          (%i3) rhs (e);
5118
 
                                          2
5119
 
          (%o3)                          z
 
4883
          (%o3)                          cc
 
4884
          (%i4) [lhs (aa < bb), lhs (aa <= bb), lhs (aa >= bb), lhs (aa > bb)];
 
4885
          (%o4)                   [aa, aa, aa, aa]
 
4886
          (%i5) [lhs (aa = bb), lhs (aa # bb), lhs (equal (aa, bb)), lhs (notequal (aa, bb))];
 
4887
          (%o5)                   [aa, aa, aa, aa]
 
4888
          (%i6) e1: '(foo(x) := 2*x);
 
4889
          (%o6)                     foo(x) := 2 x
 
4890
          (%i7) e2: '(bar(y) ::= 3*y);
 
4891
          (%o7)                    bar(y) ::= 3 y
 
4892
          (%i8) e3: '(x : y);
 
4893
          (%o8)                         x : y
 
4894
          (%i9) e4: '(x :: y);
 
4895
          (%o9)                        x :: y
 
4896
          (%i10) [lhs (e1), lhs (e2), lhs (e3), lhs (e4)];
 
4897
          (%o10)               [foo(x), bar(y), x, x]
 
4898
          (%i11) infix ("][");
 
4899
          (%o11)                         ][
 
4900
          (%i12) lhs (aa ][ bb);
 
4901
          (%o12)                         aa
5120
4902
 
5121
4903
 
5122
4904
 -- Function: linsolve ([<expr_1>, ..., <expr_m>], [<x_1>, ..., <x_n>])
5124
4906
     variables.  The expressions must each be polynomials in the
5125
4907
     variables and may be equations.
5126
4908
 
5127
 
     When `globalsolve' is `true' then variables which are solved for
5128
 
     will be set to the solution of the set of simultaneous equations.
 
4909
     When `globalsolve' is `true', each solved-for variable is bound to
 
4910
     its value in the solution of the equations.
5129
4911
 
5130
4912
     When `backsubst' is `false', `linsolve' does not carry out back
5131
4913
     substitution after the equations have been triangularized.  This
5138
4920
     under-determined system of equations with some variables expressed
5139
4921
     in terms of others.
5140
4922
 
5141
 
          (%i1) e1: x + z = y$
5142
 
          (%i2) e2: 2*a*x - y = 2*a^2$
5143
 
          (%i3) e3: y - 2*z = 2$
5144
 
          (%i4) linsolve ([e1, e2, e3], [x, y, z]);
5145
 
          (%o4)            [x = a + 1, y = 2 a, z = a - 1]
 
4923
     When `programmode' is `false', `linsolve' displays the solution
 
4924
     with intermediate expression (`%t') labels, and returns the list
 
4925
     of labels.
 
4926
 
 
4927
          (%i1) e1: x + z = y;
 
4928
          (%o1)                       z + x = y
 
4929
          (%i2) e2: 2*a*x - y = 2*a^2;
 
4930
                                                 2
 
4931
          (%o2)                   2 a x - y = 2 a
 
4932
          (%i3) e3: y - 2*z = 2;
 
4933
          (%o3)                      y - 2 z = 2
 
4934
          (%i4) [globalsolve: false, programmode: true];
 
4935
          (%o4)                     [false, true]
 
4936
          (%i5) linsolve ([e1, e2, e3], [x, y, z]);
 
4937
          (%o5)            [x = a + 1, y = 2 a, z = a - 1]
 
4938
          (%i6) [globalsolve: false, programmode: false];
 
4939
          (%o6)                    [false, false]
 
4940
          (%i7) linsolve ([e1, e2, e3], [x, y, z]);
 
4941
          Solution
 
4942
 
 
4943
          (%t7)                       z = a - 1
 
4944
 
 
4945
          (%t8)                        y = 2 a
 
4946
 
 
4947
          (%t9)                       x = a + 1
 
4948
          (%o9)                    [%t7, %t8, %t9]
 
4949
          (%i9) ''%;
 
4950
          (%o9)            [z = a - 1, y = 2 a, x = a + 1]
 
4951
          (%i10) [globalsolve: true, programmode: false];
 
4952
          (%o10)                    [true, false]
 
4953
          (%i11) linsolve ([e1, e2, e3], [x, y, z]);
 
4954
          Solution
 
4955
 
 
4956
          (%t11)                      z : a - 1
 
4957
 
 
4958
          (%t12)                       y : 2 a
 
4959
 
 
4960
          (%t13)                      x : a + 1
 
4961
          (%o13)                 [%t11, %t12, %t13]
 
4962
          (%i13) ''%;
 
4963
          (%o13)           [z : a - 1, y : 2 a, x : a + 1]
 
4964
          (%i14) [x, y, z];
 
4965
          (%o14)                 [a + 1, 2 a, a - 1]
 
4966
          (%i15) [globalsolve: true, programmode: true];
 
4967
          (%o15)                    [true, true]
 
4968
          (%i16) linsolve ([e1, e2, e3], '[x, y, z]);
 
4969
          (%o16)           [x : a + 1, y : 2 a, z : a - 1]
 
4970
          (%i17) [x, y, z];
 
4971
          (%o17)                 [a + 1, 2 a, a - 1]
5146
4972
 
5147
4973
 
5148
4974
 -- Option variable: linsolvewarn
5221
5047
     interval for the roots.  Do `example (realroots)' for an example.
5222
5048
 
5223
5049
 
5224
 
 -- Function: rhs (<eqn>)
5225
 
     Returns the right side of the equation <eqn>.
 
5050
 -- Function: rhs (<expr>)
 
5051
     Returns the right-hand side (that is, the second argument) of the
 
5052
     expression <expr>, when the operator of <expr> is one of the
 
5053
     relational operators `< <= = # equal notequal >= >', one of the
 
5054
     assignment operators `:= ::= : ::', or a user-defined binary infix
 
5055
     operator, as declared by `infix'.
5226
5056
 
5227
 
     If the argument is not an equation, `rhs' returns `0'.
 
5057
     When <expr> is an atom or its operator is something other than the
 
5058
     ones listed above, `rhs' returns 0.
5228
5059
 
5229
5060
     See also `lhs'.
5230
5061
 
5231
 
     Example:
 
5062
     Examples:
5232
5063
 
5233
 
          (%i1) e: x^2 + y^2 = z^2;
5234
 
                                     2    2    2
5235
 
          (%o1)                     y  + x  = z
 
5064
          (%i1) e: aa + bb = cc;
 
5065
          (%o1)                     bb + aa = cc
5236
5066
          (%i2) lhs (e);
5237
 
                                        2    2
5238
 
          (%o2)                        y  + x
 
5067
          (%o2)                        bb + aa
5239
5068
          (%i3) rhs (e);
5240
 
                                          2
5241
 
          (%o3)                          z
 
5069
          (%o3)                          cc
 
5070
          (%i4) [rhs (aa < bb), rhs (aa <= bb), rhs (aa >= bb), rhs (aa > bb)];
 
5071
          (%o4)                   [bb, bb, bb, bb]
 
5072
          (%i5) [rhs (aa = bb), rhs (aa # bb), rhs (equal (aa, bb)), rhs (notequal (aa, bb))];
 
5073
          (%o5)                   [bb, bb, bb, bb]
 
5074
          (%i6) e1: '(foo(x) := 2*x);
 
5075
          (%o6)                     foo(x) := 2 x
 
5076
          (%i7) e2: '(bar(y) ::= 3*y);
 
5077
          (%o7)                    bar(y) ::= 3 y
 
5078
          (%i8) e3: '(x : y);
 
5079
          (%o8)                         x : y
 
5080
          (%i9) e4: '(x :: y);
 
5081
          (%o9)                        x :: y
 
5082
          (%i10) [rhs (e1), rhs (e2), rhs (e3), rhs (e4)];
 
5083
          (%o10)                  [2 x, 3 y, y, y]
 
5084
          (%i11) infix ("][");
 
5085
          (%o11)                         ][
 
5086
          (%i12) rhs (aa ][ bb);
 
5087
          (%o12)                         bb
5242
5088
 
5243
5089
 
5244
5090
 -- Option variable: rootsconmode
5371
5217
     `solve_inconsistent_error' switch); if no unique solution exists,
5372
5218
     then `singular' will be displayed.
5373
5219
 
 
5220
     When `programmode' is `false', `solve' displays solutions with
 
5221
     intermediate expression (`%t') labels, and returns the list of
 
5222
     labels.
 
5223
 
 
5224
     When `globalsolve' is `true' and the problem is to solve two or
 
5225
     more linear equations, each solved-for variable is bound to its
 
5226
     value in the solution of the equations.
 
5227
 
5374
5228
     Examples:
5375
5229
 
5376
5230
          (%i1) solve (asin (cos (3*x))*(f(x) - 1), x);
5534
5388
 
5535
5389
File: maxima.info,  Node: Differential Equations,  Next: Numerical,  Prev: Equations,  Up: Top
5536
5390
 
5537
 
23 Differential Equations
 
5391
22 Differential Equations
5538
5392
*************************
5539
5393
 
5540
5394
* Menu:
5544
5398
 
5545
5399
File: maxima.info,  Node: Definitions for Differential Equations,  Prev: Differential Equations,  Up: Differential Equations
5546
5400
 
5547
 
23.1 Definitions for Differential Equations
 
5401
22.1 Definitions for Differential Equations
5548
5402
===========================================
5549
5403
 
5550
5404
 -- Function: bc2 (<solution>, <xval1>, <yval1>, <xval2>, <yval2>)
5698
5552
 
5699
5553
File: maxima.info,  Node: Numerical,  Next: Statistics,  Prev: Differential Equations,  Up: Top
5700
5554
 
5701
 
24 Numerical
 
5555
23 Numerical
5702
5556
************
5703
5557
 
5704
5558
* Menu:
5711
5565
 
5712
5566
File: maxima.info,  Node: Introduction to Numerical,  Next: Fourier packages,  Prev: Numerical,  Up: Numerical
5713
5567
 
5714
 
24.1 Introduction to Numerical
 
5568
23.1 Introduction to Numerical
5715
5569
==============================
5716
5570
 
5717
5571
 
5718
5572
File: maxima.info,  Node: Fourier packages,  Next: Definitions for Numerical,  Prev: Introduction to Numerical,  Up: Numerical
5719
5573
 
5720
 
24.2 Fourier packages
 
5574
23.2 Fourier packages
5721
5575
=====================
5722
5576
 
5723
5577
The `fft' package comprises functions for the numerical (not symbolic)
5733
5587
 
5734
5588
File: maxima.info,  Node: Definitions for Numerical,  Next: Definitions for Fourier Series,  Prev: Fourier packages,  Up: Numerical
5735
5589
 
5736
 
24.3 Definitions for Numerical
 
5590
23.3 Definitions for Numerical
5737
5591
==============================
5738
5592
 
5739
5593
 -- Function: polartorect (<magnitude_array>, <phase_array>)
5949
5803
          (%o4)                       7.0E+154
5950
5804
 
5951
5805
 
5952
 
 -- Function: interpolate (<f>(<x>), <x>, <a>, <b>)
5953
 
 -- Function: interpolate (<f>, <a>, <b>)
 
5806
 -- Function: find_root (<f>(<x>), <x>, <a>, <b>)
 
5807
 -- Function: find_root (<f>, <a>, <b>)
5954
5808
     Finds the zero of function <f> as variable <x> varies over the
5955
5809
     range `[<a>, <b>]'.  The function must have a different sign at
5956
5810
     each endpoint.  If this condition is not met, the action of the
5957
 
     function is governed by `intpolerror'.  If `intpolerror' is `true'
5958
 
     then an error occurs, otherwise the value of `intpolerror' is
5959
 
     returned (thus for plotting `intpolerror' might be set to 0.0).
5960
 
     Otherwise (given that Maxima can evaluate the first argument in
5961
 
     the specified range, and that it is continuous) `interpolate' is
5962
 
     guaranteed to come up with the zero (or one of them if there is
5963
 
     more than one zero).  The accuracy of `interpolate' is governed by
5964
 
     `intpolabs' and `intpolrel' which must be non-negative floating
5965
 
     point numbers.  `interpolate' will stop when the first arg
5966
 
     evaluates to something less than or equal to `intpolabs' or if
5967
 
     successive approximants to the root differ by no more than
5968
 
     `intpolrel * <one of the approximants>'.  The default values of
5969
 
     `intpolabs' and `intpolrel' are 0.0 so `interpolate' gets as good
5970
 
     an answer as is possible with the single precision arithmetic we
5971
 
     have.  The first arg may be an equation.  The order of the last
5972
 
     two args is irrelevant.  Thus
 
5811
     function is governed by `find_root_error'.  If `find_root_error'
 
5812
     is `true' then an error occurs, otherwise the value of
 
5813
     `find_root_error' is returned (thus for plotting `find_root_error'
 
5814
     might be set to 0.0).  Otherwise (given that Maxima can evaluate
 
5815
     the first argument in the specified range, and that it is
 
5816
     continuous) `find_root' is guaranteed to come up with the zero (or
 
5817
     one of them if there is more than one zero).  The accuracy of
 
5818
     `find_root' is governed by `find_root_abs' and `find_root_rel'
 
5819
     which must be non-negative floating point numbers.  `find_root'
 
5820
     will stop when the first arg evaluates to something less than or
 
5821
     equal to `find_root_abs' or if successive approximants to the root
 
5822
     differ by no more than `find_root_rel * <one of the approximants>'.
 
5823
     The default values of `find_root_abs' and `find_root_rel' are 0.0
 
5824
     so `find_root' gets as good an answer as is possible with the
 
5825
     single precision arithmetic we have.  The first arg may be an
 
5826
     equation.  The order of the last two args is irrelevant.  Thus
5973
5827
 
5974
 
          interpolate (sin(x) = x/2, x, %pi, 0.1);
 
5828
          find_root (sin(x) = x/2, x, %pi, 0.1);
5975
5829
 
5976
5830
     is equivalent to
5977
5831
 
5978
 
          interpolate (sin(x) = x/2, x, 0.1, %pi);
 
5832
          find_root (sin(x) = x/2, x, 0.1, %pi);
5979
5833
 
5980
5834
     The method used is a binary search in the range specified by the
5981
5835
     last two args.  When it thinks the function is close enough to
5982
5836
     being linear, it starts using linear interpolation.
5983
5837
 
 
5838
     Examples:
 
5839
 
5984
5840
          (%i1) f(x) := sin(x) - x/2;
5985
5841
                                                  x
5986
5842
          (%o1)                  f(x) := sin(x) - -
5987
5843
                                                  2
5988
 
          (%i2) interpolate (sin(x) - x/2, x, 0.1, %pi);
 
5844
          (%i2) find_root (sin(x) - x/2, x, 0.1, %pi);
5989
5845
          (%o2)                   1.895494267033981
5990
 
          (%i3) interpolate (sin(x) = x/2, x, 0.1, %pi);
 
5846
          (%i3) find_root (sin(x) = x/2, x, 0.1, %pi);
5991
5847
          (%o3)                   1.895494267033981
5992
 
          (%i4) interpolate (f(x), x, 0.1, %pi);
 
5848
          (%i4) find_root (f(x), x, 0.1, %pi);
5993
5849
          (%o4)                   1.895494267033981
5994
 
          (%i5) interpolate (f, 0.1, %pi);
 
5850
          (%i5) find_root (f, 0.1, %pi);
5995
5851
          (%o5)                   1.895494267033981
5996
5852
 
5997
 
     There is also a Newton method interpolation routine. See `newton'.
5998
 
 
5999
 
 
6000
 
 -- Option variable: intpolabs
 
5853
 
 
5854
 -- Option variable: find_root_abs
6001
5855
     Default value: 0.0
6002
5856
 
6003
 
     `intpolabs' is the accuracy of the `interpolate' command is
6004
 
     governed by `intpolabs' and `intpolrel' which must be non-negative
6005
 
     floating point numbers.  `interpolate' will stop when the first
6006
 
     arg evaluates to something less than or equal to `intpolabs' or if
6007
 
     successive approximants to the root differ by no more than
6008
 
     `intpolrel * <one of the approximants>'.  The default values of
6009
 
     `intpolabs' and `intpolrel' are 0.0 so `interpolate' gets as good
6010
 
     an answer as is possible with the single precision arithmetic we
6011
 
     have.
6012
 
 
6013
 
 
6014
 
 -- Option variable: intpolerror
 
5857
     `find_root_abs' is the accuracy of the `find_root' command is
 
5858
     governed by `find_root_abs' and `find_root_rel' which must be
 
5859
     non-negative floating point numbers.  `find_root' will stop when
 
5860
     the first arg evaluates to something less than or equal to
 
5861
     `find_root_abs' or if successive approximants to the root differ
 
5862
     by no more than `find_root_rel * <one of the approximants>'.  The
 
5863
     default values of `find_root_abs' and `find_root_rel' are 0.0 so
 
5864
     `find_root' gets as good an answer as is possible with the single
 
5865
     precision arithmetic we have.
 
5866
 
 
5867
 
 
5868
 -- Option variable: find_root_error
6015
5869
     Default value: `true'
6016
5870
 
6017
 
     `intpolerror' governs the behavior of `interpolate'.  When
6018
 
     `interpolate' is called, it determines whether or not the function
6019
 
     to be interpolated satisfies the condition that the values of the
 
5871
     `find_root_error' governs the behavior of `find_root'.  When
 
5872
     `find_root' is called, it determines whether or not the function
 
5873
     to be solved satisfies the condition that the values of the
6020
5874
     function at the endpoints of the interpolation interval are
6021
5875
     opposite in sign.  If they are of opposite sign, the interpolation
6022
 
     proceeds.  If they are of like sign, and `intpolerror' is `true',
6023
 
     then an error is signaled.  If they are of like sign and
6024
 
     `intpolerror' is not `true', the value of `intpolerror' is
6025
 
     returned.  Thus for plotting, `intpolerror' might be set to 0.0.
6026
 
 
6027
 
 
6028
 
 -- Option variable: intpolrel
 
5876
     proceeds.  If they are of like sign, and `find_root_error' is
 
5877
     `true', then an error is signaled.  If they are of like sign and
 
5878
     `find_root_error' is not `true', the value of `find_root_error' is
 
5879
     returned.  Thus for plotting, `find_root_error' might be set to
 
5880
     0.0.
 
5881
 
 
5882
 
 
5883
 -- Option variable: find_root_rel
6029
5884
     Default value: 0.0
6030
5885
 
6031
 
     `intpolrel' is the accuracy of the `interpolate' command is
6032
 
     governed by `intpolabs' and `intpolrel' which must be non-negative
6033
 
     floating point numbers.  `interpolate' will stop when the first
6034
 
     arg evaluates to something less than or equal to `intpolabs' or if
6035
 
     successive approximants to the root differ by no more than
6036
 
     `intpolrel * <one of the approximants>'.  The default values of
6037
 
     `intpolabs' and `intpolrel' are 0.0 so `interpolate' gets as good
6038
 
     an answer as is possible with the single precision arithmetic we
6039
 
     have.
6040
 
 
6041
 
 
6042
 
 -- Function: newton (<expr>, <x>, <x_0>, <eps>)
6043
 
     Interpolation by Newton's method. `load ("newton1")' loads this
6044
 
     function.
6045
 
 
6046
 
     `newton' can handle some expressions that `interpolate' refuses to
6047
 
     handle, since `interpolate' requires that everything evaluate to a
6048
 
     floating point number.  Thus `newton (x^2 - a^2, x, a/2, a^2/100)'
6049
 
     complains that it can't tell if `6.098490481853958E-4 a^2 <
6050
 
     a^2/100'.  After `assume (a>0)', the same function call succeeds,
6051
 
     yielding a symbolic result, `1.00030487804878 a'.
6052
 
 
6053
 
     On the other hand, `interpolate (x^2 - a^2, x, a/2, 2*a)' complains
6054
 
     that `0.5 a' is not a floating point number.
6055
 
 
6056
 
     An adaptive integrator which uses the Newton-Cotes 8 panel
6057
 
     quadrature rule is available.  See `qq'.
 
5886
     `find_root_rel' is the accuracy of the `find_root' command is
 
5887
     governed by `find_root_abs' and `find_root_rel' which must be
 
5888
     non-negative floating point numbers.  `find_root' will stop when
 
5889
     the first arg evaluates to something less than or equal to
 
5890
     `find_root_abs' or if successive approximants to the root differ
 
5891
     by no more than `find_root_rel * <one of the approximants>'.  The
 
5892
     default values of `find_root_abs' and `find_root_rel' are 0.0 so
 
5893
     `find_root' gets as good an answer as is possible with the single
 
5894
     precision arithmetic we have.
6058
5895
 
6059
5896
 
6060
5897
 
6061
5898
File: maxima.info,  Node: Definitions for Fourier Series,  Prev: Definitions for Numerical,  Up: Numerical
6062
5899
 
6063
 
24.4 Definitions for Fourier Series
 
5900
23.4 Definitions for Fourier Series
6064
5901
===================================
6065
5902
 
6066
5903
 -- Function: equalp (<x>, <y>)
6164
6001
 
6165
6002
File: maxima.info,  Node: Statistics,  Next: Arrays and Tables,  Prev: Numerical,  Up: Top
6166
6003
 
6167
 
25 Statistics
 
6004
24 Statistics
6168
6005
*************
6169
6006
 
6170
6007
* Menu:
6174
6011
 
6175
6012
File: maxima.info,  Node: Definitions for Statistics,  Prev: Statistics,  Up: Statistics
6176
6013
 
6177
 
25.1 Definitions for Statistics
 
6014
24.1 Definitions for Statistics
6178
6015
===============================
6179
6016
 
6180
6017
 -- Function: gauss (<mean>, <sd>)
6185
6022
 
6186
6023
File: maxima.info,  Node: Arrays and Tables,  Next: Matrices and Linear Algebra,  Prev: Statistics,  Up: Top
6187
6024
 
6188
 
26 Arrays and Tables
 
6025
25 Arrays and Tables
6189
6026
********************
6190
6027
 
6191
6028
* Menu:
6195
6032
 
6196
6033
File: maxima.info,  Node: Definitions for Arrays and Tables,  Prev: Arrays and Tables,  Up: Arrays and Tables
6197
6034
 
6198
 
26.1 Definitions for Arrays and Tables
 
6035
25.1 Definitions for Arrays and Tables
6199
6036
======================================
6200
6037
 
6201
6038
 -- Function: array (<name>, <dim_1>, ..., <dim_n>)
6287
6124
     `fillarray' returns its first argument.
6288
6125
 
6289
6126
 
6290
 
 -- Function: getchar (<a>, <i>)
6291
 
     Returns the <i>'th character of the quoted string or atomic name
6292
 
     <a>.  This function is useful in manipulating the `labels' list.
6293
 
 
6294
 
 
6295
6127
 -- Function: listarray (<A>)
6296
6128
     Returns a list of the elements of a declared or hashed array <A>.
6297
6129
     The order is row-major.  Elements which are not yet defined are
6338
6170
     `remarray' returns the list of arrays removed.
6339
6171
 
6340
6172
 
 
6173
 -- Function: subvar (<x>, <i>)
 
6174
     Evaluates the subscripted expression `<x>[<i>]'.
 
6175
 
 
6176
     `subvar' evaluates its arguments.
 
6177
 
 
6178
     `arraymake (<x>, [<i>]' constructs the expression `<x>[<i>]', but
 
6179
     does not evaluate it.
 
6180
 
 
6181
     Examples:
 
6182
 
 
6183
          (%i1) x : foo $
 
6184
 
 
6185
          (%i2) i : 3 $
 
6186
 
 
6187
          (%i3) subvar (x, i);
 
6188
          (%o3)                         foo
 
6189
                                           3
 
6190
          (%i4) foo : [aa, bb, cc, dd, ee]$
 
6191
 
 
6192
          (%i5) subvar (x, i);
 
6193
          (%o5)                          cc
 
6194
          (%i6) arraymake (x, [i]);
 
6195
          (%o6)                         foo
 
6196
                                           3
 
6197
          (%i7) ''%;
 
6198
          (%o7)                          cc
 
6199
 
 
6200
 
6341
6201
 -- Option variable: use_fast_arrays
6342
6202
     - if `true' then only two types of arrays are recognized.
6343
6203
 
6369
6229
 
6370
6230
File: maxima.info,  Node: Matrices and Linear Algebra,  Next: Affine,  Prev: Arrays and Tables,  Up: Top
6371
6231
 
6372
 
27 Matrices and Linear Algebra
 
6232
26 Matrices and Linear Algebra
6373
6233
******************************
6374
6234
 
6375
6235
* Menu:
6380
6240
 
6381
6241
File: maxima.info,  Node: Introduction to Matrices and Linear Algebra,  Next: Definitions for Matrices and Linear Algebra,  Prev: Matrices and Linear Algebra,  Up: Matrices and Linear Algebra
6382
6242
 
6383
 
27.1 Introduction to Matrices and Linear Algebra
 
6243
26.1 Introduction to Matrices and Linear Algebra
6384
6244
================================================
6385
6245
 
6386
6246
* Menu:
6392
6252
 
6393
6253
File: maxima.info,  Node: Dot,  Next: Vectors,  Prev: Introduction to Matrices and Linear Algebra,  Up: Introduction to Matrices and Linear Algebra
6394
6254
 
6395
 
27.1.1 Dot
 
6255
26.1.1 Dot
6396
6256
----------
6397
6257
 
6398
6258
The operator `.' represents noncommutative multiplication and scalar
6423
6283
 
6424
6284
File: maxima.info,  Node: Vectors,  Next: eigen,  Prev: Dot,  Up: Introduction to Matrices and Linear Algebra
6425
6285
 
6426
 
27.1.2 Vectors
 
6286
26.1.2 Vectors
6427
6287
--------------
6428
6288
 
6429
6289
`vect' is a package of functions for vector analysis.  `load ("vect")'
6447
6307
 
6448
6308
File: maxima.info,  Node: eigen,  Prev: Vectors,  Up: Introduction to Matrices and Linear Algebra
6449
6309
 
6450
 
27.1.3 eigen
 
6310
26.1.3 eigen
6451
6311
------------
6452
6312
 
6453
6313
The package `eigen' contains several functions devoted to the symbolic
6466
6326
 
6467
6327
File: maxima.info,  Node: Definitions for Matrices and Linear Algebra,  Prev: Introduction to Matrices and Linear Algebra,  Up: Matrices and Linear Algebra
6468
6328
 
6469
 
27.2 Definitions for Matrices and Linear Algebra
 
6329
26.2 Definitions for Matrices and Linear Algebra
6470
6330
================================================
6471
6331
 
6472
6332
 -- Function: addcol (<M>, <list_1>, ..., <list_n>)
6480
6340
 
6481
6341
 
6482
6342
 -- Function: adjoint (<M>)
6483
 
     Returns the adjoint of the matrix <M>.
 
6343
     Returns the adjoint of the matrix <M>.  The adjoint matrix is the
 
6344
     transpose of the matrix of cofactors of <M>.
6484
6345
 
6485
6346
 
6486
6347
 -- Function: augcoefmatrix ([<eqn_1>, ..., <eqn_m>], [<x_1>, ...,
6536
6397
 
6537
6398
 
6538
6399
 -- Function: coefmatrix ([<eqn_1>, ..., <eqn_m>], [<x_1>, ..., <x_n>])
6539
 
     Returns the coefficient matrix for the variables <eqn_1>, ...,
6540
 
     <eqn_m> of the system of linear equations <x_1>, ..., <x_n>.
 
6400
     Returns the coefficient matrix for the variables <x_1>, ..., <x_n>
 
6401
     of the system of linear equations <eqn_1>, ..., <eqn_m>.
 
6402
 
 
6403
          (%i1) coefmatrix([2*x-(a-1)*y+5*b = 0, b*y+a*x = 3], [x,y]);
 
6404
                                           [ 2  1 - a ]
 
6405
          (%o1)                            [          ]
 
6406
                                           [ a    b   ]
6541
6407
 
6542
6408
 
6543
6409
 -- Function: col (<M>, <i>)
6575
6441
 -- Function: conjugate (<x>)
6576
6442
     Returns the complex conjugate of <x>.
6577
6443
 
6578
 
     `load (conjugate)' loads this function.
6579
 
 
6580
6444
          (%i1) declare ([aa, bb], real, cc, complex, ii, imaginary);
6581
6445
 
6582
6446
          (%o1)                         done
6803
6667
 
6804
6668
 
6805
6669
 -- Function: echelon (<M>)
6806
 
     Returns the echelon form of the matrix <M>.  The echelon form is
6807
 
     computed from <M> by elementary row operations such that the first
6808
 
     non-zero element in each row in the resulting matrix is a one and
6809
 
     the column elements under the first one in each row are all zero.
6810
 
 
6811
 
          (%i1) m: matrix ([2, 1-a, -5*b], [a, b, c]);
6812
 
                                 [ 2  1 - a  - 5 b ]
6813
 
          (%o1)                  [                 ]
6814
 
                                 [ a    b      c   ]
6815
 
          (%i2) echelon (m);
6816
 
                            [      a - 1       5 b     ]
6817
 
                            [ 1  - -----     - ---     ]
6818
 
                            [        2          2      ]
6819
 
          (%o2)/R/          [                          ]
6820
 
                            [             2 c + 5 a b  ]
6821
 
                            [ 0     1     ------------ ]
6822
 
                            [                    2     ]
6823
 
                            [             2 b + a  - a ]
 
6670
     Returns the echelon form of the matrix <M>, as produced by
 
6671
     Gaussian elimination.  The echelon form is computed from <M> by
 
6672
     elementary row operations such that the first non-zero element in
 
6673
     each row in the resulting matrix is one and the column elements
 
6674
     under the first one in each row are all zero.
 
6675
 
 
6676
     `triangularize' also carries out Gaussian elimination, but it does
 
6677
     not normalize the leading non-zero element in each row.
 
6678
 
 
6679
     `lu_factor' and `cholesky' are other functions which yield
 
6680
     triangularized matrices.
 
6681
 
 
6682
          (%i1) M: matrix ([3, 7, aa, bb], [-1, 8, 5, 2], [9, 2, 11, 4]);
 
6683
                                 [  3   7  aa  bb ]
 
6684
                                 [                ]
 
6685
          (%o1)                  [ - 1  8  5   2  ]
 
6686
                                 [                ]
 
6687
                                 [  9   2  11  4  ]
 
6688
          (%i2) echelon (M);
 
6689
                            [ 1  - 8  - 5      - 2     ]
 
6690
                            [                          ]
 
6691
                            [         28       11      ]
 
6692
                            [ 0   1   --       --      ]
 
6693
          (%o2)             [         37       37      ]
 
6694
                            [                          ]
 
6695
                            [              37 bb - 119 ]
 
6696
                            [ 0   0    1   ----------- ]
 
6697
                            [              37 aa - 313 ]
6824
6698
 
6825
6699
 
6826
6700
 -- Function: eigenvalues (<M>)
6835
6709
     `eigenvalues' calls the function `solve' to find the roots of the
6836
6710
     characteristic polynomial of the matrix.  Sometimes `solve' may
6837
6711
     not be able to find the roots of the polynomial; in that case some
6838
 
     other functions in this package (except `conjugate',
6839
 
     `innerproduct', `unitvector', `columnvector' and `gramschmidt')
6840
 
     will not work.
 
6712
     other functions in this package (except `innerproduct',
 
6713
     `unitvector', `columnvector' and `gramschmidt') will not work.
6841
6714
 
6842
6715
     In some cases the eigenvalues found by `solve' may be complicated
6843
6716
     expressions.  (This may happen when `solve' returns a
7553
7426
 
7554
7427
 
7555
7428
 -- Function: triangularize (<M>)
7556
 
     Returns the upper triangular form of the matrix `M'.
7557
 
 
7558
 
     <M> need not be square.
 
7429
     Returns the upper triangular form of the matrix `M', as produced
 
7430
     by Gaussian elimination.  The return value is the same as
 
7431
     `echelon', except that the leading nonzero coefficient in each row
 
7432
     is not normalized to 1.
 
7433
 
 
7434
     `lu_factor' and `cholesky' are other functions which yield
 
7435
     triangularized matrices.
 
7436
 
 
7437
          (%i1) M: matrix ([3, 7, aa, bb], [-1, 8, 5, 2], [9, 2, 11, 4]);
 
7438
                                 [  3   7  aa  bb ]
 
7439
                                 [                ]
 
7440
          (%o1)                  [ - 1  8  5   2  ]
 
7441
                                 [                ]
 
7442
                                 [  9   2  11  4  ]
 
7443
          (%i2) triangularize (M);
 
7444
                       [ - 1   8         5            2      ]
 
7445
                       [                                     ]
 
7446
          (%o2)        [  0   - 74     - 56         - 22     ]
 
7447
                       [                                     ]
 
7448
                       [  0    0    626 - 74 aa  238 - 74 bb ]
7559
7449
 
7560
7450
 
7561
7451
 -- Function: uniteigenvectors (<M>)
7685
7575
 
7686
7576
File: maxima.info,  Node: Affine,  Next: itensor,  Prev: Matrices and Linear Algebra,  Up: Top
7687
7577
 
7688
 
28 Affine
 
7578
27 Affine
7689
7579
*********
7690
7580
 
7691
7581
* Menu:
7692
7582
 
7693
7583
* Definitions for Affine::
7694
7584
 
 
7585
 
 
7586
File: maxima.info,  Node: Definitions for Affine,  Prev: Affine,  Up: Affine
 
7587
 
 
7588
27.1 Definitions for Affine
 
7589
===========================
 
7590
 
 
7591
 -- Function: fast_linsolve ([<expr_1>, ..., <expr_m>], [<x_1>, ...,
 
7592
          <x_n>])
 
7593
     Solves the simultaneous linear equations <expr_1>, ..., <expr_m>
 
7594
     for the variables <x_1>, ..., <x_n>.  Each <expr_i> may be an
 
7595
     equation or a general expression; if given as a general
 
7596
     expression, it is treated as an equation of the form `<expr_i> =
 
7597
     0'.
 
7598
 
 
7599
     The return value is a list of equations of the form `[<x_1> =
 
7600
     <a_1>, ..., <x_n> = <a_n>]' where <a_1>, ..., <a_n> are all free
 
7601
     of <x_1>, ..., <x_n>.
 
7602
 
 
7603
     `fast_linsolve' is faster than `linsolve' for system of equations
 
7604
     which are sparse.
 
7605
 
 
7606
 
 
7607
 -- Function: grobner_basis ([<expr_1>, ..., <expr_m>])
 
7608
     Returns a Groebner basis for the equations <expr_1>, ..., <expr_m>.
 
7609
     The function `polysimp' can then be used to simplify other
 
7610
     functions relative to the equations.
 
7611
 
 
7612
          grobner_basis ([3*x^2+1, y*x])$
 
7613
 
 
7614
          polysimp (y^2*x + x^3*9 + 2) ==> -3*x + 2
 
7615
 
 
7616
     `polysimp(f)' yields 0 if and only if <f> is in the ideal
 
7617
     generated by <expr_1>, ..., <expr_m>, that is, if and only if <f>
 
7618
     is a polynomial combination of the elements of <expr_1>, ...,
 
7619
     <expr_m>.
 
7620
 
 
7621
 
 
7622
 -- Function: set_up_dot_simplifications (<eqns>,
 
7623
          <check_through_degree>)
 
7624
 -- Function: set_up_dot_simplifications (<eqns>)
 
7625
     The <eqns> are polynomial equations in non commutative variables.
 
7626
     The value of `current_variables' is the list of variables used for
 
7627
     computing degrees.  The equations must be homogeneous, in order
 
7628
     for the procedure to terminate.
 
7629
 
 
7630
     If you have checked overlapping simplifications in
 
7631
     `dot_simplifications' above the degree of <f>, then the following
 
7632
     is true: `dotsimp (<f>)' yields 0 if and only if <f> is in the
 
7633
     ideal generated by the equations, i.e., if and only if <f> is a
 
7634
     polynomial combination of the elements of the equations.
 
7635
 
 
7636
     The degree is that returned by `nc_degree'.   This in turn is
 
7637
     influenced by the weights of individual variables.
 
7638
 
 
7639
 
 
7640
 -- Function: declare_weight (<x_1>, <w_1>, ..., <x_n>, <w_n>)
 
7641
     Assigns weights <w_1>, ..., <w_n> to <x_1>, ..., <x_n>,
 
7642
     respectively.  These are the weights used in computing `nc_degree'.
 
7643
 
 
7644
 
 
7645
 -- Function: nc_degree (<p>)
 
7646
     Returns the degree of a noncommutative polynomial <p>.  See
 
7647
     `declare_weights'.
 
7648
 
 
7649
 
 
7650
 -- Function: dotsimp (<f>)
 
7651
     Returns 0 if and only if <f> is in the ideal generated by the
 
7652
     equations, i.e., if and only if <f> is a polynomial combination of
 
7653
     the elements of the equations.
 
7654
 
 
7655
 
 
7656
 -- Function: fast_central_elements ([<x_1>, ..., <x_n>], <n>)
 
7657
     If `set_up_dot_simplifications' has been previously done, finds
 
7658
     the central polynomials in the variables <x_1>, ..., <x_n> in the
 
7659
     given degree, <n>.
 
7660
 
 
7661
     For example:
 
7662
          set_up_dot_simplifications ([y.x + x.y], 3);
 
7663
          fast_central_elements ([x, y], 2);
 
7664
          [y.y, x.x];
 
7665
 
 
7666
 
 
7667
 -- Function: check_overlaps (<n>, <add_to_simps>)
 
7668
     Checks the overlaps thru degree <n>, making sure that you have
 
7669
     sufficient simplification rules in each degree, for `dotsimp' to
 
7670
     work correctly.  This process can be speeded up if you know before
 
7671
     hand what the dimension of the space of monomials is.  If it is of
 
7672
     finite global dimension, then `hilbert' should be used.  If you
 
7673
     don't know the monomial dimensions, do not specify a
 
7674
     `rank_function'.  An optional third argument `reset', `false' says
 
7675
     don't bother to query about resetting things.
 
7676
 
 
7677
 
 
7678
 -- Function: mono ([<x_1>, ..., <x_n>], <n>)
 
7679
     Returns the list of independent monomials relative to the current
 
7680
     dot simplifications of degree <n> in the variables <x_1>, ...,
 
7681
     <x_n>.
 
7682
 
 
7683
 
 
7684
 -- Function: monomial_dimensions (<n>)
 
7685
     Compute the Hilbert series through degree <n> for the current
 
7686
     algebra.
 
7687
 
 
7688
 
 
7689
 -- Function: extract_linear_equations ([<p_1>, ..., <p_n>], [<m_1>,
 
7690
          ..., <m_n>])
 
7691
     Makes a list of the coefficients of the noncommutative polynomials
 
7692
     <p_1>, ..., <p_n> of the noncommutative monomials <m_1>, ...,
 
7693
     <m_n>.  The coefficients should be scalars.   Use
 
7694
     `list_nc_monomials' to build the list of monomials.
 
7695
 
 
7696
 
 
7697
 -- Function: list_nc_monomials ([<p_1>, ..., <p_n>])
 
7698
 -- Function: list_nc_monomials (<p>)
 
7699
     Returns a list of the non commutative monomials occurring in a
 
7700
     polynomial <p> or a list of polynomials <p_1>, ..., <p_n>.
 
7701
 
 
7702
 
 
7703
 -- Option variable: all_dotsimp_denoms
 
7704
     Default value: `false'
 
7705
 
 
7706
     When `all_dotsimp_denoms' is a list, the denominators encountered
 
7707
     by `dotsimp' are appended to the list.  `all_dotsimp_denoms' may
 
7708
     be initialized to an empty list `[]' before calling `dotsimp'.
 
7709
 
 
7710
     By default, denominators are not collected by `dotsimp'.
 
7711
 
 
7712
 
 
7713
 
 
7714
File: maxima.info,  Node: itensor,  Next: ctensor,  Prev: Affine,  Up: Top
 
7715
 
 
7716
28 itensor
 
7717
**********
 
7718
 
 
7719
* Menu:
 
7720
 
 
7721
* Introduction to itensor::
 
7722
* Definitions for itensor::
 
7723