Dear GiNaCers,
Here's a patch. Find out below why you want this patch ;-).
The integral class has a .derivative() method, so in principle integrals
can be series expanded. However, if somewhere deep down in the integrant a
sum with a lot of terms occurs, the same kind of problems that have
troubled the series expansion of powers, happen again. Basically we get
expression explosion. To solve this I wrote an integral::series() method.
While doing this I discovered several bugs/undesirable features, namely
(1) When requesting terms of a pseries via pseries::op(), the order term
looks like O(1)^n instead of O(x^n). This looks strange and different from
the output that one gets from printing the entire series.
(2) Since pseries does not have a let_op() method for understandable
reasons, eval_integ() does not work for a power series. I have added a new
method pseries::eval_integ() to solve this.
(3) When trying to find coefficients and exponents of power series, using
pseries::op() is not convenient and not efficient. This returns a
multiplication of the coefficient with a power that the user then may
attempt to extract the coefficient and the exponent from... To make this
easier, I added pseries::coeffop() and pseries::exponop() methods.
(4) pseries::mul_series() does not know that zero times a power series is
zero.
(5) If pseries::power_const() discovers that the user is expanding to such
a low degree that only the order term needs to be returned, GiNaC
sometimes tries to save memory by allocating a negative amount of bytes in
order to store a negative number of terms in it.
Best,
Chris