Suppose we have the difference equation
$aq_n +bq_{n-1} = c$,
where $a,b, c$ are constants, and we want to find the function $q_n$.
My book says, first, we find the solution to the homogeneous equation
$aq_n +bq_{n-1} = 0$,
which is $q_n = q_0(\frac{-b}{a})^n$
Then we solve the inhomogenous equation by guessing $q_n = d $ to be a constant, so we get
$ad +bd = c$, $d=\frac{c}{a+b}$
Putting together these two solutions we get the general solution:
$q_n = C(\frac{-b}{a})^n +\frac{c}{a+b}$
My question is could this have been done another way (to be specified in a moment), and if yes, how are these two solutions equivalent?
Could I solve it by writing
$q_n = \frac{c-bq_{n-1}}{a} = \frac{c}{a} - \frac{b}{a}q_{n-1}$
let $\alpha = \frac{c}{a}$ and $\beta = \frac{b}{a}$
so,
$q_n = \alpha - \beta q_{n-1}$
but, recursively, we have
$q_n = \alpha - \beta *(\alpha - \beta q_{n-2}) = \alpha - \alpha \beta + \beta^2 q_{n-2}$
again, we get
$q_n = \alpha - \alpha \beta +\alpha \beta^2 - \beta ^3 q_{n-3}$
and if we keep going,
$q_n= \alpha (1 - \beta + \beta^2 -\beta^3 +\beta^4 - ... + (-1)^{n-1}\beta^{n-1}) + (-1)^{n} \beta^nq_0$
Is this a correct solution? and more importantly if yes, how is it equivalent to the first one, and if it's not correct, where did I go wrong?
The alternate solution is correct and equivalent to the book solution.
$q_n = \alpha(1-\beta +\beta^2 -\beta^3 +\beta^4 - ...+(-1)^{n-1}\beta^{n-1}) + (-\beta)^{n}q_0$
The sum in the parentheses is a finite geometric sum which becomes
$S = \alpha(\frac{1-(-\beta)^{n}}{1-(-\beta)}) = \frac{c}{a}(\frac{1-(\frac{-b}{a})^n}{1+\frac{b}{a}}) = \frac{c}{a+b} - \frac{c}{a+b}(\frac{-b}{a})^n$
Thus, we have
$q_n = \frac{c}{a+b} -\frac{c}{a+b}(\frac{-b}{a})^n+(\frac{-b}{a})^nq_0=\frac{c}{a+b}+(\frac{-b}{a})^n(q_0-\frac{c}{a+b})$
This is equivalent to the book solution letting $C=(q_0-\frac{c}{a+b})$