<s>[INST] How to get closed form from generating function? I have this generating function:
$$\frac{1}{2}\, \left( {\frac {1}{\sqrt {1-4\,z}}}-1 \right)  \left( \,{
\frac {1-\sqrt {1-4\,z}}{2z}}-1 \right)$$
and I know that $\frac {1}{\sqrt {1-4\,z}}$ is the generating function for the sequence $\binom {2n} {n}$, and $\frac {1-\sqrt {1-4\,z}}{2z}$ is the generating function for the sequence $\frac {1}{n+1}\binom{2n} {n}$.
Now, I thought that I could substitute those in there, and where they multiply I'll use a summation like this:
$$\frac{1}{2}\left( 1-\frac{1}{n+1}\binom{2n} {n}-\binom{2n} {n} + 
\sum_{k=0}^n \frac{1}{k+1} \binom{2k}{k}\binom{2(n-k)}{n-k}
\right)$$
Could this be right? It doesn't seem to work when I try in Maple. What else could I do?
I already know that the end sequence will be $\binom{2n-1}{n-2}$ if this can help...
 [/INST] With  this  type  of  problem  Lagrange  inversion  is  the  preferred
approach. Suppose we seek to extract coefficients from
$$Q(z) = \frac{1}{2}
\left(\frac{1}{\sqrt{1-4z}}-1\right)
\left(\frac{1-\sqrt{1-4z}}{2z}-1\right).$$
The closed form for the coefficients is
$$[z^n] Q(z) = \frac{1}{2\pi i}
\int_{|z|=\epsilon}
\frac{1}{z^{n+1}}
\frac{1}{2}
\left(\frac{1}{\sqrt{1-4z}}-1\right)
\left(\frac{1-\sqrt{1-4z}}{2z}-1\right) \; dz.$$
Now put $1-4z=w^2$ so that $1/4-z=1/4 \times w^2$ or $z=1/4\times(1-w^2)$ 
and $dz = -1/2 \times w\; dw.$
This gives for the integral
$$-\frac{1}{2\pi i}
\int_{|w-1|=\epsilon}
\frac{w}{4}
\frac{4^{n+1}}{(1-w^2)^{n+1}}
\left(\frac{1}{w}-1\right)
\left(\frac{1-w}{2\times 1/4\times(1-w^2)}-1\right) \; dw
\\ = -\frac{1}{2\pi i}
\int_{|w-1|=\epsilon}
\frac{4^n}{(1-w^2)^{n+1}}
(1-w)
\left(\frac{2}{1+w}-1\right) \; dw
\\ = -\frac{1}{2\pi i}
\int_{|w-1|=\epsilon}
\frac{4^n}{(1-w)^n (1+w)^{n+1}}
\left(\frac{2}{1+w}-1\right) \; dw
\\ = -\frac{1}{2\pi i}
\int_{|w-1|=\epsilon}
\frac{4^n}{(1-w)^n (1+w)^{n+1}}
\frac{1-w}{1+w} \; dw
\\ = -\frac{1}{2\pi i}
\int_{|w-1|=\epsilon}
\frac{4^n}{(1-w)^{n-1} (1+w)^{n+2}} \; dw.$$
Prepare for coefficient extraction.
$$-\frac{1}{2\pi i}
\int_{|w-1|=\epsilon}
\frac{4^n}{(1-w)^{n-1} (2+(w-1))^{n+2}} \; dw
\\= -\frac{1}{2\pi i}
\int_{|w-1|=\epsilon} \frac{4^n}{2^{n+2}}
\frac{1}{(1-w)^{n-1} (1+(w-1)/2)^{n+2}} \; dw
\\= \frac{1}{2\pi i}
\int_{|w-1|=\epsilon} 2^{n-2} 
\frac{(-1)^n}{(w-1)^{n-1}}
\sum_{q\ge 0} {q+n+1\choose n+1} (-1)^q
\frac{(w-1)^q}{2^q} \; dw.$$
We need the coefficient $[(w-1)^{n-2}]$ which is
$$2^{n-2} (-1)^n {n-2+n+1\choose n+1} (-1)^{n-2} 
\frac{1}{2^{n-2}} = {2n-1\choose n+1}$$
or alternatively
$${2n-1\choose n-2}.$$
</s>