Example 3.13 Solve the recurrence relation
$$
\left\{\begin{array}{l}
a_{n}=5 a_{n-1}-6 a_{n-2}+n+2 \quad(n \geqslant 2), \\
a_{0}=\frac{27}{4}, \quad a_{1}=\frac{49}{4} .
\end{array}\right.
$$
The characteristic equation of the recurrence relation
$$
a_{n}=5 a_{n-1}-6 a_{n-2} \quad(n \geqslant 2)
$$

is $x^{2}-5 x+6=0$, with characteristic roots $x_{1}=2, x_{2}=3$. Therefore, the general solution is
$$
a_{n}=c_{1} \cdot 2^{n}+c_{2} \cdot 3^{n} .
$$

Since (3.7) does not have a characteristic root equal to 1, the recurrence relation
$$
a_{n}=5 a_{n-1}-6 a_{n-2}+n+2 \quad(n \geqslant 2)
$$

has a particular solution $a_{n}=A n+B$, where $A$ and $B$ are constants to be determined. Substituting into (3.8) yields
$$
\begin{aligned}
A n+B= & 5[A(n-1)+B]- \\
& 6[A(n-2)+B]+n+2,
\end{aligned}
$$

simplifying to
$$
2 A n+2 B-7 A=n+2,
$$

so
$$
\left\{\begin{array}{l}
2 A=1 \\
2 B-7 A=2
\end{array}\right.
$$

Solving these, we get $A=\frac{1}{2}, B=\frac{11}{4}$. Thus,
$$
a_{n}=c_{1} \cdot 2^{n}+c_{2} \cdot 3^{n}+\frac{1}{2} n+\frac{11}{4},
$$

where $c_{1}, c_{2}$ are constants to be determined. Using the initial conditions, we have
$$
\left\{\begin{array}{l}
c_{1}+c_{2}+\frac{11}{4}=\frac{27}{4}, \\
2 c_{1}+3 c_{2}+\frac{1}{2}+\frac{11}{4}=\frac{49}{4} .
\end{array}\right.
$$

Solving these, we get $c_{1}=3, c_{2}=1$. Therefore,
$$
a_{n}=3 \cdot 2^{n}+3^{n}+\frac{1}{2} n+\frac{11}{4} \quad(n \geqslant 0) .
$$