# Negative binomial expansion of general symbolic polynomial

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.

• The result will be an infinite sum of terms, is that what you are looking for? – Maxim Umansky Oct 14 '20 at 17:56
• @MaximUmansky, it will be if I consider all terms. I would like to know whether there is a more efficient or clever way to do it. – Omar Shehab Oct 15 '20 at 3:35
• If you want to know all coefficients of that expansion then it will be an infinite size problem. What do we call an "efficient" way for solving an infinite size problem? No matter how you do it, the amount of work is infinite, right? If there was some extra condition allowing truncation then one could think of approaches that would be more efficient than others. – Maxim Umansky Oct 15 '20 at 5:03