| 1 | initial version |
If I am right, these are the recurrence relations you want to deal with: $$ \begin{aligned} a_n(x) &= a_{n-1}(x+1) - a_{n-1}(x) + a_0(x+1)a_{n-1}(x) + b_{n-1}(x) \\ b_n(x) &= b_{n-1}(x+1) - b_{n-1}(x) + a_{n-1}(x)b_0(x+1) \end{aligned} $$ I have run the code below in a Jupyter notebook, assuming that $a_0(x)=Ax$ and $b_0(x)=B$:
var("A,B,x")
def a(n,x):
if n==0:
return A*x
else:
return a(n-1,x+1) - a(n-1,x) + a(0,x+1)*a(n-1,x) + b(n-1,x)
def b(n,x):
if n==0:
return B
else:
return b(n-1,x+1) - b(n-1,x) + a(n-1,x)*b(0,x+1)
for n in range(5):
show(html(fr"$a_{{{n}}}(x)={latex(a(n,x).full_simplify())}$"))
show(html(fr"$b_{{{n}}}(x)={latex(b(n,x).full_simplify())}$"))
show(html("<hr>"))
This is the output:
$a_{0}(x)=A x$
$b_{0}(x)=B$
Of course, you can increase the final value of $n$ in the loop.
Copyright Sage, 2010. Some rights reserved under creative commons license. Content on this site is licensed under a Creative Commons Attribution Share Alike 3.0 license.