Hi,
While waiting for next Sage final release, I enhanced the
new symbolic "diff" implementation to support symbolic n-th
derivative. So one can now work with them by calling the new
diff derivative directly (with strict syntax)
--------
sage: f(x) = function('f',x); n,m=var('n,m')
sage: h = symbolic_diff(f(x), x, n); h
diff(f(x), x, n)
---------
"h" can be explicitly evaluated as
-------
sage: h.subs(f(x)==x^2).subs(n==1)
2*x
-------
It can be differentiated standard way
-------
sage: h.diff(x)
diff(f(x), x, n + 1)
------
and can be integrated (via Maxima)
------
sage: h.integral(x)
diff(f(x), x, n - 1)
-------
It can also be further differentiated m-th time
---------
sage: symbolic_diff(h, x, m)
diff(f(x), x, m + n)
---------
Now to have a unified approach (as suggested by Maurizio) for
derivative and anti-derivative (integral) following is a valid input
---------
sage: symbolic_diff(h, x, -1)
diff(f(x), x, n - 1)
---------
which is same as h.integral(x)!
Once the symbolic integration is moved to pynac SFunction class,
I am planning to enable calling integral directly from new
symbolic_diff.
I would appreciate if you have any further comments/suggestions
on this approach or any pitfalls I should worry about.
BTW, I have put the new derivative code in "fderivative.cpp" file of pynac as
second implementation of abstract derivative. In case, it would
be desirable to put the new code in a new file then please let me know.
Cheers,
Golam
--~--~---------~--~----~------------~-------~--~----~
To post to this group, send an email to [email protected]
To unsubscribe from this group, send an email to
[email protected]
For more options, visit this group at http://groups.google.com/group/sage-devel
URLs: http://www.sagemath.org
-~----------~----~----~----~------~----~------~--~---