Function reference · Calculus

product

Multiplies an expression over a range of an integer index.

With number bounds, it multiplies the terms. With a symbolic bound, it finds a closed form where it can; otherwise the call is returned unevaluated.

Notation

product(expr, index, lower, upper)

Write it in an expression: nerdamer('product(k,k,1,5)'), or in the Playground.

nerdamer.product

nerdamer.product(expr: ExpressionInput, index: ExpressionInput, lower: ExpressionInput, upper: ExpressionInput): Expression

A method on the default import. Arguments can be strings, as in Notation.

import { product }

import { product } from 'nerdamer/calculus';
product(expr: ExpressionInput, index: ExpressionInput, lower: ExpressionInput, upper: ExpressionInput): Expression

Import only this function, from nerdamer/calculus.

Examples

1·2·3·4·5.

product(k,k,1,5)
// → 120
Open in Playground

Shifted factors.

product(x+k,k,1,4)
// → (1+x)*(2+x)*(3+x)*(4+x)
Open in Playground

Multiply the entries of a vector.

W:[x,x+1,x+2]; product(W[k],k,0,size(W)[0]-1)
// → x*(1+x)*(2+x)
Open in Playground

A symbolic bound gives a factorial.

product(k,k,1,n)
// → fact(n)
Open in Playground

Good to know

  • The index is local to the call: a value stored under its name, as in k:5, isn't substituted. Stored values still apply in the bounds.

← Back to Function reference