Re: Why does Derivative fail in this case?
- To: mathgroup at smc.vnet.net
- Subject: [mg96580] Re: Why does Derivative fail in this case?
- From: Pillsy <pillsbury at gmail.com>
- Date: Mon, 16 Feb 2009 16:39:41 -0500 (EST)
- References: <firstname.lastname@example.org>
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