symprod

Product of series

Description

example

F = symprod(f,k,a,b) returns the product of the series with terms that expression f specifies, which depend on symbolic variable k. The value of k ranges from a to b. If you do not specify k, symprod uses the variable that symvar determines. If f is a constant, then the default variable is x.

example

F = symprod(f,k) returns the product of the series that expression f specifies, which depend on symbolic variable k. The value of k starts at 1 with an unspecified upper bound. The product F is returned in terms of k where k represents the upper bound. This product F differs from the indefinite product. If you do not specify k, symprod uses the variable that symvar determines. If f is a constant, then the default variable is x.

Examples

Find Product of Series Specifying Bounds

Find the following products of series

$\begin{array}{l}P1=\prod _{k=2}^{\infty }1-\frac{1}{{k}^{2}},\\ P2=\prod _{k=2}^{\infty }\frac{{k}^{2}}{{k}^{2}-1}.\end{array}$

syms k
P1 = symprod(1 - 1/k^2, k, 2, Inf)
P2 = symprod(k^2/(k^2 - 1), k, 2, Inf)
P1 =
1/2
P2 =
2

Alternatively, specify bounds as a row or column vector.

syms k
P1 = symprod(1 - 1/k^2, k, [2 Inf])
P2 = symprod(k^2/(k^2 - 1), k, [2; Inf])
P1 =
1/2
P2 =
2

Find Product of Series Specifying Product Index and Bounds

Find the product of series

$P=\prod _{k=1}^{10000}\frac{{e}^{kx}}{x}.$

syms k x
P = symprod(exp(k*x)/x, k, 1, 10000)
P =
exp(50005000*x)/x^10000

Find Product of Series with Unspecified Bounds

When you do not specify the bounds of a series are unspecified, the variable k starts at 1. In the returned expression, k itself represents the upper bound.

Find the products of series with an unspecified upper bound

$\begin{array}{l}P1=\prod _{k}k,\\ P2=\prod _{k}\frac{2k-1}{{k}^{2}}.\end{array}$

syms k
P1 = symprod(k, k)
P2 = symprod((2*k - 1)/k^2, k)
P1 =
factorial(k)
P2 =
(1/2^(2*k)*2^(k + 1)*factorial(2*k))/(2*factorial(k)^3)

Input Arguments

collapse all

Expression defining terms of series, specified as a symbolic expression, function, constant, or a vector or matrix of symbolic expressions, functions, or constants.

Product index, specified as a symbolic variable. If you do not specify this variable, symprod uses the default variable that symvar(expr,1) determines. If f is a constant, then the default variable is x.

Lower bound of product index, specified as a number, symbolic number, variable, expression, or function (including expressions and functions with infinities).

Upper bound of product index, specified as a number, symbolic number, variable, expression, or function (including expressions and functions with infinities).

collapse all

Definite Product

The definite product of a series is defined as

$\prod _{i=a}^{b}{x}_{i}={x}_{a}\cdot {x}_{a+1}\cdot \dots \cdot {x}_{b}$

Indefinite Product

The indefinite product of xi over i is

$f\left(i\right)=\prod _{i}{x}_{i}$

This definition holds under the assumption that the following identity is true for all values of i.

$\frac{f\left(i+1\right)}{f\left(i\right)}={x}_{i}$

Note

symprod does not compute indefinite products.