[Date Index] [Thread Index] [Author Index]
Re: Why does Derivative fail in this case?
On Feb 16, 6:58 am, Aaron Fude <aaronf... at gmail.com> wrote: > f[x_, y_] := x y > g = f[##]*f[##] &; > h = Derivative[1, 0][g]; > g[x, y] > h[x, y] > I should expect that h[x, y] is 2 x y^2, but instead it is zero. How > come? You've written g so that it's a function of SlotSequence (which is what FullForm[##1] will give you), while Derivative[1,0][g] effectively takes the derivative with respect to Slot (a.k.a. #1). Writing g = f[#1,#2] * f[#1,#2] &; will do what you want. Cheers, Pillsy