$\sum_{n\ge0}f\left(n\right)x^{n}=\frac{1}{\sqrt{1-2x-3x^{2}}}$, where $f(n)$ the $n$-th coefficient of $(1+x+x^2)^n$ Let $f\left(n\right)$ denotes the n-th coefficient of $\left(1+x+x^{2}\right)^{n}$.
Show that $$f\left(n\right)=\sum_{k=0}^{\left\lfloor \frac{n}{2}\right\rfloor }\binom{2k}{k}\binom{n}{2k}.$$
Then show that $$\sum_{n\ge0}f\left(n\right)x^{n}=\frac{1}{\sqrt{1-2x-3x^{2}}}.$$

I have managed  to answer the first question, but I find it hard to procced on the second one.
I have found (by using the Binomial Theorem) that $$\sum_{n\ge0}\left(\frac{1}{2^{n}}\sum_{k=0}^{\left\lfloor \frac{n}{2}\right\rfloor }3^{k}\binom{2n-2k}{n-k}\binom{n-k}{k}\right)x^{n}=\frac{1}{\sqrt{1-2x-3x^{2}}}$$ but I can't somehow prove that $$f(n)=\frac{1}{2^{n}}\sum_{k=0}^{\left\lfloor \frac{n}{2}\right\rfloor }3^{k}\binom{2n-2k}{n-k}\binom{n-k}{k}$$ even though it seems, it holds.
I also tried to show that, for $n\ge2$, $$c_n=2c_{n-1}+3c_{n-2},$$ where $c_n=\sum_{k=0}^{n}f\left(k\right)f\left(n-k\right)$, in order to show that $$\left(\sum_{n\ge0}f\left(n\right)x^{n}\right)^{2}=\frac{1}{1-2x-3x^{2}},$$ but again I failed miserably!
I also tried some other ideas, but nothing seems to work.
Any suggestions? Thank you for your time! :)
 A: $\newcommand{\bbx}[1]{\,\bbox[15px,border:1px groove navy]{\displaystyle{#1}}\,}
 \newcommand{\braces}[1]{\left\lbrace\,{#1}\,\right\rbrace}
 \newcommand{\bracks}[1]{\left\lbrack\,{#1}\,\right\rbrack}
 \newcommand{\dd}{\mathrm{d}}
 \newcommand{\ds}[1]{\displaystyle{#1}}
 \newcommand{\expo}[1]{\,\mathrm{e}^{#1}\,}
 \newcommand{\ic}{\mathrm{i}}
 \newcommand{\mc}[1]{\mathcal{#1}}
 \newcommand{\mrm}[1]{\mathrm{#1}}
 \newcommand{\on}[1]{\operatorname{#1}}
 \newcommand{\pars}[1]{\left(\,{#1}\,\right)}
 \newcommand{\partiald}[3][]{\frac{\partial^{#1} #2}{\partial #3^{#1}}}
 \newcommand{\root}[2][]{\,\sqrt[#1]{\,{#2}\,}\,}
 \newcommand{\totald}[3][]{\frac{\mathrm{d}^{#1} #2}{\mathrm{d} #3^{#1}}}
 \newcommand{\verts}[1]{\left\vert\,{#1}\,\right\vert}$
$\ds{\bbox[5px,#ffd]{}}$

\begin{align}
\on{f}\pars{n} & \equiv \bbox[5px,#ffd]{\bracks{x^{n}}\pars{1 + x + x^{2}}^{n}}
\\[5mm] = &\
\bracks{x^{n}}\sum_{a = 0}^{\infty}
\sum_{b = 0}^{\infty}\sum_{k = 0}^{\infty}
{n! \over a!\,b!\,k!}1^{a}x^{b}\pars{x^{2}}^{k}\
\times
\\[2mm] &\
\phantom{\bracks{x^{n}}\,\,\,}
\bracks{a + b + k = n}
\\[5mm] = &\
\sum_{a = 0}^{\infty}
\sum_{b = 0}^{\infty}\sum_{k = 0}^{\infty}
{n! \over a!\,b!\,k!}
\bracks{n = b + 2k}\bracks{a + b + k = n}
\\[5mm] = &\
\sum_{a = 0}^{\infty}
\sum_{b = 0}^{\infty}\sum_{k = 0}^{\infty}
{n! \over a!\,b!\,k!}
\bracks{a = k}\bracks{b = n - 2k}
\\[5mm] = &\
\sum_{k = 0}^{\infty}
{n! \over k!\pars{n - 2k}!\,k!}
\bracks{n - 2k \geq 0}
\\[5mm] = &\
\sum_{k = 0}^{\left\lfloor\,{n/2}\,\right\rfloor}
{\pars{2k}! \over k!\,k!}\,
{n! \over \pars{2k}!\pars{n - 2k}!}
\\[5mm] = &\
\bbx{\sum_{k = 0}^{\left\lfloor\,{n/2}\,\right\rfloor}
{2k \choose k}{n \choose 2k}} \\ &
\end{align}
