Taylor series of elliptic_kc(m) about m=0 fails with error



On Thu, Sep 20, 2012 at 6:22 AM, Stavros Macrakis <macrakis at alum.mit.edu>wrote:

> On Wed, Sep 19, 2012 at 12:13 PM, Raymond Toy <toy.raymond at gmail.com>wrote:
>
>> ...taylor(elliptic_kc(m),m,0,1);
>>>
>>>
>>> Maxima encountered a Lisp error:
>>>  Error in MACSYMA-TOP-LEVEL [or a callee]: Bind stack overflow....
>>>
>>
>
>> Sorry about that.  This is a known problem.  I don't know how to teach
>> taylor about expansion.
>>
>
> ? deftaylor
>
> ... or is that buggy in this case?


Oh, I didn't know about deftaylor.  It does work:

deftaylor(elliptic_kc(m), %pi/2*sum(m^k*((2*k)!/(2^k*k!)^2)^2,k,0,inf));
2/%pi*taylor(elliptic_kc(m), m, 0, 2)  -> 1 + m/4 + 9/64*m^2

That's nice.  But this is not so nice:

taylor(elliptic_kc(m), m, 1/2, 2) -> unable to expand at a point specified.

Without deftaylor, maxima can actually compute the taylor series:

sqrt(%pi)/gamma(3/4)^2-(sqrt(%pi)*%pi-4*'elliptic_ec(1/2)*gamma(3/4)^2)
                       *(m-1/2)
                       /(gamma(3/4)^2*%pi)
                      +sqrt(%pi)*(m-1/2)^2/(2*gamma(3/4)^2)$

I think that's right, based on the first two derivatives of elliptic_kc(m).

It would be nice if deftaylor actually had information about the expansion
point and taylor would use that for the expansion and then tried other
methods for other expansion points.

Ray