Section8.2Fractions and Series
Many generating series can be expressed as rational functions, and such expressions provide useful information. We illustrate this. First we create a ring of polynomials, and the corresponding field of fractions. (We will not need the latter, as it happens.)
xxxxxxxxxx
Qu.<u> = QQ[]
F = FractionField(Qu)
Qu
Now we can work with our series L(t) from the previous section.
xxxxxxxxxx
rf = (1-2*u+ u^3/(1+u+u^2))^(-1)
rf.numerator(), rf.denominator()
xxxxxxxxxx
rf.subs(u=1/2)
xxxxxxxxxx
Rt.<t> = QQ[[]]
rf.subs(u=t).O(9)
Note that t is the generator of Rt, which is Q[[t]]. So we have used subs() to convert a rational function to a power series.
We can also compute partial fraction decompositions. For these to be useful the zeros of the denominator should belong to the field we are working over.
xxxxxxxxxx
Cs = FractionField( PolynomialRing(CDF, 's'))
whole, parts = rf.subs(u=Cs.gen()).partial_fraction_decomposition()
for p in parts:
print p