File: maxima_31.html

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

-->
<head>
<title>Maxima Manual: 31. Series</title>

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

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

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

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

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

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

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

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

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

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

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

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

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

<a name="Series"></a>
<a name="SEC125"></a>
<table cellpadding="1" cellspacing="1" border="0">
<tr><td valign="middle" align="left">[<a href="maxima_30.html#SEC124" title="Previous section in reading order"> &lt; </a>]</td>
<td valign="middle" align="left">[<a href="#SEC126" title="Next section in reading order"> &gt; </a>]</td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left">[<a href="maxima_30.html#SEC122" title="Beginning of this chapter or previous chapter"> &lt;&lt; </a>]</td>
<td valign="middle" align="left">[<a href="maxima.html#SEC_Top" title="Up section"> Up </a>]</td>
<td valign="middle" align="left">[<a href="maxima_32.html#SEC128" title="Next chapter"> &gt;&gt; </a>]</td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left">[<a href="maxima.html#SEC_Top" title="Cover (top) of document">Top</a>]</td>
<td valign="middle" align="left">[<a href="maxima_toc.html#SEC_Contents" title="Table of contents">Contents</a>]</td>
<td valign="middle" align="left">[<a href="maxima_72.html#SEC264" title="Index">Index</a>]</td>
<td valign="middle" align="left">[<a href="maxima_abt.html#SEC_About" title="About (help)"> ? </a>]</td>
</tr></table>
<h1 class="chapter"> 31. Series </h1>

<table class="menu" border="0" cellspacing="0">
<tr><td align="left" valign="top"><a href="#SEC126">31.1 Introduction to Series</a></td><td>&nbsp;&nbsp;</td><td align="left" valign="top">      
</td></tr>
<tr><td align="left" valign="top"><a href="#SEC127">31.2 Definitions for Series</a></td><td>&nbsp;&nbsp;</td><td align="left" valign="top">      
</td></tr>
</table>

<hr size="6">
<a name="Introduction-to-Series"></a>
<a name="SEC126"></a>
<table cellpadding="1" cellspacing="1" border="0">
<tr><td valign="middle" align="left">[<a href="#SEC125" title="Previous section in reading order"> &lt; </a>]</td>
<td valign="middle" align="left">[<a href="#SEC127" title="Next section in reading order"> &gt; </a>]</td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left">[<a href="#SEC125" title="Beginning of this chapter or previous chapter"> &lt;&lt; </a>]</td>
<td valign="middle" align="left">[<a href="#SEC125" title="Up section"> Up </a>]</td>
<td valign="middle" align="left">[<a href="maxima_32.html#SEC128" title="Next chapter"> &gt;&gt; </a>]</td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left">[<a href="maxima.html#SEC_Top" title="Cover (top) of document">Top</a>]</td>
<td valign="middle" align="left">[<a href="maxima_toc.html#SEC_Contents" title="Table of contents">Contents</a>]</td>
<td valign="middle" align="left">[<a href="maxima_72.html#SEC264" title="Index">Index</a>]</td>
<td valign="middle" align="left">[<a href="maxima_abt.html#SEC_About" title="About (help)"> ? </a>]</td>
</tr></table>
<h2 class="section"> 31.1 Introduction to Series </h2>
<p>Maxima contains functions <code>taylor</code> and <code>powerseries</code> for finding the 
series of differentiable functions.   It also has tools such as <code>nusum</code>
capable of finding the closed form of some series.   Operations such as addition and multiplication work as usual on series. This section presents the global variables which control the expansion.
</p><hr size="6">
<a name="Definitions-for-Series"></a>
<a name="SEC127"></a>
<table cellpadding="1" cellspacing="1" border="0">
<tr><td valign="middle" align="left">[<a href="#SEC126" title="Previous section in reading order"> &lt; </a>]</td>
<td valign="middle" align="left">[<a href="maxima_32.html#SEC128" title="Next section in reading order"> &gt; </a>]</td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left">[<a href="#SEC125" title="Beginning of this chapter or previous chapter"> &lt;&lt; </a>]</td>
<td valign="middle" align="left">[<a href="#SEC125" title="Up section"> Up </a>]</td>
<td valign="middle" align="left">[<a href="maxima_32.html#SEC128" title="Next chapter"> &gt;&gt; </a>]</td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left"> &nbsp; </td>
<td valign="middle" align="left">[<a href="maxima.html#SEC_Top" title="Cover (top) of document">Top</a>]</td>
<td valign="middle" align="left">[<a href="maxima_toc.html#SEC_Contents" title="Table of contents">Contents</a>]</td>
<td valign="middle" align="left">[<a href="maxima_72.html#SEC264" title="Index">Index</a>]</td>
<td valign="middle" align="left">[<a href="maxima_abt.html#SEC_About" title="About (help)"> ? </a>]</td>
</tr></table>
<h2 class="section"> 31.2 Definitions for Series </h2>

