How to solve this reccurence relation? Let a,b,c be real numbers. Find the explicit formula for $f_n=af_{n-1}+b$ for $n \ge 1$ and $f_0 = c$
So I rewrote it as $f_n-af_{n-1}-b=0$ which gives the characteristic equation as $x^2-ax-b=0$. The quadratic formula gives roots $x= \frac{a+\sqrt{a^2+4b}}{-2}, \frac{a-\sqrt{a^2+4b}}{-2}$
Then $f_n=P_1(\frac{a+\sqrt{a^2+4b}}{-2})^n+P_2(\frac{a-\sqrt{a^2+4b}}{-2})^n$ and using the initial condition $t_0=c$ gives $C=P_1+P_2 \Rightarrow P_1=C-P_2$
So $(C-P_2)(\frac{a+\sqrt{a^2+4b}}{-2})^n+P_2(\frac{a-\sqrt{a^2+4b}}{-2})^n$ what next? I tried expanding but that didn't help. I know the answer is something like $cd^n-\frac{b}{a-1}+\frac{bd^n}{a-1}$

Define $F(z) = \sum_{n \ge 0} f_z z^n$, and write your recurrence as:
$$
f_{n + 1} = a f_n + b \quad f_0 = c
$$
Multiply by $z^n$, sum over $n \ge 0$, and recognize:
\begin{align}
\sum_{n \ge 0} f_{n + 1} z^n &= \frac{F(z) - f_0}{z} \\
\sum_{n \ge 0} b z^n         &= \frac{b}{1 - z}
\end{align}
to get:
$$
\frac{F(z) - c}{z} = a F(z) + \frac{b}{1 - z}
$$
This gives:
$$
F(z) = \frac{c + (c - b) z}{1 - (a + 1) z + a z^2}
     = \frac{b + (a - 1) c}{(a - 1) (1 - a z)} - \frac{b}{(a - 1) (1 - z)}
$$
This is just two geometric series:
$$
f_n = \frac{b + (a - 1) c}{a - 1} \cdot a^n - \frac{b}{a - 1} 
$$
As a check, $f_n = c$.
