]>
Book Contents Previous Section 9.60 OrderlyDifferentialPolynomial Next Section 9.62 Permanent Book Index

## 9.61 PartialFraction

A partial fraction is a decomposition of a quotient into a sum of quotients where the denominators of the summands are powers of primes.Most people first encounter partial fractions when they are learning integral calculus. For a technical discussion of partial fractions, see, for example, Lang's Algebra. For example, the rational number 1/6 is decomposed into 1/2-1/3. You can compute partial fractions of quotients of objects from domains belonging to the category EuclideanDomain. For example, Integer, Complex Integer, and UnivariatePolynomial(x, Fraction Integer) all belong to EuclideanDomain. In the examples following, we demonstrate how to decompose quotients of each of these kinds of object into partial fractions. Issue the system command )show PartialFraction to display the full list of operations defined by PartialFraction.

It is necessary that we know how to factor the denominator when we want to compute a partial fraction. Although the interpreter can often do this automatically, it may be necessary for you to include a call to factor. In these examples, it is not necessary to factor the denominators explicitly.

The main operation for computing partial fractions is called partialFraction partialFraction PartialFraction and we use this to compute a decomposition of 1 / 10!. The first argument to partialFraction partialFraction PartialFraction is the numerator of the quotient and the second argument is the factored denominator.

partialFraction(1,factorial 10)

159 2 8-23 3 4-12 5 2+1 7

Type: PartialFraction Integer

Since the denominators are powers of primes, it may be possible to expand the numerators further with respect to those primes. Use the operation padicFraction padicFraction PartialFraction to do this.

f := padicFraction(%)

1 2+1 2 4+1 2 5+1 2 6+1 2 7+1 2 8-2 3 2-1 3 3-2 3 4-2 5-2 5 2+1 7

Type: PartialFraction Integer

The operation compactFraction compactFraction PartialFraction returns an expanded fraction into the usual form. The compacted version is used internally for computational efficiency.

compactFraction(f)

159 2 8-23 3 4-12 5 2+1 7

Type: PartialFraction Integer

You can add, subtract, multiply and divide partial fractions. In addition, you can extract the parts of the decomposition. numberOfFractionalTerms numberOfFractionalTerms PartialFraction computes the number of terms in the fractional part. This does not include the whole part of the fraction, which you get by calling wholePart wholePart PartialFraction. In this example, the whole part is just 0.

numberOfFractionalTerms(f)

12

Type: PositiveInteger

The operation nthFractionalTerm nthFractionalTerm PartialFraction returns the individual terms in the decomposition. Notice that the object returned is a partial fraction itself. firstNumer firstNumer PartialFraction and firstDenom firstDenom PartialFraction extract the numerator and denominator of the first term of the fraction.

nthFractionalTerm(f,3)

1 2 5

Type: PartialFraction Integer

Given two gaussian integers (see ComplexXmpPage ), you can decompose their quotient into a partial fraction.

partialFraction(1,- 13 + 14 * %i)

-1 1+2 i+4 3+8 i

Type: PartialFraction Complex Integer

To convert back to a quotient, simply use a conversion.

% :: Fraction Complex Integer

-i 14+13 i

Type: Fraction Complex Integer

To conclude this section, we compute the decomposition of

1
-------------------------------
2 3 4
(x + 1)(x + 2) (x + 3) (x + 4)

The polynomials in this object have type UnivariatePolynomial(x, Fraction Integer).

We use the primeFactor primeFactor Factored operation (see FactoredXmpPage ) to create the denominator in factored form directly.

u : FR UP(x, FRAC INT) := reduce(*,[primeFactor(x+i,i) for i in 1..4])

(x+1)(x+2)2(x+3)3(x+4)4

Type: Factored UnivariatePolynomial(x,Fraction Integer)

These are the compact and expanded partial fractions for the quotient.

partialFraction(1,u)

1 648 x+1+1 4 x+7 16(x+2)2+-17 8 x 2-12 x-139 8(x+3)3+607 324 x 3+10115 432 x 2+391 4 x+44179 324(x+4)4

Type: PartialFraction UnivariatePolynomial(x,Fraction Integer)
padicFraction %

1 648 x+1+1 4 x+2-1 16(x+2)2-17 8 x+3+3 4(x+3)2-1 2(x+3)3+607 324 x+4+403 432(x+4)2+13 36(x+4)3+1 12(x+4)4

Type: PartialFraction UnivariatePolynomial(x,Fraction Integer)

All see FullPartialFractionExpansionXmpPage for examples of factor-free conversion of quotients to full partial fractions.

Book Contents Previous Section 9.60 OrderlyDifferentialPolynomial Next Section 9.62 Permanent Book Index