# Documentation

### This is machine translation

Translated by
Mouseover text to see original. Click the button below to return to the English verison of the page.

# `product`

Definite and indefinite products

MATLAB live scripts support most MuPAD functionality, though there are some differences. For more information, see Convert MuPAD Notebooks to MATLAB Live Scripts.

## Syntax

```product(`f`, `i`)
product(`f`, `i = a .. b`)
product(`f`, `i = RootOf(p, <x>)`)
product(`f`, `i in RootOf(p, <x>)`)
product(`f`, `i in {x1, x2, …}`)
```

## Description

`product(f, i)` computes the indefinite product of f(i) with respect to i, i.e., a closed form g such that .

`product(f, i = a..b)` tries to find a closed form representation of the product .

`product (f, i = RootOf(p, x))` computes the product of f(i) over the roots of the polynomial p.

```product(f, i in { x1, x2, …})``` computes the product .

`product` 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 .

It is implicitly assumed that `i` runs through integers only.

`product(f, i = a..b)` computes the definite product with `i` running from `a` to `b`. It is implicitly assumed that ab; it is an error if this is inconsistent.

`a` and `b` must not be numbers other than integers.

If `b-a` is an integer, the explicit product f(a) f(a + 1) … f(b) is returned if it has no more than 1000 factors.

`product (f, i = RootOf(p, x))` computes the definite product with `i` running through the roots of the polynomial `p` in `x` according to their multiplicity, i.e., the number of factors is equal to the degree of `p`.

The calls `product (f, i = RootOf(p, x))` and ```product (f, i in RootOf(p, x))``` are equivalent.

The system returns a symbolic `product` call if it cannot compute a closed form representation of the product.

## Examples

### Example 1

Each of the following two calls computes the product 1 2 3 4 5:

`product(i, i = 1..5) = _mult(i \$ i = 1..5)`

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)`

Since the upper boundary is a symbolic identifier, `_mult` cannot handle this product:

`_mult(i \$ i = 1..n)`

The corresponding indefinite product is:

`product(i, i)`

The indefinite and the definite product of 2 i + 1 are:

`product(2*i + 1, i)`

`product(2*i + 1, i = 1..n)`

The boundaries may be symbolic expressions or as well:

`product(i^2/(i^2 - 1), i = 2..infinity)`

The system cannot find closed forms of the following two products and returns symbolic `product` calls:

`delete f: product(f(i), i)`

`product((1 + 2^(-i)), i = 1..infinity)`

An approximation can be computed numerically via `float`:

`float(%)`

Alternatively, you can call `numeric::product` directly. This is usually more efficient, since it skips the symbolic computations performed by `product`:

`numeric::product((1 + 2^(-i)), i = 1..infinity)`

### Example 2

Some products over the roots of a polynomial:

`product(1 + 1/x, x = RootOf(x^2 - 5*x + 6))`

`product(r+c, r = RootOf(x^3 + a*x^2 + b*x + c, x))`

The multiplicity of roots is taken into account:

`product(x+2, x in RootOf(x^5))`

MuPAD® finds closed forms for products of rational expressions. In other cases, a symbolic call to `product` is returned:

`product(sin(r), r = RootOf(x^2 - PI^2/4, x))`

An approximation can be computed numerically via `float`:

`float(%)`

### Example 3

Some products over elements of a set:

`product(x+2, x in {2,4,8})`

`product(a*x, x in {3, b, 5})`

Identical objects appear only once in a set. Therefore, the second `a` in the following example has no effect on the result:

`product(-x, x in {a,a,7,b})`

## Parameters

 `f` An arithmetical expression depending on `i` `i` The product index: an identifier or indexed indentifier `a`, `b` The boundaries: arithmetical expressions `p` A polynomial expression in `x` `x` Indeterminate

## Algorithms

The product over the roots of a polynomial is computed via `polylib::resultant`.