Let $L_n$ be the set of all the paths from $(0,0)$ to $(n,0)$ such that every step is $u=(1,1)$ , $d=(1,-1)$ and $r=(2,0)$. Notice that the path could go under the $x$ axis.
a. Write a generating function of the number of paths in $L_n$.
b. Analyze the asymptotic of $|L_n|$ for a large n.
My trial: in part a, I wrote:
Every path = (empty path) or (r every path) or (u Schröder path d every path) or (d Schröder path u every path).
Now, denote our g.f. by $A(x)$ and Schröder g.f. by $S(x)$, and denote $x$ to count half of the length, get: $A(x)=1+xA(x)+xS(x)A(x)+xS(x)A(x)$. Thus,
$$A(x)=\frac{1}{1-x-2xS(x)}$$
Then if we substitute the formula of $S(x)=\frac{1-x-\sqrt {(1-x)^2-4x}}{2x}$ :
$$A(x)=\frac{1}{\sqrt {(1-x)^2-4x}}$$
In part b, to analyze the asymptotic of $|L_n|$, I guess I should find the coeifficient of $[x^n]$ in $A(x)$ where $A(x)=\sum_{n\geq 0} |L_n| x^{2n}$. However if we solve denominator of $A(x) = 0$ we get
\begin{align*} (1-x)^2-4x=0 \quad\Rightarrow\quad x^2-6x+1=0 \end{align*}
so, $x=3 \pm 2\sqrt2$. So the g.f. will be analytic if we delete the intervals $(3+\sqrt2, \infty)$ and $(-\infty,3-\sqrt2)$. Write: $A(x)=\frac{1} {\sqrt{(x- r_1)(x-r_2)}}=\frac{1}{\sqrt{x-r_1}} \frac{1}{\sqrt{x-r_2}}= \frac{1}{\sqrt{1-x/r_1}} \frac{1}{\sqrt{1-x/r_2}}$ where $r_1=3+\sqrt{8}$ and $r_2=3-\sqrt{8}$. Then, $A(x)=(\sum_{n\geq 0} (1/r_1)^n x^n \sum_{n\geq 0} (1/r_2)^n x^n)^{1/2}= \sum_{n\geq 0} \sum_{j=0}^{n} (1/r_1)^j (1/r_3)^{n-j} x^n$ , here I used Caushy formula.
So, $[x^n] A(x)= \sum_{j=0}^{n} (1/r_1)^j (1/r_2)^{n-j}$
$L_n = \sum_{j=0}^{n} (r_2/r_1)^j (1/r_2)^n$. But this was not much useful!
Edited: Another approach, which does not use the Legendre polynomial:
*I found in oeis the sequence of this problem is A001850 and it shows that the coefficient of the series is $\sum_{k=0}^{n} {n\choose k}{n+k \choose k}$ .In addition, wikipedia page : https://www.google.com/url?sa=t&source=web&rct=j&url=https://en.m.wikipedia.org/wiki/Delannoy_number, mentioned the coefficient and the asymptotic of the above g.f : $\frac{1}{\sqrt{1-6x+x^2}}$ which is the g.f of the Delannoy number, but without explanation/proof. How they find the coefficient of this generating function, and how they analayzed its asymptotic then?
Many thanks!