## Maxima – 165 – Somme, prodotti e serie – 2 Continuo da qui, copio dal Reference Manual, PDF scaricabile da qui, sono a p.497.

Funzioni e variabili per le serie

Maxima contains functions `taylor` and `powerseries` for finding the series of differentiable functions. It also has tools such as `nusum` capable of finding the closed form of some series. Operations such as addition and multiplication work as usual on series. This section presents the global variables which control the expansion.

`cauchysum`
Default value: `false`.

When multiplying together sums with `inf` as their upper limit, if `sumexpand` is `true` and `cauchysum` is `true` then the Cauchy product will be used rather than the usual product. In the Cauchy product the index of the inner summation is a function of the index of the outer one rather than varying independently.

``````(%i1) sumexpand: false\$

(%i2) cauchysum: false\$

(%i3) s: sum (f(i), i, 0, inf) * sum (g(j), j, 0, inf);
inf         inf
====        ====
\           \
(%o3)                       ( >    f(i))  >    g(j)
/           /
====        ====
i = 0       j = 0
(%i4) sumexpand: true\$

(%i5) cauchysum: true\$

(%i6) expand(s,0,0);
inf     i1
====   ====
\      \
(%o6)                    >      >     g(i1 - i2) f(i2)
/      /
====   ====
i1 = 0 i2 = 0``````

`deftaylor (f_1 (x_1), expr_1, ..., f_n (x_n), expr_n)`
For each function `f_i` of one variable `x_i`, `deftaylor` defines `expr_i` as the Taylor series about zero. `expr_i` is typically a polynomial in `x_i` or a summation; more general expressions are accepted by `deftaylor` without complaint.

`powerseries (f_i(x_i), x_i, 0)` returns the series defined by `deftaylor`.

`deftaylor` returns a list of the functions `f_1, ..., f_n`. `deftaylor` evaluates its arguments.

``````(%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)                         >     -------- + 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``````

`maxtayorder`
Default value: `true`.

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.

`niceindices (expr)`
Renames the indices of sums and products in `expr`. `niceindices` attempts to rename each index to the value of `niceindicespref`, unless that name appears in the summand or multiplicand, in which case `niceindices` tries the succeeding elements of `niceindicespref` 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 `niceindicespref`, e.g., `i0, i1, i2, ...`.

`niceindices` returns an expression. `niceindices` evaluates its argument.

``````(%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)                   ! !     >      f(bar i j + foo)
! !    /
bar = 1 ====
foo = 1
(%i3) niceindices (%);
inf  inf
/===\ ====
! !  \
(%o3)                       ! !   >    f(i j l + k)
! !  /
l = 1 ====
k = 1``````

`niceindicespref`
Default value: `[i, j, k, l, m, n]`.

`niceindicespref` is the list from which `niceindices` takes the names of indices for sums and products.

The elements of `niceindicespref` are typically names of variables, although that is not enforced by `niceindices`.

``````(%i4) niceindicespref: [p, q, r, s, t, u]\$

(%i5) product (sum (f (foo + i*j*bar), foo, 1, inf), bar, 1, inf);
inf    inf
/===\   ====
! !    \
(%o5)                   ! !     >      f(bar i j + foo)
! !    /
bar = 1 ====
foo = 1
(%i6) niceindices (%);
inf  inf
/===\ ====
! !  \
(%o6)                       ! !   >    f(i j q + p)
! !  /
q = 1 ====
p = 1``````

`nusum (expr, x, i_0, i_1)`
Carries out indefinite hypergeometric summation of `expr` with respect to `x` using a decision procedure due to R.W. Gosper. `expr` and the result must be expressible as products of integer powers, factorials, binomials, and rational functions.

The terms “definite” and “indefinite summation” are used analogously to “definite” and “indefinite integration”. To sum indefinitely means to give a 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, `nusum` can’t do it.

`nusum` and `unsum` know a little about sums and differences of finite products. See also `unsum`.

``````(%i7) nusum (n*n!, n, 0, n);

solve: dependent equations eliminated: (1)
(%o7)                            (n + 1)! - 1
(%i8) 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
(%o8)       ------------------------------------------------ - ---
693 binomial(2 n, n)                 231
(%i9) unsum (%, n);
4  n
n  4
(%o9)                          ----------------
binomial(2 n, n)
(%i10) unsum (prod (i^2, i, 1, n), n);
n - 1
/===\
! !   2
(%o10)                    ( ! !  i ) (n - 1) (n + 1)
! !
i = 1
(%i11) nusum (%, n, 1, n);

solve: dependent equations eliminated: (2 3)
n
/===\
! !   2
(%o11)                            ! !  i  - 1
! !
i = 1``````

Posta un commento o usa questo indirizzo per il trackback.