title: Binomial expansion with fractional powers in Python
body: <p>Is there a quick method of expanding and solving binomials raised to fractional powers in Scypy/numpy?</p>
  
  <p>For example, I wish to solve the following equation</p>
  
  <p>y * (1 + x)^4.8 = x^4.5</p>
  
  <p>where y is known (e.g. 1.03).</p>
  
  <p>This requires the binomial expansion of (1 + x)^4.8.</p>
  
  <p>I wish to do this for millions of y values and so I'm after a nice and quick method to solve this.</p>
  
  <p>I've tried the sympy expand (and simplification) but it seems not to like the fractional exponent. I'm also struggling with the scipy fsolve module.</p>
  
  <p>Any pointers in the right direction would be appreciated.</p>
  
  <p>EDIT:</p>
  
  <p>By far the simplest solution I found was to generate a truth table (<a href="https://en.wikipedia.org/wiki/Truth_table" rel="nofollow">https://en.wikipedia.org/wiki/Truth_table</a>) for assumed values of x (and known y). This allows fast interpolation of the 'true' x values.</p>
  
  <pre><code>y_true = np.linspace(7,12, 1e6)
  x = np.linspace(10,15, 1e6)
  
  a = 4.5
  b = 4.8
  y = x**(a+b) / (1 + x)**b
  
  x_true = np.interp(y_true, y, x)
  </code></pre>