Hello, I came back...
I define the following one-parameter functions and their derivatives

x,y,l,L = var('x,y,l,L')

d5 = function('d5',nargs=1)

def d3partderiv(self,*args,**kwds): arg = args[0]; return
L*L*d5(arg);
d3 = function('d3',derivative_func=d3partderiv)

def d1partderiv(self,*args,**kwds): arg = args[0]; return -( d3(arg)
+d1(arg) )/arg
d1 = function('d1',derivative_func=d1partderiv)

The derivatives work correctly:

diff(d1(x^2),x)   --->   -2*(d3(x^2) + d1(x^2))/x
diff(d3(x^2),x)   --->   2*L^2*x*d5(x^2)

but the Taylor expansion of d1(x) to second order gives

taylor( d1(x), x, 0, 2)   --->  1/2*x^2*D[0, 0](d1)(0) + x*D[0](d1)(0)
+ d1(0)

I don't understand why but :

sage: add (diff (d1(x^2), x, k)*x^k/factorial(k) for k in [0..2]) # seems right.

You recode the taylor function...

F.

--
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