# Working with formal power series

This is a simplified version of my previous question.

1) Is it possible to define a formal power series in sage by giving an expression for the n-th coefficient, e.g. as the expression "n" defines the power series 0 + 1 x + 2 x^2 + 3 x^3 + ... n x^n + ... ?

2) Does sage know how to multiply such objects by convolving the terms? Can it anti-differentiate them symbolically?

edit retag close merge delete

Sort by » oldest newest most voted

Your example is an easy one for maxima:

sage: var('x,i')
(x, i)
sage: S = sum(i*x^i, i, 0, infinity)
sage: S
x/(x^2 - 2*x + 1)
sage: S.integral()
-1/(x - 1) + log(x - 1)
sage: (S^2).integral()
-1/3*(3*x^2 - 3*x + 1)/(x^3 - 3*x^2 + 3*x - 1)


But I don't think there is a way to ask for a closed form expression for the coefficients of S, or S^2. Even S.power_series() isn't very useful, as it refuses to work with anything else than polynomials.

If your expression is seriously more complicated than $\sum_i ix^i$, then I don't think Sage can give any useful answer.

more

Thank you for the prompt response!

( 2013-09-20 05:58:16 -0500 )edit