gives the generating function in x for the sequence whose n^(th) series coefficient is given by the expression expr.


gives the multidimensional generating function in x1,,xm whose n1, ,nm coefficient is given by expr.

Details and Options


open allclose all

Basic Examples  (3)

The generating function for the sequence whose n^(th) term is 1:

All coefficients in the series are 1:

Univariate generating function:


The generating function for a shifted sequence:

Scope  (23)

Basic Uses  (7)

Generating function of a univariate function:

Generating function of a multivariate function:

Compute a typical generating function:

Plot the magnitude using Plot3D, ContourPlot or DensityPlot:

Plot the complex phase:

Generate conditions for the region of convergence:

Plot the region for :

Evaluate the generating function at a point:

Plot the spectrum:

The phase:

Plot both the spectrum and the plot phase using color:

Plot the spectrum in the complex plane using ParametricPlot3D:

GeneratingFunction will use several properties including linearity:


Multiplication by exponentials:

Multiplication by polynomials:


GeneratingFunction automatically threads over lists:



TraditionalForm typesetting:

Special Sequences  (12)

Discrete impulses:

Discrete unit steps:

Discrete ramps:

Polynomials result in rational generating functions:

Factorial polynomials:

Exponential functions:

Exponential polynomials:

Factorial exponential polynomials:

Trigonometric functions:

Trigonometric, exponential and polynomial:

Combinations of the previous input will also generate rational generating functions:

Different ways of expressing piecewise-defined signals:

Rational functions:

Rational exponential functions:

Hypergeometric term sequences:

The DiscreteRatio is rational for all hypergeometric term sequences:

Many functions give hypergeometric terms:

Any products are hypergeometric terms:

Generating functions of hypergeometric terms:

Holonomic sequences:

A holonomic sequence is defined by a linear difference equation:

Many special function are holonomic sequences in their index:

Special sequences:

Periodic sequences:

Multivariate generating functions:

Special Operators  (4)


Differences and shifts:



Generalizations & Extensions  (1)

Compute the generating function at a point:

Options  (6)

Assumptions  (1)

In general, this generating function cannot be given:

By providing additional Assumptions, a closed form can be given:

GenerateConditions  (1)

By default, no conditions are given for where a generating function is convergent:

Use GenerateConditions to generate conditions of validity:

Method  (1)

Different methods may produce different results:

VerifyConvergence  (3)

Setting VerifyConvergence to False will treat generating functions as formal objects:

Setting VerifyConvergence to True will verify that the radius of convergence is nonzero:

In addition, setting GenerateConditions to True will display the conditions for convergence:

Properties & Relations  (5)

Use SeriesCoefficient to get the sequence from its generating function:

GeneratingFunction effectively computes an infinite sum:

GeneratingFunction and ZTransform can be expressed in terms of each other:





GeneratingFunction is closely related to ExponentialGeneratingFunction:



Possible Issues  (1)

A GeneratingFunction may not converge for all values of parameters:

Use GenerateConditions to get the region of convergence:

Neat Examples  (1)

Create a gallery of generating functions:

Wolfram Research (2008), GeneratingFunction, Wolfram Language function,


Wolfram Research (2008), GeneratingFunction, Wolfram Language function,


Wolfram Language. 2008. "GeneratingFunction." Wolfram Language & System Documentation Center. Wolfram Research.


Wolfram Language. (2008). GeneratingFunction. Wolfram Language & System Documentation Center. Retrieved from


@misc{reference.wolfram_2024_generatingfunction, author="Wolfram Research", title="{GeneratingFunction}", year="2008", howpublished="\url{}", note=[Accessed: 26-May-2024 ]}


@online{reference.wolfram_2024_generatingfunction, organization={Wolfram Research}, title={GeneratingFunction}, year={2008}, url={}, note=[Accessed: 26-May-2024 ]}