Using Sympy, I would like to compute the negative binomial expansion of a general symbolic polynomial, e.g., $(x_1 + x_2 + x_3 + 4 x_4)^{-1}$. I understand that I can go by recursively partitioning the expression inside the parenthesis into two parts and computing their expansion like $x_1$ and $x_2 + x_3 + 4 x_4$, then, $x_2$ and $x_3 + 4 x_4$, and so on.
Is there a more efficient way to do this? Thanks.