On Thu, Oct 22, 2009 at 3:43 PM, Ronan Lamy <ronan.l...@gmail.com> wrote: > > Le jeudi 22 octobre 2009 à 14:42 -0700, Ondrej Certik a écrit : >> On Thu, Oct 22, 2009 at 2:34 PM, andy2O <and...@hotmail.com> wrote: >> > >> > >> > Hi all, >> > >> > as_coeff_exponent(...) seems to ignore derivatives, as shown below >> > >> > Is this behaviour intended? If so I can report it as an issue - but >> > last time recorded an issue it turned out I just misunderstood atoms >> > (), so I thought I'd check first here! :) >> >> Sure. :) >> >> > >> > Thanks, >> > andy >> > >> >>>> ================================ RESTART >> >>>> ================================ >> >>>> from sympy import * >> >>>> var('x') >> > x >> >>>> f=Function('f') >> >>>> d=diff(f(x),x) >> >>>> d >> > D(f(x), x) >> >>>> d.as_coeff_exponent(f(x)) >> > (1, 1) >> >> What do you suggest to be a correct answer? I never used >> as_coeff_exponent inside a derivative. >> >> Ondrej > > The correct answer is clearly (D(f(x), x), 0), by analogy with > cos(x).as_coeff_exponent(sin(x)) == (cos(x), 0). So, yes, Andy, you've > uncovered a real issue. > > I think that the fundamental problem here is that there is no object > representing the derivative of a function (the current Derivative is an > operation applying to expressions, not functions).
Yes, I think the Derivative should be improved to be able to represent a general derivative of a function f(x). Ondrej --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "sympy" group. To post to this group, send email to sympy@googlegroups.com To unsubscribe from this group, send email to sympy+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/sympy?hl=en -~----------~----~----~----~------~----~------~--~---