I am trying to find a particular solution of $y_{n+2}-6y_{n+1}+9y_n=2*3^{n+2}$. I set $y_n=A3^{n+2}$ and get $A3^{n+4}-6A3^{n+3}+9A3^{n+2}=A^{n+2}(9-18+9)=2*3^{n+2}$.
So do I need another guess for $y_n$?
I am trying to find a particular solution of $y_{n+2}-6y_{n+1}+9y_n=2*3^{n+2}$. I set $y_n=A3^{n+2}$ and get $A3^{n+4}-6A3^{n+3}+9A3^{n+2}=A^{n+2}(9-18+9)=2*3^{n+2}$.
So do I need another guess for $y_n$?
There is another peculiarity when the RHS is of the form $A \cdot b^n$ and $b$ is a root of the characteristic polynomial.
Namely, if $b$ is a root of CP of multiplicity $\alpha$, then we must guess with our ordinary guess but multiplied by $n^\alpha$.
In our case 3 is a root of multiplicity 2, so we guess with
$$y_n = An^2 3^n.$$
(or $3^{n+2}$, as it differs from $3^n$ by a constant-- doesn't matter).
Now plug the guess into the equation to get $$A\big[(n+2)^2 \cdot 3^n \cdot 9 - 6(n+1)^2 \cdot 3^n \cdot 3 + 9n^2 \cdot 3^n \big] = 18 \cdot 3^n,$$ and after simplification you'll get $A=1$ and $y_n = n^2 \cdot 3^n$.
A more general recipe
For any RHS of type $C\cdot p_m(n) \cdot b^n$, where $p_m$ is a polynomial of degree $m$, and $b$ is a root of CP of multiplicity $\alpha$, the guess would be $$y_n = n^\alpha \cdot \text{[another polynomial of degree $m$]} \cdot b^n.$$
P.S.
Note that other methods may find different particular solutions, like Wolfram Alpha does-- that is also acceptable. Particularly, the solution suggested by Wolfram, $y_n = (n^2 - n) \cdot 3^n,$ also works, because the $-n \cdot 3^n$ part can be rewritten as a piece of general homogeneous solution. That is, the general solution to this equation as given by Wolfram, $$y_n = c_1 \cdot 3^n + c_2 \cdot n \cdot 3^n + n^2 \cdot 3^n - n \cdot 3^n,$$ can be rewritten as $$y_n = c_1 \cdot 3^n + (c_2 - 1) \cdot n \cdot 3^n + n^2 \cdot 3^n,$$ and we arrive at our previous particular solution $y_n = n^2 \cdot 3^n$.
Understanding this phenomenon might help you remember why you need to multiply your guess by $n^\alpha$-- if you don't (or if you multiply by lesser degree), then you'll get stuck like you did with $A \cdot 3^{n+2}$ because that is actually a part of the homogeneous solution, not the particular solution.