sympy/sympy — pull request #1280 by smichr (2012-05-07 12:07:47+00:00)
Title: WIP: multinomial_coeff

This is here for testing and comment. This is a method that finds the coefficient of a monomial in an expression without expanding the expression.

```
>>> from sympy.abc import a, b, x, y
>>> ((a+b*a**x)**8).multinomial_coeff(a**6)
28*a**(2*x)*b**2
>>> ((a+b*a**x)**300).multinomial_coeff(a**298*a**(2*x)*b**2)
44850
>>> ((a+b*a**x)**300).multinomial_coeff(a**298)
44850*a**(2*x)*b**2
>>> ((a+b*a**x)**300).multinomial_coeff(a**x*b)
300*a**299
>>> (x + x*y).multinomial_coeff(x)
y + 1
>>> (x + a*(x + x*y)).multinomial_coeff(x)
a*(y + 1) + 1
```