2. Let $a_{0}=a_{1}=1, a_{n}=a_{n-1}+a_{n-2}(n=2,3, \cdots)$, find the generating function of the sequence $\left\{a_{n}\right\}$.
2. From $f(x)=a_{0}+a_{1} x+a_{2} x^{2}+\cdots+a_{n} x^{n}+\cdots-x \cdot f(x)$
$$
=-a_{0} x-a_{1} x^{2}-\cdots-a_{n-1} x^{n}-x^{2} \cdot f(x)=-a_{0} x^{2}-\cdots-a_{n-2} x^{n}-\cdots
$$

Adding the above three equations, noting that the problem states $\left(1-x-x^{2}\right) f(x)=1$.
Thus, the generating function for the sequence $\left\{a_{n}\right\}$ is $f(x)=\frac{1}{1-x-x^{2}}$.