I want to solve $a_{n+1} = (1 + \alpha) a_n + \gamma$, where $\alpha$ and $\gamma$ are some constants. Wolfram alpha returns:
$a_n = \frac{\gamma ((1+\alpha)^n-1)}{\alpha} + c (1+\alpha)^{n-1}$.
Any idea how Wolfram alpha has solved this?
I think CASes apply a usual method of solving linear recurrence relations with constant coefficients (for example, see Wiki for info). In any case the result of the command of Maple
infolevel[all] := 4: rsolve(a(n+1) = k*a(n)+b, a(n));
confirms that guess.
Addition. As step-by-step solution by W|A shows, the generating function is used to this end there.
$Version
(* "13.1.0 for Mac OS X x86 (64-bit) (June 16, 2022)" *)
WolframAlpha["step-by-step solve a[n+1]==(1+α) a[n]+γ"]
Clear[a, \[Alpha], n]
RSolve[a[n + 1] == (1 + α) a[n] + γ, a[n], n]
$$\left\{\left\{a(n)\to -\frac{\gamma \left(1-(\alpha +1)^n\right)}{\alpha }+c_1 (\alpha +1)^{n-1}\right\}\right\}$$
EDIT
For a step-by-step solution type == and paste equation into Mathematica: