Hello,
I have equation
e1: (a*x(l,p-1)-b*x(l-1,p-1))*C3+(a*x(l+1,p-1)-b*x(l,p-1))*C2
+(a*x(l+2,p-1)-b*x(l+1,p-1))*C1+(a*x(l,p)-b*x(l-1,p))*B3
+(a*x(l+1,p)-b*x(l,p))*B2+(a*x(l+2,p)-b*x(l+1,p))*B1
+(a*x(l,p+1)-b*x(l-1,p+1))*A3+(a*x(l+1,p+1)-b*x(l,p+1))*A2
+(a*x(l+2,p+1)-b*x(l+1,p+1))*A1;
I need to collect terms around variable 'x( , )'. I do it in the following way:
Make needed terms
Lx: flatten( makelist([x(l+3-i,p+1), x(l+3-i,p), x(l+3-i,p-1)], i,1,3));
and then put it by hand to 'ratsimp'
e2: ratsimp(e1, Lx[1], Lx[2], Lx[3], Lx[4], Lx[5], Lx[6], Lx[7], Lx[8], Lx[9]);
It works, but is very tedious writing every Lx[i], i=1,..,9.
Is it maybe possible to make it in the following way:
/* this of course does not work - do not collect around x( , ) */
e2: ratsimp(e2, Lx);
giving a whole list 'Lx' at once or how to make sequence of arguments Lx[1],...,Lx[9] to 'ratsimp' ?
Is there a better solution to this problem?
Thank you in advance.
Zbigniew