On Sep 8, 9:40 am, Golam Mortuza Hossain <gmhoss...@gmail.com> wrote: > The issue is what to do when a user explicitly ask to apply chain rule > by over-riding default setting but provides f(x,x) as the function?
Ah, I see. You are applying the wrong chain rule. You need multivariate calculus. f(x,x) is a composition of two functions: g: x:-> (x,x) and h: (y,z) :-> h(y,z). in this setting, you have f=h(g(x)) and the appropriate derivative falls out by taking the composition of the total derivatives of g and h, so if we name g(x)= (g_1(x), g_2(x)) you get that f.diff(x) should be equal to to the row-vector times column vector: [ D[0](h)( g(x)), D[1](h) (g(x)) ] * [ D[0](g_1) (x) , D[0](g_2)(x) ] ^T I think this example actually shows why computer algebra systems prefer to implement "positional derivatives", why it's worthwhile have conventional "named partial derivatives" and why encoding one into the other is more than a mere translation of notation. --~--~---------~--~----~------------~-------~--~----~ To post to this group, send an email to sage-devel@googlegroups.com To unsubscribe from this group, send an email to sage-devel-unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/sage-devel URLs: http://www.sagemath.org -~----------~----~----~----~------~----~------~--~---