On Sep 3, 10:52 am, Nicolas <nicolas.fresseng...@gmail.com> wrote:
> I am trying to do the following thing but I am not sure whether this
> is possible in sage (though I think it is in Mathematica)
>
> Let's say I define a symbolic function
>
> sage: f=function('f',x)
>
> I would like to issue some command to "tell" sage what the derivative
> of f is (for instance : g) so that the command
>
> sage: diff(f)
>
> would yield g

Yes, its possible also in Sage. I am giving you an example that you
can adapt for your need. (if you have have a function of multiple
arguments then you should read diff_param keywords. For example,
try heaviside?? in sage prompt to see how to read diff_param)

--------
sage: g = function('g')
sage: def f_deriv(*args, **kwds):
....:     return g(*args)
....:
sage: f = function('f', derivative_func=f_deriv)
sage: f(x)
f(x)
sage: diff(f(x), x)
g(x)
------------

Best,
Golam



--~--~---------~--~----~------------~-------~--~----~
To post to this group, send email to sage-support@googlegroups.com
To unsubscribe from this group, send email to 
sage-support-unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/sage-support
URLs: http://www.sagemath.org
-~----------~----~----~----~------~----~------~--~---

Reply via email to