Reccurence equation $f(n)=6f(n-1)-9f(n-2)+(n^2+1)3^n$

122 Views Asked by At

$f(n)=6f(n-1)-9f(n-2)+(n^2+1)3^n$

The root for the above relation is 3 two times. So its general term will be:

$f(n) = c_{1}3^n + c_{2}n3^n + something$

According to my notes $something: n^2(n^2p_{2,0}+np_{1,0}+p_{0,0})3^n = (n^2+1)3^n$

That should have been correct if it was: $+n^23^n$
But it is: $+(n^2+1)3^n = 3^nn^2+3^n$
so it should be:   $n^2(n^2p_{2,0}+np_{1,0}+p_{0,0})3^n + n^2(p_{0,1})3^n=(n^2+1)3^n$

Is my reasoning wrong?

1

There are 1 best solutions below

0
On BEST ANSWER

i will try a change of variable $$u_n = f_n3^{-n}, \quad f_n = 3^nu_n.$$ the recurrence relation for $u_n$ is $$3^nu_n = 6\, 3^{n-1}u_{n-1} - 9\, 3^{n-2}u_{n-2}+(n^2+1)\, 3^n $$ dividing out by $3^n,$ gives you $$Lu_n = u_n- 2u_{n-1}+u_{n-2}= n^2+1 \tag 1$$

we see that $$\begin{align}L(n+1)^4 &= (n+1)^4 -2n^4 +(n-1)^4=12n^2+2,\\ L(n+1)^2 &=(n+1)^2-2n^2+(n-1)^2= 2\end{align}$$ therefore a particular solution is $$u_n = \frac1{12}\left((n+1)^4 -1\right), \quad f(n) = \frac1{12}\left((n+1)^4 -1\right)3^n.$$