<dl>
<dt><u>Option variable:</u> <b>cauchysum</b>
<a name="IDX1019"></a>
</dt>
<dd><p>Default value: <code>false</code>
</p>
<p>When multiplying together sums with <code>inf</code> as their upper limit,
if <code>sumexpand</code> is <code>true</code> and <code>cauchysum</code> is <code>true</code>
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.
</p>
<p>Example:
</p>
<table><tr><td>&nbsp;</td><td><pre class="example">(%i1) sumexpand: false$
(%i2) cauchysum: false$
(%i3) s: sum (f(i), i, 0, inf) * sum (g(j), j, 0, inf);
                      inf         inf
                      ====        ====
                      \           \
(%o3)                ( &gt;    f(i))  &gt;    g(j)
                      /           /
                      ====        ====
                      i = 0       j = 0
(%i4) sumexpand: true$
(%i5) cauchysum: true$
(%i6) ''s;
                 inf     i1
                 ====   ====
                 \      \
(%o6)             &gt;      &gt;     g(i1 - i2) f(i2)
                 /      /
                 ====   ====
                 i1 = 0 i2 = 0
</pre></td></tr></table>
</dd></dl>

<dl>
<dt><u>Function:</u> <b>deftaylor</b><i> (<var>f_1</var>(<var>x_1</var>), <var>expr_1</var>, ..., <var>f_n</var>(<var>x_n</var>), <var>expr_n</var>)</i>
<a name="IDX1020"></a>
</dt>
<dd><p>For each function <var>f_i</var> of one variable <var>x_i</var>, 
<code>deftaylor</code> defines <var>expr_i</var> as the Taylor series about zero.
<var>expr_i</var> is typically a polynomial in <var>x_i</var> or a summation;
more general expressions are accepted by <code>deftaylor</code> without complaint.
</p>
<p><code>powerseries (<var>f_i</var>(<var>x_i</var>), <var>x_i</var>, 0)</code>
returns the series defined by <code>deftaylor</code>.
</p>
<p><code>deftaylor</code> returns a list of the functions
<var>f_1</var>, ..., <var>f_n</var>.
<code>deftaylor</code> evaluates its arguments.
</p>
<p>Example:
</p>
<table><tr><td>&nbsp;</td><td><pre class="example">(%i1) deftaylor (f(x), x^2 + sum(x^i/(2^i*i!^2), i, 4, inf));
(%o1)                          [f]
(%i2) powerseries (f(x), x, 0);
                      inf
                      ====      i1
                      \        x         2
(%o2)                  &gt;     -------- + x
                      /       i1    2
                      ====   2   i1!
                      i1 = 4
(%i3) taylor (exp (sqrt (f(x))), x, 0, 4);
                      2         3          4
                     x    3073 x    12817 x
(%o3)/T/     1 + x + -- + ------- + -------- + . . .
                     2     18432     307200
</pre></td></tr></table>
</dd></dl>

<dl>
<dt><u>Option variable:</u> <b>maxtayorder</b>
<a name="IDX1021"></a>
</dt>
<dd><p>Default value: <code>true</code>
</p>
<p>When <code>maxtayorder</code> is <code>true</code>, then during algebraic
manipulation of (truncated) Taylor series, <code>taylor</code> tries to retain
as many terms as are known to be correct.
</p>
</dd></dl>

