ASKSAGE: Sage Q&A Forum - Latest question feedhttp://ask.sagemath.org/questions/Q&A Forum for SageenCopyright Sage, 2010. Some rights reserved under creative commons license.Tue, 27 Dec 2016 16:58:06 -0600Variable overrites function defined previouslyhttp://ask.sagemath.org/question/36108/variable-overrites-function-defined-previously/I have u(t) which is an function of t, and g(u) which is a function of u. I want to find the derivative of g(u)*u(t) w.r.t. t.
sage: u(t) = function('u')(t)
sage: h(u) = function('h')(u)
sage: u
u
sage: h
u |--> h(u)
diff(h(u)*u(t),t)
h(u)
This seems to happen because the function u is overwritten when I use u to define the function h. I can get around it this way.
sage: u(t) = function('u')(t)
sage: h(x) = function('h')(x)
sage: u
t |--> u(t)
sage: h
x |--> h(x)
sage: diff(h(u)*u(t),t)
u(t)*D[0](h)(u(t))*D[0](u)(t) + h(u(t))*D[0](u)(t)
Can this be classified as a bug?
If it is, would it be possible to fix it?
Thanks in advance.omoplataTue, 27 Dec 2016 16:58:06 -0600http://ask.sagemath.org/question/36108/