Difference between generating functions and formal power series So I was reading about generating functions and formal power series, and it seems that these two concepts are used interchangeably.
Can someone please tell me the difference between them? Is generating functions a method that involves using formal power series?
Thanks.
 A: There is a close relationship between generating functions and formal power series.
However, they are not the same. Given a sequence, $\,a_0,a_1,a_2,\dots,\,$ define the
formal power series $\,f(x):=a_0+a_1x+a_2x^2+\dots\,$ associated to the sequence.
The sequence and the formal power series are almost exactly the same except
for the $\,x\,$ associated with the power series. Note that the $\,f(x)\,$
and the power series are defined to be exactly the same. The notation $\,f(x)\,$ suggests that it is a function, but with restrictions
since the series may not converge for all $\,x,\,$ hence the reason for the "formal"
in the name. For example, $\,f(rx) = a_0+a_1rx+a_2r^2x^2+\dots\,$ is defined
but $\,f(1+x)\,$ is not defined. So $\,f(y)\,$ is defined for $\,y\,$
being a formal power series with constant term of $\,0.$ It is a function
defined on a subset of formal power series. More precisely, there is an
operation of substitution defined on formal power series, with restrictions,
and if $\,y:=b_1x+b_2x^2+\dots,\,$ then $\,f(y)\,$ denotes the substitution
of $\,y\,$ into $\,f(x).\,$ Thus, $\,f(x)\,$ is an ordinary formal power
series, but the substitution (also known as the evaluation) operation which
maps $\,y\,$ to $\,f(y)\,$ is the "function" associated with $\,f(x).\,$
The idea is that an ordinary algebraic expression, for example,
$\,\frac{1}{1-rx}\,$ may be "expanded" into the power series $\,1+rx+rx^2+\dots\,$
associated with the sequence $\,1,r,r^2,\dots\,$ and hence $\,\frac{1}{1-rx}\,$ is
the generating function of the sequence. The idea is that the generating function
may sometimes be determined algebraically using some recurrence satisfied by the
sequence and that this may help to determine an expression for the sequence itself.
In the example, the recurrence relation $\,a_{n+1}=r\,a_n\,$ with initial value of
$\,a_0=1\,$ is translated into the algebraic equation $\,\frac{f(x)-1}x=r\,f(x)\,$
whose unique solution is $\,f(x)=\frac{1}{1-rx}.\,$
There are variations of generating functions besides the usual, ordinary one. For
example, $\,f(x):= a_0 + a_1\frac{x^1}{1!} + a_2\frac{x^2}{2!}+\dots\,$ is called
the exponential generating function of the sequence. Another example,
$\,f(s):= \frac{a_1}{1^s}+\frac{a_2}{2^s}+\frac{a_3}{3^s}\dots\,$ is called the
Dirichlet generating function of the sequence.
A: Generating functions come in two different flavours. Given a counting function $a:\mathbb{N}_{0}\to\mathbb{C}$ often written as sequence $(a_n)_{n\geq 0}$ we can associate with it a power series
\begin{align*}
A(z)=\sum_{n=0}^\infty a_nz^n\tag{1}
\end{align*}
which is called generating function (GF) of the sequence. We can view a GF as a purely formal, i.e. algebraic object.
GF as algebraic object:
Here we consider the ring (or algebra) $\left(K[[z]],+.\cdot\right)$ of formal power series
\begin{align*}
A(z)=\sum_{n=0}^\infty a_nz^n
\end{align*}
which are subject to addition, multiplication, composition, etc. obeying corresponding rules. The term formal is used to address purely algebraic objects. The indeterminate $z^n$ is just a mark for where the $n$-th coefficient $a_n$ is placed.


*

*In this context a generating function and a formal power series are considered to be the same.


*But there is more we can do with generating functions. They can also be viewed as analytic objects.

GF as analytic object:
In order to get information about the behavior of numerical sequences $a_n$ for large $n$, we study the corresponding generating functions   $A(z)$. Here complex analysis plays a key role and the asymptotic study of function is essential for gaining insight.
With respect to the asymptotic  behavior of the coefficients from $A(z)$, P. Flajolet and R.  Sedgewick  motivate in  Analytic   Combinatorics this as follows:

Comparatively little benefit results from assigning only real values to the variable $z$ that figures in a univariate generating function. In contrast, assigning complex values turns out to have serendipitous consequences.
...
When we do so, a generating function becomes a geometric transformation of the complex plane. This transformation is very regular near the origin—one says that it is analytic (or holomorphic). In other words, near $0$, it only effects a smooth distortion of the complex plane. Farther away from the origin, some cracks start appearing in the picture. These cracks—the dignified name is singularities—correspond to the disappearance of smoothness. It turns out that a function’s singularities provide a wealth of information regarding the function’s coefficients, and especially their asymptotic rate of growth. Adopting  geometric point of view for generating functions has a large pay-off.

I'd like to give two examples which are presented in section IV.1 Generating functions as analytic objects in the book by P. Flajolet and R.  Sedgewick. They consider the ordinary generating function (OGF) $f(z)$ of the Catalan numbers and the exponential generating function (EGF) $g(z)$ of the derangements.
These functions are
\begin{align*}
\color{blue}{f(z)=\frac{1}{2}\left(1-\sqrt{1-4z}\right)\qquad\qquad g(z)=\frac{\exp(-z)}{1-z}}
\end{align*}
At this stage, these generating functions are just compact descriptions of formal power series built from the elementary series
\begin{align*}
&(1-y)^{-1}=1+y+y^2+\cdots,\qquad(1-y)^{1/2}=1-\frac{1}{2}y-\frac{1}{8}y^2-\cdots,\\
&\exp(y)=1+\frac{1}{1!}y+\frac{1}{2!}y^2+\cdots
\end{align*}
by standard composition rules. Accordingly, the coefficients of both GFs are known in explicit form:
\begin{align*}
\color{blue}{
f_n}&\color{blue}{:=[z^n]f(z)=\frac{1}{n}\binom{2n-2}{n-1},}\\
\color{blue}{g_n}&\color{blue}{:=[z^n]g(z)=\frac{1}{0!}-\frac{1}{1!}+\cdots+\frac{(-1)^n}{n!}}
\end{align*}
But, when we change the view and consider $f$ and $g$ as analytic objects, we obtain asymptotic results
\begin{align*}
\color{blue}{f_n\underset{n\to\infty}{\sim}\frac{4^{n-1}}{\sqrt{\pi n^3}},\qquad g_n\underset{n\to\infty}{\sim}\frac{1}{e}}
\end{align*}
Note: The two different views of generating functions are nicely presented in Analytic Combinatorics by P. Flajolet and R. Sedgewick. This book contains a

*

*Part A - Symbolic Methods where generating functions are treated as formal power series and a


*Part B - Complex Asymptotics where generating functions are treated as analytic objects.