<dl>
<dt><u>Function:</u> <b>niceindices</b><i> (<var>expr</var>)</i>
<a name="IDX1022"></a>
</dt>
<dd><p>Renames the indices of sums and products in <var>expr</var>.
<code>niceindices</code> attempts to rename each index to the value of <code>niceindicespref[1]</code>,
unless that name appears in the summand or multiplicand,
in which case <code>niceindices</code> tries
the succeeding elements of <code>niceindicespref</code> in turn, until an unused variable is found.
If the entire list is exhausted,
additional indices are constructed by appending integers to the value of
<code>niceindicespref[1]</code>, e.g., <code>i0</code>, <code>i1</code>, <code>i2</code>, ....
</p>
<p><code>niceindices</code> returns an expression.
<code>niceindices</code> evaluates its argument.
</p>
<p>Example:
</p>
<table><tr><td>&nbsp;</td><td><pre class="example">(%i1) niceindicespref;
(%o1)                  [i, j, k, l, m, n]
(%i2) product (sum (f (foo + i*j*bar), foo, 1, inf), bar, 1, inf);
                 inf    inf
                /===\   ====
                 ! !    \
(%o2)            ! !     &gt;      f(bar i j + foo)
                 ! !    /
                bar = 1 ====
                        foo = 1
(%i3) niceindices (%);
                     inf  inf
                    /===\ ====
                     ! !  \
(%o3)                ! !   &gt;    f(i j l + k)
                     ! !  /
                    l = 1 ====
                          k = 1
</pre></td></tr></table>
</dd></dl>

<dl>
<dt><u>Option variable:</u> <b>niceindicespref</b>
<a name="IDX1023"></a>
</dt>
<dd><p>Default value: <code>[i, j, k, l, m, n]</code>
</p>
<p><code>niceindicespref</code> is the list from which <code>niceindices</code>
takes the names of indices for sums and products.
</p>
<p>The elements of <code>niceindicespref</code> are typically names of variables,
although that is not enforced by <code>niceindices</code>.
</p>
<p>Example:
</p>
<table><tr><td>&nbsp;</td><td><pre class="example">(%i1) niceindicespref: [p, q, r, s, t, u]$
(%i2) product (sum (f (foo + i*j*bar), foo, 1, inf), bar, 1, inf);
                 inf    inf
                /===\   ====
                 ! !    \
(%o2)            ! !     &gt;      f(bar i j + foo)
                 ! !    /
                bar = 1 ====
                        foo = 1
(%i3) niceindices (%);
                     inf  inf
                    /===\ ====
                     ! !  \
(%o3)                ! !   &gt;    f(i j q + p)
                     ! !  /
                    q = 1 ====
                          p = 1
</pre></td></tr></table>
</dd></dl>

<dl>
<dt><u>Function:</u> <b>nusum</b><i> (<var>expr</var>, <var>x</var>, <var>i_0</var>, <var>i_1</var>)</i>
<a name="IDX1024"></a>
</dt>
<dd><p>Carries out indefinite hypergeometric summation of <var>expr</var> with
respect to <var>x</var> using a decision procedure due to R.W. Gosper.
<var>expr</var> and the result must be expressible as products of integer powers,
factorials, binomials, and rational functions.
</p>
<p>The terms &quot;definite&quot;
and &quot;indefinite summation&quot; are used analogously to &quot;definite&quot; and
&quot;indefinite integration&quot;.
To sum indefinitely means to give a symbolic result
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, <code>nusum</code> can't do it.
</p>
<p><code>nusum</code> and <code>unsum</code> know a little about sums and differences of finite products.
See also <code>unsum</code>.
</p>
<p>Examples:
</p>
<table><tr><td>&nbsp;</td><td><pre class="example">(%i1) nusum (n*n!, n, 0, n);

Dependent equations eliminated:  (1)
(%o1)                     (n + 1)! - 1
(%i2) nusum (n^4*4^n/binomial(2*n,n), n, 0, n);
                     4        3       2              n
      2 (n + 1) (63 n  + 112 n  + 18 n  - 22 n + 3) 4      2
(%o2) ------------------------------------------------ - ------
                    693 binomial(2 n, n)                 3 11 7
(%i3) unsum (%, n);
                              4  n
                             n  4
(%o3)                   ----------------
                        binomial(2 n, n)
(%i4) unsum (prod (i^2, i, 1, n), n);
                    n - 1
                    /===\
                     ! !   2
(%o4)              ( ! !  i ) (n - 1) (n + 1)
                     ! !
                    i = 1
(%i5) nusum (%, n, 1, n);

Dependent equations eliminated:  (2 3)
                            n
                          /===\
                           ! !   2
