Wolfram Function Repository
Instant-use add-on functions for the Wolfram Language
Function Repository Resource:
Compute a partial fraction decomposition over the algebraic closure of the rationals
ResourceFunction["ApartAll"][expr] rewrites the rational expression expr as a sum of terms with minimal denominators in an arbitrary number field. | |
ResourceFunction["ApartAll"][expr,var] treats all variables other that var as constants. |
Decompose into partial fractions:
In[1]:= | ![]() |
Out[1]= | ![]() |
"NumericFactors"→True numerically evaluates factors before the computation:
In[2]:= | ![]() |
Out[2]= | ![]() |
ApartAll works like Apart, but factorizes polynomials with Extension→All:
In[3]:= | ![]() |
Out[3]= | ![]() |
Compare outputs of Apart and ApartAll in a case where the polynomial denominator does not factor over the rationals into powers of linear polynomials:
In[4]:= | ![]() |
Out[4]= | ![]() |
Factors with multiplicity greater than one can appear in the denominator:
In[5]:= | ![]() |
Out[5]= | ![]() |
If computation takes too long, "NumericFactors"→True will do numeric factorization, which greatly speeds up the algorithm:
In[6]:= | ![]() |
Out[6]= | ![]() |
This work is licensed under a Creative Commons Attribution 4.0 International License