# How to separate linear terms by output?

I am performing a complicated summation in which fa is a Sum of a[j] over j, and terms in fa end up containing a BesselJ, a Hypergeometric0F1, or neither.

t[j_] := ((-1)^j)*(j - 1)!/(2*v^j);
DD[i_, j_] := t[i]*t[j]*F + (i + j)*G/v;
h[j_] := t[j]*(H + j*K/v);
m2[j_] = 4*W*(Z^(j - 1))*(v^(3*j - 1))/((j - 1)!^3);
a = Expand[h[i]*m2[i]*DD[i, j]*m2[j]*h[j] /. {i -> i + 1, j -> j + 1}];
fa = Sum[a, {j, 0, Infinity}];


I would like to create three separate functions a1, a2, and a3 respectively contain the terms from a that sum to BesselJ, Hypergeometric0F1, or neither. In the end, a1+a2+a3 should equal a. How can I do this?

• Unless you know a priori the coefficients of BesselJ and Hypergeometric0F1, it seems unlikely that you can find a unique decomposition. – bbgodfrey Feb 27 '15 at 0:47
• @bbgodfrey It should certainly be possible to take one term at a time, Sum it, see what the result was, and add the term to the correct working function accordingly. – Jerry Guern Feb 27 '15 at 0:57

fa = Sum[#, {j, 0, Infinity}] & /@ (List @@ a);

Sum[a[[#]], {j, 0, Infinity}] & /@ hyperTerms