Yeah, it would be nice to be able to do that. Unfortunately SymPy has no notion of the derivative of an unapplied function. I'd like to have a differential operator so you could do something like `D(sin) == cos` etc. I believe there are some long-standing issues on Github about this.
-- Oscar On Tue, 4 Jun 2019 at 18:44, David Bailey <d...@dbailey.co.uk> wrote: > > The ability to expand an expression containing unknown functions, about some > point, is obviously very valuable, and it is nice that this is possible using > SymPy, however if I expand f(x) about 0 I get this: > > f(0) + x*Subs(Derivative(f(_x), _x), _x, 0) + x**2*Subs(Derivative(f(_x), > (_x, 2)), _x, 0)/2 + O(x**3) > > Is there any way to reduce that to something neater and more like textbook > maths such as > > f(0)+x*f`(0)+x**2*f```(0)/2 + O(x**3) > > I chose f` rather than f' because as far as I know, the '`' character is not > used in Python. > > Outputting the expression as Latex cleans it up a bit, but it is still not as > neat as the usual notation for the derivative of a function notation. > > David > > -- > You received this message because you are subscribed to the Google Groups > "sympy" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to sympy+unsubscr...@googlegroups.com. > To post to this group, send email to sympy@googlegroups.com. > Visit this group at https://groups.google.com/group/sympy. > To view this discussion on the web visit > https://groups.google.com/d/msgid/sympy/5bca2aa1-8b2b-4a3f-af18-6f9a42dc87cd%40googlegroups.com. > For more options, visit https://groups.google.com/d/optout. -- You received this message because you are subscribed to the Google Groups "sympy" group. To unsubscribe from this group and stop receiving emails from it, send an email to sympy+unsubscr...@googlegroups.com. To post to this group, send email to sympy@googlegroups.com. Visit this group at https://groups.google.com/group/sympy. To view this discussion on the web visit https://groups.google.com/d/msgid/sympy/CAHVvXxQ-7iEgovJtmqaNm_5rudpwc2vdMObYkRqV71u5PhjFSg%40mail.gmail.com. For more options, visit https://groups.google.com/d/optout.