Sólo para mostrar una forma alternativa, a través de la función de generación.
Permítanme cambiar la notación de $x$ a $a$ para evitar confusiones en lo que sigue.
A partir de su recurrencia $$ \left\{ \begin{gathered} a_{\,0} = 7 \hfill \\ a_{\,1} = 2 \hfill \\ a_{\,k + 2} = - a_{\,k + 1} + 2a_{\,k} \hfill \\ \end{gathered} \right. $$ reescribirlo para incorporar las condiciones iniciales: $$ \left\{ \begin{gathered} a_{\,k < 0} = 0 \hfill \\ a_{\,k} = - a_{\,k - 1} + 2a_{\,k - 2} + 9\left[ {k = 1} \right] + 7\left[ {k = 0} \right] \hfill \\ \end{gathered} \right. $$ donde $[P]$ indica el Soporte Iverson $$ \left[ P \right] = \left\{ {\begin{array}{*{20}c} 1 & {P = TRUE} \\ 0 & {P = FALSE} \\ \end{array} } \right. $$ A continuación, multiplique por $z^k$ y resumir $$ \begin{gathered} \sum\limits_{0\, \leqslant \,k} {a_{\,k} z^{\,k} } = - \sum\limits_{0\, \leqslant \,k} {a_{\,k - 1} z^{\,k} } + 2\sum\limits_{0\, \leqslant \,k} {a_{\,k - 2} z^{\,k} } + 9\sum\limits_{0\, \leqslant \,k} {\left[ {k = 1} \right]z^{\,k} } + 7\sum\limits_{0\, \leqslant \,k} {\left[ {k = 0} \right]z^{\,k} } = \hfill \\ = - z\sum\limits_{0\, \leqslant \,k} {a_{\,k - 1} z^{\,k - 1} } + 2z^2 \sum\limits_{0\, \leqslant \,k} {a_{\,k - 2} z^{\,k - 1} } + 9z + 7 \hfill \\ \end{gathered} $$ Así que tenemos: $$ \sum\limits_{0\, \leqslant \,k} {a_{\,k} z^{\,k} } = F(z) = - zF(z) + 2z^2 F(z) + 9z + 7 $$ $$ \begin{gathered} F(z) = \frac{{9z + 7}} {{1 + z - 2z^2 }} = - \frac{{9z + 7}} {{\left( {2z + 1} \right)\left( {z - 1} \right)}} = \frac{5} {{3\left( {2z + 1} \right)}} + \frac{{16}} {{3\left( {1 - z} \right)}} = \hfill \\ = \frac{5} {3}\sum\limits_{0\, \leqslant \,k} {\left( { - 2} \right)^{\,k} z^{\,k} } + \frac{{16}} {3}\sum\limits_{0\, \leqslant \,k} {z^{\,k} } \hfill \\ \end{gathered} $$ $$ a_{\,k} = \frac{{5\left( { - 2} \right)^{\,k} + 16}} {3} $$