I want to solve a recurrence equation that has boundary conditions on both sides:
$a[0]= 1$
$a[n]= 10$
$a[i] = a[i-1]-a[i+1]\quad \forall i \in \{1, \ldots, n-1\}$
This should be a well defined system with n+1 equations and n+1 unknowns.
I tried:
RSolve[{a[n] == a[n - 1] - a[n + 1], a[0] == 1,a[n] == 10}, a[n], n]
But Mathematica says the system is overdetermined:
RSolve::overdet: There are fewer dependent variables than equations, so the system is overdetermined.
The issue is likely that I have not encoded that $\forall i \in \{1, \ldots, n-1\}$ we have a[i] == a[i - 1] - a[i + 1]
and only for the very last i: $i=n$ we have a[n] == 10
, right? How can I encode this in RSolve
?
Solve
after creating aTable
with values? You can solve for all thea[i]
$\endgroup$