In the recurrence relation $$P(n+2) = 2P(n+1) - 3P(n) + 8 $$
with initial conditions $P(0) = 0, P(1)= 1$
Do I solve the the equation $r^2=2r-3$?
I do not know where I put this $8$ in the equation.
In the recurrence relation $$P(n+2) = 2P(n+1) - 3P(n) + 8 $$
with initial conditions $P(0) = 0, P(1)= 1$
Do I solve the the equation $r^2=2r-3$?
I do not know where I put this $8$ in the equation.
Consider $$P(n+2) = 2P(n+1) - 3P(n) + 8$$ and (replacing $n$ with $n+1$), $$P(n+3) = 2P(n+2) - 3P(n+1) + 8$$
Subtracting the former from the latter and moving stuff around gives
$$P(n+3) = 3P(n+2) - 5P(n+1) + 3P(n)$$
Determine $P(2)$ from the initial relation, and you should be able to solve it in the usual way from here. A similar trick for polynomials (i.e. $x+8$ instead of $8$) can be done by repeating the subtraction trick multiple times.
Suppose you have a solution $P(n)$ which satisfies the original recurrence and a solution $Q(n)$ which satisfies (what we call the homogeneous part) $$Q(n+2)=2Q(n+1)-3Q(n)$$ you can check that $R(n)=P(n)+AQ(n)$ is also a solution to the original equations.
The general strategy for solving the recurrence involves finding all the possible $Q(n)$, which is where your polynomial in $r$ comes in, and just one solution to the original equation, which puts the $8$ back in when you add it to some possible $Q(n)$.