Using generating functions to solve the recurrence relation for factorials

124 Views Asked by At

Consider the recurrence relation $a_n = n a_{n-1}$ with initial condition $a_0=1$, by generating functions, I got the above expression as:

$$ A(x) = \frac{d}{dx} (xA)$$

With $A(x) = \sum_n x^n a_n$

On solving the DE I get:

$$ A(x) =C$$

Did I do something wrong? because the answer seems quite strange..


Deriving the DE:

$$A(x) = a_o + a_1 x ... =\sum a_n x^n $$

$$ \frac{d}{dx}(xA)= a_o + 2a_1 x... = \sum_n n a_{n-1} x^n$$

Multiply $x^n$ on both sides of $a_n = na_{n-1}$ and plug the above two relations, this gives:

$$A(x)= \frac{d}{dx}(xA)$$

Or,

$$ A'(x) x = 0$$

Or, $A(x)=C$

... now what went wrong?

2

There are 2 best solutions below

1
On BEST ANSWER

If $A(x) =\sum_{n=0}^{\infty} a_nx^n $ then $xA(x) =\sum_{n=0}^{\infty} a_nx^{n+1} $ so

$\begin{array}\\ (xA(x))' &=\sum_{n=0}^{\infty} (n+1)a_nx^{n}\\ &=\sum_{n=1}^{\infty} na_{n-1}x^{n-1}\\ &=\sum_{n=1}^{\infty} a_nx^{n-1}\\ &=\dfrac1{x}\sum_{n=1}^{\infty} a_nx^{n}\\ &=\dfrac1{x}(A(x)-a_0)\\ \end{array} $

so $xA'+A =\dfrac1{x}(A-a_0) $.

2
On

A more direct form of marty's answer, it had to do with the index of summation:

$$a_n = n a_{n-1}$$

Multiply both sides by $x^n$ and sum from n=1 to infty,

$$ \sum_{n=1} a_n x^n = \sum_{n=1}n a_{n-1} x^n$$

We do this because $a_0$ is not defined