Not sure exactly what you mean, but can't you use collect? And you could pull off the coefficients to know what are potential items that can be grouped.
>>> eq=f(x).diff(x)+x*f(x).diff(x)+f(x).diff(x,2)+x*f(x).diff(x,2) >>> collect(eq,x) x*(Derivative(f(x), x) + Derivative(f(x), x, x)) + Derivative(f(x), x) + Derivative(f(x), x, x) >>> collect(eq,f(x)) (x + 1)*Derivative(f(x), x) + (x + 1)*Derivative(f(x), x, x) >>> factor(_) (x + 1)*(Derivative(f(x), x) + Derivative(f(x), x, x)) -- You received this message because you are subscribed to the Google Groups "sympy" group. To unsubscribe from this group and stop receiving emails from it, send an email to sympy+unsubscr...@googlegroups.com. To post to this group, send email to sympy@googlegroups.com. Visit this group at http://groups.google.com/group/sympy. To view this discussion on the web visit https://groups.google.com/d/msgid/sympy/ea6afdc1-3d16-40aa-afa9-d3392bd7924d%40googlegroups.com. For more options, visit https://groups.google.com/d/optout.