What is a Generating Function?
Definition
A function $g$, represented in the form such as $$ g(x) =\sum \limits _{n=0}^{\infty}a_{n}x^{n}= a_{0} + a_{1} x + a_{2} x^2 + \cdots $$ for a given sequence $\left\{ a_{n} \right\}$, is called the generating function of the sequence $\left\{ a_{n}\right\}$ or simply generating function. When the sequence is $a_{n}=a_{n}(x)$, it is also denoted as follows: $$ G(x,t)=\sum \limits _{n=0}^{\infty}a_{n}(x)t^{n} $$
Explanation
As sharp readers may have noticed, the Taylor series also takes a similar form. Even those who are not as sharp may have encountered a similar form called ‘power series’ during their high school years. This is because it is very suitable for exam questions to check if one has a mathematical understanding of the process of finding the sum of arithmetic and geometric sequences.
Historically, the term ‘generating function’ is known to have been named by Laplace. After differentiating both sides by $n$ times and substituting $x=0$, it results in $g^{(n)} (x) = a_{n} n!$, hence $\displaystyle a_{n} = {{g^{(n)} (x) } \over {n!}}$ can be determined. In that sense, a generating function can be thought of as a function that can restore or ‘generate’ the original given sequence.
A special case is the Maclaurin series $\displaystyle f(x) = \sum_{n=0}^{\infty} {{f^{(n)} (0)}\over{n!}} {x}^n$ as mentioned earlier. The Maclaurin series explicitly takes the sequence $a_{n}$ as the $n$ th derivative of the given function.
In the case of $1 = a_{0} = a_{1} = a_{2} = \cdots$, where all the coefficients of the terms are 1, this happily becomes the infinite geometric series $$ g(x) = 1 + x + x^2 + \cdots = {{1} \over {1-x}} $$ On the other hand, in the case of $a_{n} = n+1$, which is the sequence of natural numbers, it is the same as differentiating both sides of $\displaystyle g(x) = {{1} \over {1-x}}$ by $x$. The result is, of course, as follows: $$ g ' (x) = 1 + 2 x + 3 x^2 + \cdots = {{1} \over {(1-x)^2 }} $$ Research on generating functions may seem utterly useless at first glance, but it is widely used in various applied mathematics, including statistics, as it is generalized to power functions. (Surprisingly, Euler had been using it to solve problems in analysis and number theory even before this term was coined.)