Full Partial Fraction ExpansionΒΆ

The domain FullPartialFractionExpansion implements factor-free conversion of quotients to full partial fractions.

Our examples will all involve quotients of univariate polynomials with rational number coefficients.

Fx := FRAC UP(x, FRAC INT)
  Fraction UnivariatePolynomial(x,Fraction Integer)
                  Type: Domain

Here is a simple-looking rational function.

f : Fx := 36 / (x**5-2*x**4-2*x**3+4*x**2+x-2)
               36
  ----------------------------
   5     4     3     2
  x  - 2x  - 2x  + 4x  + x - 2
                  Type: Fraction UnivariatePolynomial(x,Fraction Integer)

We use fullPartialFraction to convert it to an object of type FullPartialFractionExpansion.

 g := fullPartialFraction f
     4       4        --+      - 3%A - 6
   ----- - ----- +    >        ---------
   x - 2   x + 1      --+              2
                     2         (x - %A)
                   %A  - 1= 0
Type: FullPartialFractionExpansion(Fraction Integer,
                                  UnivariatePolynomial(x,Fraction Integer))

Use a coercion to change it back into a quotient.

g :: Fx
               36
  ----------------------------
   5     4     3     2
  x  - 2x  - 2x  + 4x  + x - 2
                Type: Fraction UnivariatePolynomial(x,Fraction Integer)

Full partial fractions differentiate faster than rational functions.

g5 := D(g, 5)
       480        480        --+      2160%A + 4320
  - -------- + -------- +    >        -------------
           6          6      --+                7
    (x - 2)    (x + 1)      2           (x - %A)
                          %A  - 1= 0
Type: FullPartialFractionExpansion(Fraction Integer,
                                 UnivariatePolynomial(x,Fraction Integer))

f5 := D(f, 5)
              10           9            8            7            6
     - 544320x   + 4354560x  - 14696640x  + 28615680x  - 40085280x
   +
              5            4            3           2
     46656000x  - 39411360x  + 18247680x  - 5870880x  + 3317760x + 246240
/
      20      19      18      17       16       15       14        13
     x   - 12x   + 53x   - 76x   - 159x   + 676x   - 391x   - 1596x
   +
          12        11        10        9        8        7        6        5
     2527x   + 1148x   - 4977x   + 1372x  + 4907x  - 3444x  - 2381x  + 2924x
   +
         4        3       2
     276x  - 1184x  + 208x  + 192x - 64
                    Type: Fraction UnivariatePolynomial(x,Fraction Integer)

We can check that the two forms represent the same function.

g5::Fx - f5
  0
                    Type: Fraction UnivariatePolynomial(x,Fraction Integer)

Here are some examples that are more complicated.

f : Fx := (x**5 * (x-1)) / ((x**2 + x + 1)**2 * (x-2)**3)
                 6    5
                x  - x
  -----------------------------------
   7     6     5     3     2
  x  - 4x  + 3x  + 9x  - 6x  - 4x - 8
                    Type: Fraction UnivariatePolynomial(x,Fraction Integer)

g := fullPartialFraction f
    1952       464        32                          179       135
    ----       ---        --                       - ---- %A + ----
    2401       343        49            --+          2401      2401
   ------ + -------- + -------- +       >          ----------------
    x - 2          2          3         --+             x - %A
            (x - 2)    (x - 2)      2
                                  %A  + %A + 1= 0
 +
                     37        20
                    ---- %A + ----
         --+        1029      1029
         >          --------------
         --+                   2
     2                 (x - %A)
   %A  + %A + 1= 0
Type: FullPartialFractionExpansion(Fraction Integer,
                                 UnivariatePolynomial(x,Fraction Integer))

g :: Fx - f
  0
                    Type: Fraction UnivariatePolynomial(x,Fraction Integer)