(%o5)                      ! !  i  - 1
                           ! !
                          i = 1
</pre></td></tr></table>
</dd></dl>

<dl>
<dt><u>Function:</u> <b>pade</b><i> (<var>taylor_series</var>, <var>numer_deg_bound</var>, <var>denom_deg_bound</var>)</i>
<a name="IDX1025"></a>
</dt>
<dd><p>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 &quot;best&quot; approximants, and which additionally satisfy the specified
degree bounds.
</p>
<p><var>taylor_series</var> is a univariate Taylor series.
<var>numer_deg_bound</var> and <var>denom_deg_bound</var>
are positive integers specifying degree bounds on
the numerator and denominator.
</p>
<p><var>taylor_series</var> can also be a Laurent series, and the degree
bounds can be <code>inf</code> 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 defined as <code><var>numer_deg_bound</var> + <var>denom_deg_bound</var></code>.
Length of a power series is defined as
<code>&quot;truncation level&quot; + 1 - min(0, &quot;order of series&quot;)</code>.
</p>
<table><tr><td>&nbsp;</td><td><pre class="example">(%i1) taylor (1 + x + x^2 + x^3, x, 0, 3);
                              2    3
(%o1)/T/             1 + x + x  + x  + . . .
(%i2) pade (%, 1, 1);
                                 1
(%o2)                       [- -----]
                               x - 1
(%i3) t: 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);
                    2    3       4       5       6        7
             x   3 x    x    15 x    23 x    21 x    189 x
(%o3)/T/ 1 - - + ---- - -- - ----- + ----- - ----- - ------
             2    16    32   1024    2048    32768   65536

                                  8         9          10
                            5853 x    2847 x    83787 x
                          + ------- + ------- - --------- + . . .
                            4194304   8388608   134217728
(%i4) pade (t, 4, 4);
(%o4)                          []
</pre></td></tr></table>
<p>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.
</p>
<table><tr><td>&nbsp;</td><td><pre class="example">(%i5) pade (t, 5, 5);
                     5                4                 3
(%o5) [- (520256329 x  - 96719020632 x  - 489651410240 x

                  2
 - 1619100813312 x  - 2176885157888 x - 2386516803584)

               5                 4                  3
/(47041365435 x  + 381702613848 x  + 1360678489152 x

                  2
 + 2856700692480 x  + 3370143559680 x + 2386516803584)]
</pre></td></tr></table>
</dd></dl>

<dl>
<dt><u>Option variable:</u> <b>powerdisp</b>
<a name="IDX1026"></a>
</dt>
<dd><p>Default value: <code>false</code>
</p>
<p>When <code>powerdisp</code> is <code>true</code>,
a sum is displayed with its terms in order of increasing power.
Thus a polynomial is displayed as a truncated power series,
with the constant term first and the highest power last.
</p>
<p>By default, terms of a sum are displayed in order of decreasing power.
</p>
</dd></dl>

<dl>
<dt><u>Function:</u> <b>powerseries</b><i> (<var>expr</var>, <var>x</var>, <var>a</var>)</i>
<a name="IDX1027"></a>
</dt>
<dd><p>Returns the general form of the power series expansion for <var>expr</var>
in the variable <var>x</var> about the point <var>a</var> (which may be <code>inf</code> for infinity).
</p>
<p>If <code>powerseries</code> is unable to expand <var>expr</var>,
<code>taylor</code> may give the first several terms of the series.
</p>
<p>When <code>verbose</code> is <code>true</code>,
<code>powerseries</code> prints progress messages. 
</p>
<table><tr><td>&nbsp;</td><td><pre class="example">(%i1) verbose: true$
(%i2) 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
                     &gt;     ------------------------------
                    /                i1 (2 i1)!
                    ====
                    i1 = 1
(%o2)                -------------------------------------
                                      2
</pre></td></tr></table>
</dd></dl>

<dl>
<dt><u>Option variable:</u> <b>psexpand</b>
<a name="IDX1028"></a>
</dt>
<dd><p>Default value: <code>false</code>
</p>
<p>When <code>psexpand</code> is <code>true</code>,
an extended rational function expression is displayed fully expanded.
The switch <code>ratexpand</code> has the same effect.
</p>
<p>When <code>psexpand</code> is <code>false</code>,
a multivariate expression is displayed just as in the rational function package.
</p>
<p>When <code>psexpand</code> is  <code>multi</code>,
then terms with the same total degree in the variables are grouped together.
</p>
</dd></dl>

