# Find the values of $r_1, r_2, r_3$ in the recurrence relation $a_n = r_1 a_{n-1} + r_2 a_{n-2} + r_3 a_{n-3}$

Consider the recurrence relation $a_n = > r_1 a_{n-1} + r_2 a_{n-2} + r_3 a_{n-3}$ for $n \ge 3$. The roots of the characteristic polynomial are $x = -1$ of multiplicity 2, $x= 3$ of multiplicity 1.

(a) Write down the general solution

(b) Find the values of the constants $r_1, r_2, r_3$

This is a past quiz question I am reviewing and I can't figure out how to do part b. Part (a) is straight forward, $a_n = A(-1)^n + Bn(-1)^n + C3^n$.

But how to do part (b)? I tried to substitute the general solution from part (a) into the recurrence relation and trying to solve for $r_i$, but it gets quite messy and I am mindful that this was just a short quiz, so I thought I must be going wrong somewhere.

The answers were simply provided as $1,5,3$ respectively.

Many thanks!

For part(b) on one hand the characteristic equation is given by $$x^3-r_1x^2-r_2x-r_3 =0$$ but on the other hand it is also given by $$(x+1)^2(x-3)=0$$ Set both of them equal to each other and compute the $r_i$'s.
From $a_n-r_1a_{n-1}-r_2a_{n-2}-r_3a_{n-3}=0$, the characteristic polynomial is $\lambda^3-r_1\lambda^2-r_2\lambda-r_3$.
What is the cubic polynomial whose roots are $-1$,$-1$ and 3?