On second thought, I think it would be better to use the airy equation
to calculate derivatives or order higher than 1. Like

sage: airy_ai(2,x)
x*airy_ai(x)
sage: airy_ai(3,x)
airy_ai(x)+x*airy_ai_prime(x)
sage: diff(airy_ai(x),x,2)
x*airy_ai(x)
sage: diff(airy_ai(x),x,3)
airy_ai(x)+x*airy_ai_prime(x)

which is very likey to be the way mpmath calculates higher order
derivatives. Integrals however, would be returned as:

sage: airy_ai(-1,x)
airy_ai(-1,x)
sage: integral(airy_ai(x),x)
airy_ai(-1,x)

what do you think?

Oscar

On 7 feb, 09:15, Burcin Erocal <[email protected]> wrote:
> On Tue, 7 Feb 2012 06:56:30 -0800 (PST)
>
>
>
>
>
>
>
>
>
> Oscar Lazo <[email protected]> wrote:
> > On 7 feb, 04:48, Burcin Erocal <[email protected]> wrote:
> > > I don't think we want to have separate functions for the
> > > derivatives in Sage. These might help you get around the printing
> > > problem for now, but they are not useful in general.
> > I disagree here, Mathematica has got the AiryAiPrime function. And
> > mpmath supports calculating derivatives and integrals of arbitrary
> > order! I think it would be best if we could do something like:
>
> > sage: airy_ai(x)
> > airy_ai(x)
> > sage: airy_ai(x,1)
> > airy_ai_prime(x)
> > sage: airy_ai(x,-2)
> > airy_ai(x,-2)
>
> > that is, make a single object that returns arbitrary derivatives or
> > integrals.
>
> You're right, I didn't know mpmath supported this. We can have a main
> function that takes a single argument and another one with two
> arguments to represent the derivatives. This is similar to how maple
> implements the airy function:
>
> http://www.maplesoft.com/support/help/Maple/view.aspx?path=Airy
>
> The implementation would be similar to that of the psi function:
>
> http://hg.sagemath.org/sage-main/file/tip/sage/functions/other.py#l810
>
> Note that there are two symbolic functions Function_psi1 and
> Function_psi2, with a regular python function names psi() that
> wraps these.
>
> You can also put the new functions in a new file sage/functions/airy.py.
>
> Cheers,
> Burcin

-- 
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/sage-support
URL: http://www.sagemath.org

Reply via email to