Here, frac is multivariate, i.e it depends on more than one variable. So, 
you need to explicitly tell the apart function for which variable should it 
perform the decomposition.

Eg. No need to give x as the second argument

In [21]: apart(1/((x+1)*(x+2)))
Out[21]: 
    1       1  
- ───── + ─────
  x + 2   x + 1

x is required here (multivariate)

In [22]: apart(y/((x+1)*(x+2)), x)
Out[22]: 
    y       y  
- ───── + ─────
  x + 2   x + 1



On Monday, 15 June 2015 22:44:40 UTC+5:30, Hugh wrote:
>
> Hello,
>
>
> There is this block of code in the tutorial 
> <http://docs.sympy.org/latest/tutorial/simplification.html>:
>
> >>> l = []
> >>> frac = apart(frac, a0)
> >>> frac
>                 a₂⋅a₃⋅a₄ + a₂ + a₄
> a₀ + ───────────────────────────────────────
>      a₁⋅a₂⋅a₃⋅a₄ + a₁⋅a₂ + a₁⋅a₄ + a₃⋅a₄ + 1
> >>> l.append(a0)
> >>> frac = 1/(frac - a0)
> >>> frac
> a₁⋅a₂⋅a₃⋅a₄ + a₁⋅a₂ + a₁⋅a₄ + a₃⋅a₄ + 1
> ───────────────────────────────────────
>            a₂⋅a₃⋅a₄ + a₂ + a₄
>
>
>
> I've read the documentation on apart() and factor() but I still don't 
> understand the purpose of putting a0 as the second argument to the call to 
> apart(). Also, leaving out a0 produces a NotImplementedError: 
> multivariate partial fraction decomposition error. and replacing a0 with 
> other symbols like a1, a2, etc works fine. But I still don't understand 
> what's going on. Please help.
>

-- 
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/3b8d319a-f676-4751-bc95-711c9640b72b%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to