f : Fx := (2*x**7-7*x**5+26*x**3+8*x) / (x**8-5*x**6+6*x**4+4*x**2-8)
      7     5      3
    2x  - 7x  + 26x  + 8x
  ------------------------
   8     6     4     2
  x  - 5x  + 6x  + 4x  - 8
                    Type: Fraction UnivariatePolynomial(x,Fraction Integer)

g := fullPartialFraction f
                 1                                            1
                 -                                            -
     --+         2        --+          1          --+         2
     >        ------ +    >        --------- +    >        ------
     --+      x - %A      --+              3      --+      x - %A
    2                    2         (x - %A)      2
  %A  - 2= 0           %A  - 2= 0              %A  + 1= 0
Type: FullPartialFractionExpansion(Fraction Integer,
                                 UnivariatePolynomial(x,Fraction Integer))

g :: Fx - f
  0
                   Type: Fraction UnivariatePolynomial(x,Fraction Integer)

f:Fx := x**3 / (x**21 + 2*x**20 + 4*x**19 + 7*x**18 + 10*x**17 + 17*x**16 + 22*x**15 + 30*x**14 + 36*x**13 + 40*x**12 + 47*x**11 + 46*x**10 + 49*x**9 + 43*x**8 + 38*x**7 + 32*x**6 + 23*x**5 + 19*x**4 + 10*x**3 + 7*x**2 + 2*x + 1)
    3
   x
/
      21     20     19     18      17      16      15      14      13      12
     x   + 2x   + 4x   + 7x   + 10x   + 17x   + 22x   + 30x   + 36x   + 40x
   +
        11      10      9      8      7      6      5      4      3     2
    47x   + 46x   + 49x  + 43x  + 38x  + 32x  + 23x  + 19x  + 10x  + 7x  + 2x
   +
     1
                    Type: Fraction UnivariatePolynomial(x,Fraction Integer)

g := fullPartialFraction f
                1                        1      19
                - %A                     - %A - --
      --+       2             --+        9      27
      >        ------ +       >          ---------
      --+      x - %A         --+          x - %A
     2                    2
   %A  + 1= 0           %A  + %A + 1= 0
 +
                     1       1
                    -- %A - --
         --+        27      27
         >          ----------
         --+                 2
     2               (x - %A)
   %A  + %A + 1= 0
 +
   SIGMA
        5     2
      %A  + %A  + 1= 0
  ,
             96556567040   4   420961732891   3    59101056149   2
          - ------------ %A  + ------------ %A  - ------------ %A
            912390759099       912390759099       912390759099
        +
            373545875923      529673492498
          - ------------ %A + ------------
            912390759099      912390759099
     /
        x - %A
 +
   SIGMA
        5     2
      %A  + %A  + 1= 0
  ,
         5580868   4    2024443   3    4321919   2    84614        5070620
      - -------- %A  - -------- %A  + -------- %A  - ------- %A - --------
        94070601       94070601       94070601       1542141      94070601
      --------------------------------------------------------------------
                                            2
                                    (x - %A)
 +
   SIGMA
        5     2
      %A  + %A  + 1= 0
  ,
       1610957   4    2763014   3    2016775   2    266953        4529359
      -------- %A  + -------- %A  - -------- %A  + -------- %A + --------
      94070601       94070601       94070601       94070601      94070601
      -------------------------------------------------------------------
                                           3
                                   (x - %A)
Type: FullPartialFractionExpansion(Fraction Integer,UnivariatePolynomial(x,Fraction Integer))

This verification takes much longer than the conversion to partial fractions.

g :: Fx - f
  0
                    Type: Fraction UnivariatePolynomial(x,Fraction Integer)

Use PartialFraction for standard partial fraction decompositions.

For more information, see the paper [BS].

[BS]Bronstein, M and Salvy, B., Full Partial Fraction Decomposition of Rational Functions, Proceedings of ISSAC‘93, Kiev, ACM Press.

See Also:

  • )help PartialFraction
  • )show FullPartialFractionExpansion

Table Of Contents

This Page