product -- definite and
indefinite products
Introductionproduct(f, i) computes the indefinite
product of f(i) with respect to i, i.e., a closed
form g such that g(i+1)/g(i)=f(i).
product(f, i = a..b) tries to find a
closed form representation of the product
product(f(i),i=a..b).
Call(s)product(f, i)
product(f, i = a..b)
Parametersf |
- | an arithmetical expression
depending on i |
i |
- | the product index: an identifier |
a, b |
- | the boundaries: arithmetical expressions |
Returns
Related
Functions
Detailsproduct serves for simplifying symbolic
products. It should not be used for multiplying a finite
number of terms: if a and b are integers of
type DOM_INT, the call
_mult(f $ i = a..b) is
more efficient than product(f, i =
a..b).product(f, i) computes the indefinite
product of f with respect to i. This is an
expression g such that f(i) = g(i + 1) /
g(i).product(f, i = a..b) computes the
definite product with i running from a to
b.
If b-a is a nonnegative integer then the explicit
product f(a)*f(a + 1)* ... *f(b) is returned.
If b-a is a negative integer, then the reciprocal of
the result of product(f, i = b+1..a-1) is
returned. If the latter is zero, then the system issues an error
message. With this convention, the rule
product(f, i = a..b) * product(f, i = b+1..c) = product(f, i =
a..c)
is satisfied for any a, b, and
c.
product call if it
cannot compute a closed form representation of the product.
Example
1Each of the following two calls computes the product 1·2·3 ·4 ·5:
>> product(i, i = 1..5) = _mult(i $ i = 1..5)
120 = 120
However, using _mult is usually more efficient when
the boundaries are integers of type DOM_INT.
There is a closed form of this definite product from 1 to n:
>> product(i, i = 1..n)
gamma(n + 1)
Since the upper boundary is a symbolic identifier n, _mult cannot handle this product:
>> _mult(i $ i = 1..n)
Error: Illegal argument [_seqgen]
The corresponding indefinite product is:
>> product(i, i);
gamma(i)
The indefinite and the definite product of 2*i + 1 are:
>> product(2*i + 1, i)
i
2 gamma(i + 1/2)
>> product(2*i + 1, i = 1..n)
n + 1
2 gamma(n + 3/2)
---------------------
1/2
PI
The boundaries may be symbolic expressions or +-infinity as well:
>> product(2*i/(i + 2), i = a..b)
b + 1
gamma(a + 2) gamma(b + 1) 2
--------------------------------
a
gamma(a) gamma(b + 3) 2
>> product(i^2/(i^2 + 2*i + 1), i = 2..infinity)
4
The system cannot find closed forms of the following two
products and returns symbolic product calls:
>> delete f: product(f(i), i)
product(f(i), i)
>> product((1 + 2^(-i)), i = 1..infinity)
/ 1 \
product| -- + 1, i = 1..infinity |
| i |
\ 2 /