<dl>
<dt><u>Function:</u> <b>revert</b><i> (<var>expr</var>, <var>x</var>)</i>
<a name="IDX1029"></a>
</dt>
<dt><u>Function:</u> <b>revert2</b><i> (<var>expr</var>, <var>x</var>, <var>n</var>)</i>
<a name="IDX1030"></a>
</dt>
<dd><p>These functions return the reversion of <var>expr</var>, a Taylor series about zero in the variable <var>x</var>.
<code>revert</code> returns a polynomial of degree equal to the highest power in <var>expr</var>.
<code>revert2</code> returns a polynomial of degree <var>n</var>,
which may be greater than, equal to, or less than the degree of <var>expr</var>.
</p>
<p><code>load (&quot;revert&quot;)</code> loads these functions.
</p>
<p>Examples:
</p>
<table><tr><td>&nbsp;</td><td><pre class="example">(%i1) load (&quot;revert&quot;)$
(%i2) t: taylor (exp(x) - 1, x, 0, 6);
                   2    3    4    5     6
                  x    x    x    x     x
(%o2)/T/      x + -- + -- + -- + --- + --- + . . .
                  2    6    24   120   720
(%i3) revert (t, x);
               6       5       4       3       2
           10 x  - 12 x  + 15 x  - 20 x  + 30 x  - 60 x
(%o3)/R/ - --------------------------------------------
                                60
(%i4) ratexpand (%);
                     6    5    4    3    2
                    x    x    x    x    x
(%o4)             - -- + -- - -- + -- - -- + x
                    6    5    4    3    2
(%i5) taylor (log(x+1), x, 0, 6);
                    2    3    4    5    6
                   x    x    x    x    x
(%o5)/T/       x - -- + -- - -- + -- - -- + . . .
                   2    3    4    5    6
(%i6) ratsimp (revert (t, x) - taylor (log(x+1), x, 0, 6));
(%o6)                           0
(%i7) revert2 (t, x, 4);
                          4    3    2
                         x    x    x
(%o7)                  - -- + -- - -- + x
                         4    3    2
</pre></td></tr></table>
</dd></dl>


