I'd like to know how to find a general term for this recurrence:
$$a_{n+1}=a_n+(b-a_n)\cdot x, \text{where b, x are positive constants}$$
Background:
Linear interpolation equation for a starting point $a$ and ending point $b$ looks like this: $f(x)=(b-a)\cdot x$. I assume $x \in [0, 1]$. So for $x=1$ we are at the point $b$.
It is used in computer graphics to move things around :) Very often the parameters of the function are swaped, $x$ becomes constant and $a$ is taken from the previous iteration of a recursion. It gives an effect of homographic-function-like approaching to $b$ (there is a horizontal asymptote in $b$).
I want to find an exact solution for $a_n$. If I'm correct the relation is a following recurrence:
$$a_{n+1}=a_{n}+(b-a_n)\cdot x$$
I'm curious about the method to get the solution. Wolfram alpha gave me $$a(n)=c_1(1-x)^{n-1}-b(1-x)^n+b$$
This is equivalent to $$a_{n+1}=(1-x)a_{n}+b\cdot x$$ which can be solved using characteristic polynomials. In fact, you can use this ready-to-use result for $$a_{n+1}=pa_n+q$$ where $p=(1-x)$ and $q=bx$. The result is $$a_n=A+B\cdot p^n=A+B\cdot (1-x)^n$$ where $A,B$ are some constants depending on $a_0$. Further in that link $$a_n=-\frac{q}{p-1}+\left(a_1+\frac{q}{p-1}\right)p^{n-1}=\\ \frac{bx}{x}+\left(a_1-\frac{bx}{x}\right)(1-x)^{n-1}= \color{red}{b+\left(a_1-b\right)(1-x)^{n-1}}=\\ b+\left((1-x)a_0+bx-b\right)(1-x)^{n-1}=\color{red}{b+\left(a_0-b\right)(1-x)^n}=\\ a_0(1-x)(1-x)^{n-1}-b(1-x)^n+b$$ where $c_1=a_0(1-x)$-constant. I don't know how Wolfram alpha decides on these constants.