---
title: "Summation of Infinite Series"
canonical: "https://docs.magma-maths.org/v2.30-1/BasicRings/RealAndComplexFields/infinite-summation.html"
source: "https://docs.magma-maths.org/v2.30-1/BasicRings/RealAndComplexFields/infinite-summation.md"
part: "Basic Rings"
chapter: "Real and Complex Fields"
breadcrumbs:
  - {"title": "Magma Handbook", "source": "https://docs.magma-maths.org/v2.30-1/index.md"}
  - {"title": "Basic Rings", "source": "https://docs.magma-maths.org/v2.30-1/BasicRings/index-basic-rings.md"}
  - {"title": "Real and Complex Fields", "source": "https://docs.magma-maths.org/v2.30-1/BasicRings/RealAndComplexFields/index-real-and-complex-fields.md"}
prev: {"title": "Other Special Functions", "source": "https://docs.magma-maths.org/v2.30-1/BasicRings/RealAndComplexFields/special.md"}
next: {"title": "Numerical Integration", "source": "https://docs.magma-maths.org/v2.30-1/BasicRings/RealAndComplexFields/integration1.md"}
intrinsics:
  - {"name": "InfiniteSum", "signature": "InfiniteSum(m, i): Map, RngIntElt -> FldReElt"}
  - {"name": "PositiveSum", "signature": "PositiveSum(m, i): Map, RngIntElt -> FldReElt"}
  - {"name": "AlternatingSum", "signature": "AlternatingSum(m, i): Map, RngIntElt -> FldReElt"}
---

# Summation of Infinite Series

There are three functions for evaluating infinite sums of real numbers. The sum should be specified as a map $m$ from the integers to the real field, such that $m(n)$ is the $n^{\rm th}$ term of the sum. The summation begins at term $i$. The precision of the result will be the default precision of the real field.

<a id="function-infinitesum-map-rngintelt"></a>
## `InfiniteSum(m, i): Map, RngIntElt -> FldReElt`

An approximation to the infinite sum $m(i)+m(i+1)+m(i+2)+\cdots$. This function also works for maps to the complex field.

<a id="function-positivesum-map-rngintelt"></a>
## `PositiveSum(m, i): Map, RngIntElt -> FldReElt`

An approximation to the infinite sum $m(i)+m(i+1)+m(i+2)+\cdots$. Designed for series in which every term is positive, it uses van Wijngaarden’s trick for converting the series into an alternating one. Due to the stopping criterion, terms equal to 0 will create problems and should be removed.

<a id="function-alternatingsum-map-rngintelt"></a>
## `AlternatingSum(m, i): Map, RngIntElt -> FldReElt`

```magma
Al: MonStgElt                    Default: "Villegas"
```

An approximation to the infinite sum $m(i)+m(i+1)+m(i+2)+\cdots$. Designed for series in which the terms alternate in sign. The optional argument `Al` can be used to specify the algorithm used. The possible values are `"Villegas"` (the default), and `"EulerVanWijngaarden"`. Due to the stopping criterion, terms equal to 0 will create problems and should be removed.
