This is probably a silly question, but I can't seem to find an answer anywhere. It seems odd to me that Sage should allow us to get a series expansion for a generating function, but won't allow us to use a partial fraction decomposition...
sage: version()
'SageMath version 8.9, Release Date: 2019-09-29'
sage: F, z = SR.var('F z')
sage: system = [(F - z)/z^2 == F + F/z]
sage: sols = solve(system, F, solution_dict=True)
sage: sols
[{F: -z/(z^2 + z - 1)}]
sage: F = sols[0][F]
sage: F
-z/(z^2 + z - 1)
sage: F.series(z, 11)
1*z + 1*z^2 + 2*z^3 + 3*z^4 + 5*z^5 + 8*z^6
+ 13*z^7 + 21*z^8 + 34*z^9 + 55*z^10 + Order(z^11)
sage: F.partial_fraction(z)
-z/(z^2 + z - 1)
Sage is (correctly) working with $F$ over a symbolic ring, and I'm not sure how to make it do a partial fraction decomposition over $\mathbb{C}$.
Any tips on best practices for this would be amazing! Ideally, I wouldn't have to convert to rational functions over $\mathbb{C}$ and back, since I might want to keep manipulating it symbolically afterwards, but at this point I don't even know how to convert it.
Thanks in advance ^_^
To work over the field of rational functions in
zwith coefficients inQQbar, define it as follows:then get
Fas an element of that ring:and use the
partial_fraction_decompositionmethod:Note that the coefficients are now elements in
QQbar.If you need their radical expressions: