# numeric::product

Numerical approximation of products

### Use only in the MuPAD Notebook Interface.

This functionality does not run in MATLAB.

## Syntax

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

## Description

`numeric::product(f, i = a..b)` computes a numerical approximation of .

`numeric::product (f, i = RootOf(p,x))` computes a numerical approximation of the product of `f` over the roots of the polynomial `p`.

```numeric::product(f, i in { x1, x2, …})``` computes a numerical approximation of .

The call `numeric::product(...)` is equivalent to calling the `float` attribute of `product` via ```float ( hold( product )(...))```, ```float ( freeze( product )(...))``` or `product::float(...)`.

If there are other symbolic parameters in f, apart from the variable i, a symbolic call to `numeric::product` is returned. Numerical expressions such as , etc. are accepted and converted to floating-point numbers.

 Note:   For finite products, `numeric::product` just returns `_mult ( float(f) \$ i=a..b)`. Cf. Example 3.

The call ```numeric::product(f, i = { x1, x2, …})``` computes numerical approximations of `x[1]`, `x[2]` etc., substitutes these values into f(i) and multiplies the results.

The calls ```numeric::product(f, i in { x1, x2, …})``` and ```numeric::product(f, i = { x1, x2, …})``` are equivalent.

The call `numeric::product (f, i in RootOf(p, x))` computes numerical approximations of all roots of p, substitutes these values into f(i) and multiplies the results. Cf. Example 2.

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

## Environment Interactions

The function is sensitive to the environment variable `DIGITS`, which determines the numerical working precision and influences the maximum number of steps used in the computation.

## Examples

### Example 1

We demonstrate some equivalent calls for numerical products:

```numeric::product(1+1/k^2, k = 1..infinity), float(hold(product)(1+1/k^2, k = 1..infinity)), float(freeze(product)(1+1/k^2, k = 1..infinity)), product::float(1+1/k^2, k = 1..infinity);```

`product` fails to find a closed form for the following product:

`product(1 - 1/4^k, k = 1..infinity);`

`float` implicitly uses `numeric::product` to compute a numerical approximation:

`float(%);`

The exact value of the following infinite product is :

```numeric::product(exp((-1)^(k+1)*k^(-1/2)), k = 1..infinity) = float(exp((1-sqrt(2))*zeta(1/2)))```

### Example 2

We calculate an approximation of the product over the roots of a polynomial:

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

If the polynomial expression contains additional indeterminates, a symbolic call to `numeric::product` is returned:

`numeric::product(r+PI, r = RootOf(x^8 + c*x - PI^2/4, x))`

### Example 3

`numeric::product` can also be used to compute finite products:

`numeric::product(1-1/k^2, k = 2..10^n) \$ n in { 2, 3, 4 }`

However, since `numeric::product` uses `_mult` internally anyway, it is more efficient to call `_mult` directly:

`_mult(float(1-1/k^2) \$ k = 2..10^n) \$ n in { 2, 3, 4 }`

### Example 4

The following product is returned symbolically because it contains the additional indeterminate `k`:

`numeric::product(1-1/n^k, n = 2..infinity)`

## Parameters

 `f` An arithmetical expression depending on `i` `i` The product index: an identifier or indexed indentifier `a`, `b` integers or satisfying a ≤ b `p` A univariate polynomial expression in `x` `x` Indeterminate `x1, x2, …` numerical expressions

## Return Values

floating-point number or a symbolic expression of type `numeric::product`.

## Algorithms

Infinite products are calculated by summing the series via `numeric::sum`.

`numeric::product` uses `numeric::polyroots` to calculate numerical approximations to the roots of a polynomials.