Example 6 Given the sequence $\left\{a_{n}\right\}$ satisfies $a_{1}=a_{2}=1$, and $a_{n+2}=3 a_{n+1}+18 a_{n}+2^{n}\left(n \in \mathbf{N}_{+}\right)$.

Find $a_{n}$.
Analysis: This is a non-linear recursive sequence, which cannot be reduced to a linear recursive sequence by the method of taking differences step by step. Instead, the method of undetermined coefficients can be used to transform it into a linear recursive sequence.
Solution: Let
$$
\begin{array}{l}
a_{n+2}-A \cdot 2^{n+2} \\
=3\left(a_{n+1}-A \cdot 2^{n+1}\right)+18\left(a_{n}-A \cdot 2^{n}\right) (A \text { to be determined }) .
\end{array}
$$

By expanding and comparing coefficients, we find that $A=-\frac{1}{20}$.
Thus, $a_{n+2}+\frac{1}{20} \cdot 2^{n+2}$
$$
=3\left(a_{n+1}+\frac{1}{20} \cdot 2^{n+1}\right)+18\left(a_{n}+\frac{1}{20} \cdot 2^{n}\right) \text {. }
$$

Let $b_{n}=a_{n}+\frac{1}{20} \cdot 2^{n}$, then
$$
b_{n+2}=3 b_{n+1}+18 b_{n} \text {. }
$$

It is easy to see that $b_{1}=\frac{11}{10}, b_{2}=\frac{6}{5}$.
By the method of characteristic roots, we have
$$
b_{n}=A \cdot 6^{n}+B(-3)^{n} \text {. }
$$

Substituting the values of $b_{1}$ and $b_{2}$, we get $A=\frac{1}{12}, B=-\frac{1}{5}$. Therefore, $b_{n}=\frac{6^{n}}{12}-\frac{(-3)^{n}}{5}$.
Thus, $a_{n}=\frac{6^{n}}{12}-\frac{(-3)^{n}}{5}-\frac{2^{n}}{20}$.
Note: For recursive sequences of the form “$a_{n+k}=A_{1} a_{n+k-1}+A_{2} a_{n+k-2}+\cdots+A_{k} a_{n}+m^{n}\left(A_{i}(i=1,2, \cdots, k)\right.$ are constants, and $m$ is also a constant)”, the method of undetermined coefficients is often used to construct a homogeneous linear recursive sequence of the form “$\left\{a_{n}+u m^{n}\right\}(u$ is an undetermined constant)”.