Question: How to isolate terms in expression

For example, I have the expression:

f:=sin(i*Pi/2)+cos(i*Pi/4)+i+A[i]*cos(i*6)+5*ln(5*r)*Pi+5+x;

How to isolate terms in i and other terms (automatically) to get :

f1:=sin(i*Pi/2)+cos(i*Pi/4)+i+A[i]*cos(i*6);

f2:=5*ln(5*r)*Pi+5+x;

Thanks in advance

Please Wait...