I have the equation (arising in a probabilistic context)
$$ x_n = a(1-x_{n-1}) + (1-a)x_{n-1} $$
and I'm told that there is a solution of the form $c_1 + c_{2}\lambda^n$. How do I solve it, i.e. how do I find the correct values of $c_1, c_2$ and $\lambda$?
$$x_n = a(1-x_{n-1}) + (1-a)x_{n-1} = (-a+1-a)x_{n-1} + a = $$ $$=(1 - 2a)x_{n-1}+a$$
Now, consider $x_0$ given. Then:
$$x_1 = (1-2a)x_0 + a$$ $$x_2 = (1-2a)x_1 + a =(1-2a)^2x_0 + (1-2a)a + a$$ $$x_3 = (1-2a)x_2 + a =(1-2a)^3x_0 + (1-2a)^2a + (1-2a)a + a$$
You can easily find that:
$$x_n = (1-2a)^nx_0 + a\sum_{i=0}^{n-1}(1-2a)^i$$
Notice that (*) $$a\sum_{i=0}^{n-1}(1-2a)^i = a\frac{1 - (1-2a)^n}{1 - (1-2a)} = a\frac{1 - (1-2a)^n}{2a} = \frac{1}{2} - \frac{1}{2}(1-2a)^n$$
and then:
$$x_n = \frac{1}{2} + \left(x_0 - \frac{1}{2}\right)(1-2a)^n$$
Finally:
$$c_1 = \frac{1}{2}$$ $$\lambda = (1-2a)$$ $$c_2 = x_0 - \frac{1}{2}$$
(*) It has been expanded using the formula for the finite sum of the geometric sequence. See this for details.