Sage uses symbolic ring fot this. I guess you should just look how the following is implemented and copy that disign:
sage: var('x') x sage: f=sin(x^2) sage: f(x=2) sin(4) sage: f sin(x^2) sage: f.derivative()(x=2) 4*cos(4) sage: f.derivative(7) -128*x^7*cos(x^2) - 1344*x^5*sin(x^2) + 3360*x^3*cos(x^2) + 1680*x*sin(x^2) -- To post to this group, send an email to sage-devel@googlegroups.com To unsubscribe from this group, send an email to sage-devel+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/sage-devel URL: http://www.sagemath.org