## Maxima – 167 – Somme, prodotti e serie – 4

Continuo da qui, copio dal Reference Manual, PDF scaricabile da qui, sono a p.504.

`taylor (expr, x, a, n)`
`taylor (expr, [x_1, x_2, ...], a, n)`
`taylor (expr, [x, a, n, 'asymp])`
`taylor (expr, [x_1, x_2, ...], [a_1, a_2, ...], [n_1, n_2, ...])`
`taylor (expr, [x_1, a_1, n_1], [x_2, a_2, n_2], ...)`
`taylor (expr, x, a, n)` expands the expression `expr` in a truncated Taylor or Laurent series in the variable `x` around the point `a`, containing terms through `(x - a)^n`.

If `expr` is of the form `f(x)/g(x)` and `g(x)` has no terms up to degree `n` then `taylor` attempts to expand `g(x)` up to degree `2 n`. If there are still no nonzero terms, `taylor` doubles the degree of the expansion of `g(x)` so long as the degree of the expansion is less than or equal to `n 2^taylordepth`.

`taylor (expr, [x_1, x_2, ...], a, n)` returns a truncated power series of degree `n` in all variables `x_1, x_2, ...` about the point `(a, a, ...)`.

`taylor (expr, [x_1, a_1, n_1], [x_2, a_2, n_2], ...)` returns a truncated power series in the variables `x_1, x_2, ...` about the point `(a_1, a_2, ...)`, truncated at `n_1, n_2, ...`.

`taylor (expr, [x_1, x_2, ...], [a_1, a_2, ...], [n_1, n_2, ...])` returns a truncated power series in the variables `x_1, x_2, ...` about the point `(a_1, a_2, ...)`, truncated at `n_1, n_2, ...`.

`taylor (expr, [x, a, n, 'asymp])` returns an expansion of `expr` in negative powers of `x - a`. The highest order term is `(x - a)^-n`.

When `maxtayorder` is `true`, then during algebraic manipulation of (truncated) Taylor series, `taylor` tries to retain as many terms as are known to be correct.

When `psexpand` is `true`, an extended rational function expression is displayed fully expanded. The switch `ratexpand` has the same effect. When `psexpand` is `false`, a multivariate expression is displayed just as in the rational function package. When `psexpand` is `multi`, then terms with the same total degree in the variables are grouped together.

See also the `taylor_logexpand` switch for controlling expansion.

``````(%i1) taylor (sqrt (sin(x) + a*x + 1), x, 0, 3);
2             2       3      2             3
(a + 1) x   (a  + 2 a + 1) x    (3 a  + 9 a  + 9 a - 1) x
(%o1)/T/ 1 + --------- - ----------------- + -------------------------- + . . .
2               8                       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        6       4       2   6
k  x    (3 k  - 4 k ) x    (45 k  - 60 k  + 16 k ) x
(%o11)/T/ 1 - ----- - ---------------- - -------------------------- + . . .
2            24                     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                        3
y                       y                   y    y            2
(%o13)/T/ ((- --) + y + . . .) + (1 - -- + . . .) x + ((- -) + -- + . . .) x
6                       2                   2    12
2
1    y            3
+ ((- -) + -- + . . .) x  + . . .
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);
y   1                1     1               1            2
(%o15)/T/ (- + - + . . .) + ((- --) + - + . . .) x + (-- + . . .) x
6   y                 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``````

`taylordepth`
Default value: `3`.

If there are still no nonzero terms, taylor doubles the degree of the expansion of `g(x)` so long as the degree of the expansion is less than or equal to `n 2^taylordepth`.

`taylorinfo (expr)`
Returns information about the Taylor series `expr`. 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.

`taylorinfo` returns false if `expr` is not a Taylor series.

``````(%i1) taylor ((1 - y^2)/(1 - x), x, 0, 3, [y, a, inf]);
2                         2
(%o1)/T/ ((1 - a ) - 2 a (y - a) - (y - a) )
2                        2
+ ((- (y - a) ) - 2 a (y - a) + (1 - a )) x
2                        2    2
+ ((- (y - a) ) - 2 a (y - a) + (1 - a )) x
2                        2    3
+ ((- (y - a) ) - 2 a (y - a) + (1 - a )) x  + . . .
(%i2) taylorinfo(%);
(%o2)                      [[x, 0, 3], [y, a, inf]]``````

`taylorp (expr)`
Returns `true` if `expr` is a Taylor series, and `false` otherwise.

`taylor_logexpand`
Default value: `true`.

`taylor_logexpand` controls expansions of logarithms in taylor series.

When `taylor_logexpand` is `true`, 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.

When `taylor_logexpand` is set to `false`, then the only expansion of logarithms that occur is that necessary to obtain a formal power series.

`taylor_order_coefficients`
Default value: `true`.

`taylor_order_coefficients` controls the ordering of coefficients in a Taylor series.

When `taylor_order_coefficients` is `true`, coefficients of taylor series are ordered canonically.

`taylor_simplifier (expr)`
Simplifies coefficients of the power series `expr`. `taylor` calls this function.

`taylor_truncate_polynomials`
Default value: `true`.

When `taylor_truncate_polynomials` is `true`, polynomials are truncated based upon the input truncation levels.

Otherwise, polynomials input to `taylor` are considered to have infinite precison.

`taytorat (expr)`
Converts `expr` from `taylor` form to canonical rational expression (CRE) form. The effect is the same as `rat (ratdisrep (expr))`, but faster.

`trunc (expr)`
Annotates the internal representation of the general expression `expr` so that it is displayed as if its sums were truncated Taylor series. `expr` is not otherwise modified.

``````(%i3) expr: x^2 + x + 1;
2
(%o3)                             x  + x + 1
(%i4) trunc (expr);
2
(%o4)                         1 + x + x  + . . .
(%i5) is (expr = trunc (expr));
(%o5)                                true``````

`unsum (f, n)`
Returns the first backward difference `f(n) - f(n - 1)`. Thus `unsum` in a sense is the inverse of `sum`. See also `nusum`.

``````(%i6) g(p) := p*4^n/binomial(2*n,n);
n
p 4
(%o6)                      g(p) := ----------------
binomial(2 n, n)
(%i7) g(n^4);
4  n
n  4
(%o7)                          ----------------
binomial(2 n, n)
(%i8) nusum (%, n, 0, n);
4        3       2              n
2 (n + 1) (63 n  + 112 n  + 18 n  - 22 n + 3) 4     2
(%o8)       ------------------------------------------------ - ---
693 binomial(2 n, n)                 231
(%i9) unsum (%, n);
4  n
n  4
(%o9)                          ----------------
binomial(2 n, n)``````

`verbose`
Default value: `false`.

When `verbose` is `true`, `powerseries` prints progress messages.

Posta un commento o usa questo indirizzo per il trackback.