2
$\begingroup$

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?

$\endgroup$

3 Answers 3

2
$\begingroup$

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.

Addition 2. See here and here and here.

$\endgroup$
1
  • $\begingroup$ @Martin: As an exception, I added screens to my answer. $\endgroup$
    – user64494
    Commented Sep 27, 2022 at 13:36
3
$\begingroup$
$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]+γ"]

enter image description here

$\endgroup$
2
$\begingroup$
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:

enter image description here

$\endgroup$
2
  • $\begingroup$ May be Wolfram alpha can provide the step by step solution but I don't know the command for that. $\endgroup$
    – Syed
    Commented Sep 27, 2022 at 12:46
  • $\begingroup$ Updated the answer. It is quite a series of steps to get there. $\endgroup$
    – Syed
    Commented Sep 27, 2022 at 13:01

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.