# GeneratingFunction

GeneratingFunction[expr,n,x]

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

GeneratingFunction[expr,{n1,n2,},{x1,x2,}]

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

# Details and Options • The generating function for a sequence whose n term is an is given by .
• The multidimensional generating function is given by .
• The following options can be given:
•  Assumptions \$Assumptions assumptions to make about parameters GenerateConditions False whether to generate answers that involve conditions on parameters Method Automatic method to use VerifyConvergence True whether to verify convergence
• In TraditionalForm, GeneratingFunction is output using .

# Examples

open allclose all

## Basic Examples(3)

The generating function for the sequence whose n term is 1:

All coefficients in the series are 1:

Univariate generating function:

Multivariate:

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:

Shifts:

Multiplication by exponentials:

Multiplication by polynomials:

Conjugate:

GeneratingFunction automatically threads over lists:

Equations:

Rules:

### 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)

Linearity:

Differences and shifts:

Sums:

Integrals:

## 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:

Linearity:

Shifting:

Convolution:

Derivative:

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: