Function reference · Calculus
sum
Adds up an expression over a range of an integer index.
With number bounds, it adds the terms. With a symbolic bound, it finds a closed form where it can, as for powers of the index; otherwise the call is returned unevaluated.
Notation
sum(expr, index, lower, upper)
Write it in an expression: nerdamer('sum(k,k,1,5)'), or in the Playground.
nerdamer.sum
nerdamer.sum(expr: ExpressionInput, index: ExpressionInput, lower: ExpressionInput, upper: ExpressionInput): Expression
A method on the default import. Arguments can be strings, as in Notation.
import { sum }
import { sum } from 'nerdamer/calculus';
sum(expr: ExpressionInput, index: ExpressionInput, lower: ExpressionInput, upper: ExpressionInput): Expression
Import only this function, from nerdamer/calculus.
Examples
Symbolic coefficients.
sum((a*k+b)^2,k,1,5)
// → (b+a)^2+(b+2*a)^2+(b+3*a)^2+(b+4*a)^2+(b+5*a)^2Open in PlaygroundThe index is local to the call, so a stored k doesn't change the terms.
k:5; sum(k,k,1,3)
// → 6Open in Playground