Q:

Find particular solution non-homogeneous recurrence

I am trying to solve the following recurrence relation:
$$a_n=6a_{n-1}-9a_{n-2}+2^n+3^n \quad , \quad a_0=0\: ; \: a_1=2$$
I know that $a_n=a_n^h+a_n^p$ where $a_n^h$ is the solution of the homogeneous associated recurrence and $a_n^p$ is a particular solution of the non-homogeneous (and original) recurrence.
I have already found that $a_n^h=\alpha 3^n+\beta n3^n$ but I am having trouble finding $a_n^p$. I have tried calculating $a_n^p=a_n^{p_1}+a_n^{p_2}$ where $a_n^{p_1}$ would be a particular solution of
$$a_n=6a_{n-1}-9a_{n-2}+2^n$$
and $a_n^{p_2}$ would be a particular solution of
$$a_n=6a_{n-1}-9a_{n-2}+3^n$$
I have found that $a_n^{p_1}=2^{n+2}$ but I am unable to find $a_n^{p_2}$. Could someone please help me?

A:

For $a_n^{p_2}$, you have
$$a_n = 6a_{n-1} - 9a_{n-2} + 3^n \tag{1}\label{eq1A}$$
Going to the next value of $n$, you have
$$a_{n+1} = 6a_{n} - 9a_{n-1} + 3^{n+1} \tag{2}\label{eq2A}$$
Next, \eqref{eq2A} minus $3$ times \eqref{eq1A} becomes
$$\begin{equation}\begin{aligned}
a_{n+1} - 3a_n & = (6a_{n} - 9a_{n-1} + 3(3^{n})) - 3(6a_{n-1} - 9a_{n-2} + 3^n) \\
a_{n+1} - 3a_n & = 6a_{n} - 27a_{n-1} + 27a_{n-2} \\
a_{n+1} & = 9a_{n} - 27a_{n-1} + 27a_{n-2}
\end{aligned}\end{equation}\tag{3}\label{eq3A}$$
This is now a homogenous linear difference equation with a characteristic equation of
$$\lambda^3 - 9\lambda^2 + 27\lambda - 27 = (\lambda - 3)^3 = 0 \tag{4}\label{eq4A}$$
I'll leave it to you to finish the rest.

