[Math] Solving a linear nonhomogeneous recurrence relation with troublesome $F(n)$

recurrence-relations

I am trying to solve the following:

$$a_n=5a_{n-1}-6a_{n-2}+2^n+3n$$

The general solution to the homogeneous equation is simple:

$$a_n=5a_{n-1}-6a_{n-2} \rightarrow \\ r^2-5r+6=0 \rightarrow \\r=3,2$$
giving
$$a_n^{(h)}=C_13^n+C_22^n$$

Now for the particular solution it has been hinted that I find something in the form
$$a_n^{(p)}=qn2^n+p_1n+p_2$$

But this has me pretty solidly stumped. Where can I move from here or how might I go about finding the particular solution for this?

Best Answer

To see any choice for the variables $q, p_1, p_2$ makes the desired relation hold, substitute the given form into the value of $a_n, a_{n-1}, a_{n-2}$ in your recurrence equation.

Here, you must solve for $$\begin{align*}qn2^n+p_1n + p_2 & = 5(q(n-1)2^{n-1}+p_1(n-1) + p_2) \\ & - 6(q(n-2)2^{n-2}+p_1(n-2) + p_2) \\ & + 2^n + 3n\end{align*}$$

We note that every term is a multiple of $n2^n, 2^n, n, or 1$. First, the $n2^n$ terms have the same coefficient of $q$ on both sides. Next, we group the coefficients of $2^n$, and get $$0 = 5q( -1)\left(\frac{1}{2}\right) - 6q(-2)\left(\frac{1}{4}\right)+ 1$$ Then, we group the coefficients of $n$ to get $$ p_1 = 5p_1 - 6p_1 + 3 $$ Finally, looking at the constant terms we get $$ p_2 = 5(-p_1 + p_2) -6 (-2p_2 + p_2) $$ You will have a particular solution if you solve these three equations simultaneously.

Related Question