Sum

Input: Sum(f(n), For(n, a, b))
$$\sum_{n=a}^{b} f(n)$$

Sum of $f(n)$ for integers $n$ from $a$ to $b$, where $a$ and $b$ should be integers or $-\infty$ or $\infty$. If $b < a$, the sum is empty. The sum $\sum_{n=0}^{\infty} f(n)$ is interpreted as $\lim_{N \to \infty} \sum_{n=0}^{N} f(n)$ and can be conditionally convergent.

Input: Sum(f(n), For(n, a, b), P(n))
$$\sum_{\textstyle{n=a \atop P(n)}}^{b} f(n)$$

The same meaning as $\sum_{n=a}^{b} f(n)$, except that only terms satisfying the predicate $P(n)$ are included in the sum.

Input: Sum(f(x), ForElement(x, S))
$$\sum_{x \in S} f(x)$$

Sum of $f(x)$ for all $x$ in the set $S$. The sum is required to be absolutely convergent.

Input: Sum(f(x), ForElement(x, S), P(x))
$$\sum_{\textstyle{x \in S \atop P(x)}} f(x)$$

Sum of $f(x)$ for all $x$ in the set $S$ satisfying the predicate $P(x)$. The sum is required to be absolutely convergent.

Input: Sum(f(x), For(x), P(x))
$$\sum_{P(x)} f(x)$$

Sum of $f(x)$ for all $x$ satisfying the predicate $P(x)$. The predicate $P(x)$ should define the domain of $x$ unambiguously; that is, it should include a statement such as $x \in S$ where $S$ is a known set. The sum is required to be absolutely convergent.

Input: Equal(Sum(f(x), ForElement(x, Set())), 0)
$$\sum_{x \in \left\{\right\}} f(x) = 0$$

The empty sum is the number $0$.

Input: Equal(Sum(KroneckerDelta(x, 0), ForElement(x, RR)), 1)
$$\sum_{x \in \mathbb{R}} \delta_{(x,0)} = 1$$

A sum can range over an uncountable number of terms, as long as only countably many terms are nonzero.

Symbolic evaluation examples

Input: Sum(1/n, For(n, 1, 10))
$$\sum_{n=1}^{10} \frac{1}{n}$$
Output: Div(7381, 2520)   (evaluated by pygrim in 0.0057 s)
$$\frac{7381}{2520}$$

Input: Sum(f(1/n), For(n, -3, 3), NotEqual(n, 0))
$$\sum_{\textstyle{n=-3 \atop n \ne 0}}^{3} f\!\left(\frac{1}{n}\right)$$
Output: Add(f(Div(-1, 3)), f(Div(-1, 2)), f(-1), f(1), f(Div(1, 2)), f(Div(1, 3)))   (evaluated by pygrim in 0.0050 s)
$$f\!\left(-\frac{1}{3}\right) + f\!\left(-\frac{1}{2}\right) + f(-1) + f(1) + f\!\left(\frac{1}{2}\right) + f\!\left(\frac{1}{3}\right)$$

Input: Sum(f(n), For(n, 1, 0))
$$\sum_{n=1}^{0} f(n)$$
Output: 0   (evaluated by pygrim in 0.0001 s)
$$0$$

Last updated: 2020-03-06 00:22:16