ASKSAGE: Sage Q&A Forum - RSS feedhttps://ask.sagemath.org/questions/Q&A Forum for SageenCopyright Sage, 2010. Some rights reserved under creative commons license.Fri, 20 Sep 2013 12:58:16 +0200Working with formal power serieshttps://ask.sagemath.org/question/10553/working-with-formal-power-series/This is a simplified version of my previous [question](http://ask.sagemath.org/question/3012/integrating-formal-laurent-series).
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?
Fri, 20 Sep 2013 10:17:18 +0200https://ask.sagemath.org/question/10553/working-with-formal-power-series/Answer by Luca for <p>This is a simplified version of my previous <a href="http://ask.sagemath.org/question/3012/integrating-formal-laurent-series">question</a>. </p>
<p>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 + ... ?</p>
<p>2) Does sage know how to multiply such objects by convolving the terms? Can it anti-differentiate them symbolically?</p>
https://ask.sagemath.org/question/10553/working-with-formal-power-series/?answer=15476#post-id-15476Your 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.
Fri, 20 Sep 2013 12:31:58 +0200https://ask.sagemath.org/question/10553/working-with-formal-power-series/?answer=15476#post-id-15476Comment by anilbv for <p>Your example is an easy one for maxima:</p>
<pre><code>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)
</code></pre>
<p>But I don't think there is a way to ask for a closed form expression for the coefficients of <code>S</code>, or <code>S^2</code>. Even <code>S.power_series()</code> isn't very useful, as it refuses to work with anything else than polynomials.</p>
<p>If your expression is seriously more complicated than $\sum_i ix^i$, then I don't think Sage can give any useful answer.</p>
https://ask.sagemath.org/question/10553/working-with-formal-power-series/?comment=17002#post-id-17002Thank you for the prompt response!Fri, 20 Sep 2013 12:58:16 +0200https://ask.sagemath.org/question/10553/working-with-formal-power-series/?comment=17002#post-id-17002