<dl>
<dt><u>Function:</u> <b>taylor</b><i> (<var>expr</var>, <var>x</var>, <var>a</var>, <var>n</var>)</i>
<a name="IDX1031"></a>
</dt>
<dt><u>Function:</u> <b>taylor</b><i> (<var>expr</var>, [<var>x_1</var>, <var>x_2</var>, ...], <var>a</var>, <var>n</var>)</i>
<a name="IDX1032"></a>
</dt>
<dt><u>Function:</u> <b>taylor</b><i> (<var>expr</var>, [<var>x</var>, <var>a</var>, <var>n</var>, 'asymp])</i>
<a name="IDX1033"></a>
</dt>
<dt><u>Function:</u> <b>taylor</b><i> (<var>expr</var>, [<var>x_1</var>, <var>x_2</var>, ...], [<var>a_1</var>, <var>a_2</var>, ...], [<var>n_1</var>, <var>n_2</var>, ...])</i>
<a name="IDX1034"></a>
</dt>
<dd>
<p><code>taylor (<var>expr</var>, <var>x</var>, <var>a</var>, <var>n</var>)</code> expands the expression <var>expr</var>
in a truncated Taylor or Laurent series in the variable <var>x</var>
around the point <var>a</var>,
containing terms through <code>(<var>x</var> - <var>a</var>)^<var>n</var></code>.
</p>
<p>If <var>expr</var> is of the form <code><var>f</var>(<var>x</var>)/<var>g</var>(<var>x</var>)</code>
and <code><var>g</var>(<var>x</var>)</code> has no terms up to degree <var>n</var>
then <code>taylor</code> attempts to expand <code><var>g</var>(<var>x</var>)</code> up to degree <code>2 <var>n</var></code>.
If there are still no nonzero terms, <code>taylor</code> doubles the
degree of the expansion of <code><var>g</var>(<var>x</var>)</code>
so long as the degree of the expansion is less than or equal to <code><var>n</var> 2^taylordepth</code>.
</p>
<p><code>taylor (<var>expr</var>, [<var>x_1</var>, <var>x_2</var>, ...], <var>a</var>, <var>n</var>)</code>
returns a truncated power series 
of degree <var>n</var> in all variables <var>x_1</var>, <var>x_2</var>, ...
about the point <code>(<var>a</var>, <var>a</var>, ...)</code>.
</p>
<p><code>taylor (<var>expr</var>, [<var>x_1</var>, <var>a_1</var>, <var>n_1</var>], [<var>x_2</var>, <var>a_2</var>, <var>n_2</var>], ...)</code>
returns a truncated power series in the variables <var>x_1</var>, <var>x_2</var>, ...
about the point <code>(<var>a_1</var>, <var>a_2</var>, ...)</code>,
truncated at <var>n_1</var>, <var>n_2</var>, ....
</p>
<p><code>taylor (<var>expr</var>, [<var>x_1</var>, <var>x_2</var>, ...], [<var>a_1</var>, <var>a_2</var>, ...], [<var>n_1</var>, <var>n_2</var>, ...])</code>
returns a truncated power series in the variables <var>x_1</var>, <var>x_2</var>, ...
about the point <code>(<var>a_1</var>, <var>a_2</var>, ...)</code>,
truncated at <var>n_1</var>, <var>n_2</var>, ....
</p>
<p><code>taylor (<var>expr</var>, [<var>x</var>, <var>a</var>, <var>n</var>, 'asymp])</code>
returns an expansion of <var>expr</var> in negative powers of <code><var>x</var> - <var>a</var></code>.
The highest order term is <code>(<var>x</var> - <var>a</var>)^<var>-n</var></code>.
</p>
<p>When <code>maxtayorder</code> is <code>true</code>, then during algebraic
manipulation of (truncated) Taylor series, <code>taylor</code> tries to retain
as many terms as are known to be correct.
</p>
<p>When <code>psexpand</code> is <code>true</code>,
an extended rational function expression is displayed fully expanded.
The switch <code>ratexpand</code> has the same effect.
When <code>psexpand</code> is <code>false</code>,
a multivariate expression is displayed just as in the rational function package.
When <code>psexpand</code> is  <code>multi</code>,
then terms with the same total degree in the variables are grouped together.
</p>
<p>See also the <code>taylor_logexpand</code> switch for controlling expansion.
</p>
<p>Examples:
</p>
<table><tr><td>&nbsp;</td><td><pre class="example">(%i1) taylor (sqrt (sin(x) + a*x + 1), x, 0, 3);
                           2             2
             (a + 1) x   (a  + 2 a + 1) x
(%o1)/T/ 1 + --------- - -----------------
                 2               8

                                   3      2             3
                               (3 a  + 9 a  + 9 a - 1) x
                             + -------------------------- + . . .
                                           48
(%i2) %^2;
                                    3
                                   x
(%o2)/T/           1 + (a + 1) x - -- + . . .
                                   6
(%i3) taylor (sqrt (x + 1), x, 0, 5);
                       2    3      4      5
                  x   x    x    5 x    7 x
(%o3)/T/      1 + - - -- + -- - ---- + ---- + . . .
                  2   8    16   128    256
(%i4) %^2;
(%o4)/T/                  1 + x + . . .
(%i5) product ((1 + x^i)^2.5, i, 1, inf)/(1 + x^2);
                         inf
                        /===\
                         ! !    i     2.5
                         ! !  (x  + 1)
                         ! !
                        i = 1
(%o5)                   -----------------
                              2
                             x  + 1
(%i6) ev (taylor(%, x,  0, 3), keepfloat);
                               2           3
(%o6)/T/    1 + 2.5 x + 3.375 x  + 6.5625 x  + . . .
(%i7) taylor (1/log (x + 1), x, 0, 3);
                               2       3
                 1   1   x    x    19 x
(%o7)/T/         - + - - -- + -- - ----- + . . .
                 x   2   12   24    720
(%i8) taylor (cos(x) - sec(x), x, 0, 5);
                                4
                           2   x
(%o8)/T/                - x  - -- + . . .
                               6
(%i9) taylor ((cos(x) - sec(x))^3, x, 0, 5);
(%o9)/T/                    0 + . . .
(%i10) taylor (1/(cos(x) - sec(x))^3, x, 0, 5);
                                               2          4
            1     1       11      347    6767 x    15377 x
(%o10)/T/ - -- + ---- + ------ - ----- - ------- - --------
             6      4        2   15120   604800    7983360
            x    2 x    120 x

                                                          + . . .
(%i11) taylor (sqrt (1 - k^2*sin(x)^2), x, 0, 6);
               2  2       4      2   4
              k  x    (3 k  - 4 k ) x
(%o11)/T/ 1 - ----- - ----------------
                2            24

                                    6       4       2   6
                               (45 k  - 60 k  + 16 k ) x
                             - -------------------------- + . . .
                                          720
(%i12) taylor ((x + 1)^n, x, 0, 4);
                      2       2     3      2         3
                    (n  - n) x    (n  - 3 n  + 2 n) x
(%o12)/T/ 1 + n x + ----------- + --------------------
                         2                 6

                               4      3       2         4
                             (n  - 6 n  + 11 n  - 6 n) x
                           + ---------------------------- + . . .
                                          24
(%i13) taylor (sin (y + x), x, 0, 3, y, 0, 3);
               3                 2
              y                 y
(%o13)/T/ y - -- + . . . + (1 - -- + . . .) x
              6                 2

                    3                       2
               y   y            2      1   y            3
          + (- - + -- + . . .) x  + (- - + -- + . . .) x  + . . .
               2   12                  6   12
(%i14) taylor (sin (y + x), [x, y], 0, 3);
                     3        2      2      3
                    x  + 3 y x  + 3 y  x + y
(%o14)/T/   y + x - ------------------------- + . . .
                                6
(%i15) taylor (1/sin (y + x), x, 0, 3, y, 0, 3);
          1   y              1    1               1            2
(%o15)/T/ - + - + . . . + (- -- + - + . . .) x + (-- + . . .) x
          y   6               2   6                3
                             y                    y

                                           1            3
                                      + (- -- + . . .) x  + . . .
                                            4
                                           y
(%i16) taylor (1/sin (y + x), [x, y], 0, 3);
                             3         2       2        3
            1     x + y   7 x  + 21 y x  + 21 y  x + 7 y
(%o16)/T/ ----- + ----- + ------------------------------- + . . .
          x + y     6                   360
</pre></td></tr></table>
</dd></dl>

<dl>
<dt><u>Option variable:</u> <b>taylordepth</b>
<a name="IDX1035"></a>
</dt>
<dd><p>Default value: 3
</p>
<p>If there are still no nonzero terms, <code>taylor</code> doubles the
degree of the expansion of <code><var>g</var>(<var>x</var>)</code>
so long as the degree of the expansion is less than or equal to <code><var>n</var> 2^taylordepth</code>.
</p>
</dd></dl>

<dl>
<dt><u>Function:</u> <b>taylorinfo</b><i> (<var>expr</var>)</i>
<a name="IDX1036"></a>
</dt>
<dd><p>Returns information about the Taylor series <var>expr</var>.
The return value is a list of lists.
Each list comprises the name of a variable,
the point of expansion, and the degree of the expansion.
</p>
<p><code>taylorinfo</code> returns <code>false</code> if <var>expr</var> is not a Taylor series.
</p>
<p>Example:
</p>
<table><tr><td>&nbsp;</td><td><pre class="example">(%i1) taylor ((1 - y^2)/(1 - x), x, 0, 3, [y, a, inf]);
                  2                       2
(%o1)/T/ - (y - a)  - 2 a (y - a) + (1 - 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  + . . .
(%i2) taylorinfo(%);
(%o2)               [[y, a, inf], [x, 0, 3]]
</pre></td></tr></table>
</dd></dl>

<dl>
<dt><u>Function:</u> <b>taylorp</b><i> (<var>expr</var>)</i>
<a name="IDX1037"></a>
</dt>
<dd><p>Returns <code>true</code> if <var>expr</var> is a Taylor series,
and <code>false</code> otherwise.
</p>
</dd></dl>

<dl>
<dt><u>Option variable:</u> <b>taylor_logexpand</b>
<a name="IDX1038"></a>
</dt>
<dd><p>Default value: <code>true</code>
</p>
<p><code>taylor_logexpand</code> controls expansions of logarithms in
<code>taylor</code> series.
</p>
<p>When <code>taylor_logexpand</code> is <code>true</code>, all logarithms 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.
</p>
<p>When <code>taylor_logexpand</code> is set to <code>false</code>, then the only expansion of logarithms
that occur is that necessary to obtain a formal power series.
</p>
</dd></dl>

<dl>
<dt><u>Option variable:</u> <b>taylor_order_coefficients</b>
<a name="IDX1039"></a>
</dt>
<dd><p>Default value: <code>true</code>
</p>
<p><code>taylor_order_coefficients</code> controls the ordering of
coefficients in a Taylor series.
</p>
<p>When <code>taylor_order_coefficients</code> is <code>true</code>,
coefficients of taylor series are ordered canonically.
</p>
</dd></dl>

<dl>
<dt><u>Function:</u> <b>taylor_simplifier</b><i> (<var>expr</var>)</i>
<a name="IDX1040"></a>
</dt>
<dd><p>Simplifies coefficients of the power series <var>expr</var>.
<code>taylor</code> calls this function.
</p>
</dd></dl>

<dl>
<dt><u>Option variable:</u> <b>taylor_truncate_polynomials</b>
<a name="IDX1041"></a>
</dt>
<dd><p>Default value: <code>true</code>
</p>
<p>When <code>taylor_truncate_polynomials</code> is <code>true</code>,
polynomials are truncated based upon the input truncation levels.
</p>
<p>Otherwise,
polynomials input to <code>taylor</code> are considered to have infinite precison.
</p>
</dd></dl>

<dl>
<dt><u>Function:</u> <b>taytorat</b><i> (<var>expr</var>)</i>
<a name="IDX1042"></a>
</dt>
<dd><p>Converts <var>expr</var> from <code>taylor</code> form to canonical rational expression (CRE) form.
The effect is the same as <code>rat (ratdisrep (<var>expr</var>))</code>, but faster.
</p>
</dd></dl>

<dl>
<dt><u>Function:</u> <b>trunc</b><i> (<var>expr</var>)</i>
<a name="IDX1043"></a>
</dt>
<dd><p>Annotates the internal representation of the general expression <var>expr</var>
so that it is displayed as if its sums were truncated Taylor series.
<var>expr</var> is not otherwise modified.
</p>
<p>Example:
</p>
<table><tr><td>&nbsp;</td><td><pre class="example">(%i1) expr: x^2 + x + 1;
                            2
(%o1)                      x  + x + 1
(%i2) trunc (expr);
                                2
(%o2)                  1 + x + x  + . . .
(%i3) is (expr = trunc (expr));
(%o3)                         true
</pre></td></tr></table>
</dd></dl>

<dl>
<dt><u>Function:</u> <b>unsum</b><i> (<var>f</var>, <var>n</var>)</i>
<a name="IDX1044"></a>
</dt>
<dd><p>Returns the first backward difference <code><var>f</var>(<var>n</var>) - <var>f</var>(<var>n</var> - 1)</code>.
Thus <code>unsum</code> in a sense is the inverse of <code>sum</code>.
</p>
<p>See also <code>nusum</code>.
</p>
<p>Examples:
</p>
<table><tr><td>&nbsp;</td><td><pre class="example">(%i1) g(p) := p*4^n/binomial(2*n,n);
                                     n
                                  p 4
(%o1)               g(p) := ----------------
                            binomial(2 n, n)
(%i2) g(n^4);
                              4  n
                             n  4
(%o2)                   ----------------
                        binomial(2 n, n)
(%i3) nusum (%, n, 0, n);
                     4        3       2              n
      2 (n + 1) (63 n  + 112 n  + 18 n  - 22 n + 3) 4      2
(%o3) ------------------------------------------------ - ------
                    693 binomial(2 n, n)                 3 11 7
(%i4) unsum (%, n);
                              4  n
                             n  4
(%o4)                   ----------------
                        binomial(2 n, n)
</pre></td></tr></table>
</dd></dl>

<dl>
<dt><u>Option variable:</u> <b>verbose</b>
<a name="IDX1045"></a>
</dt>
<dd><p>Default value: <code>false</code>
</p>
<p>When <code>verbose</code> is <code>true</code>,
<code>powerseries</code> prints progress messages.
</p>
</dd></dl>

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

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