MathGroup Archive 2009

[Date Index] [Thread Index] [Author Index]

Search the Archive

Re: Why does Derivative fail in this case?

  • To: mathgroup at smc.vnet.net
  • Subject: [mg96607] Re: Why does Derivative fail in this case?
  • From: Bill Rowe <readnews at sbcglobal.net>
  • Date: Tue, 17 Feb 2009 06:25:14 -0500 (EST)

On 2/16/09 at 6:58 AM, aaronfude at gmail.com (Aaron Fude) wrote:

>This example is self-explanatory:

>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?

Because g is not a function of either x or y. You have defined g
to be a pure function. Doing g[x,y] does not change the
definition of g. So, for the definition of h, Derivatitive[1,
0][g] is evaluated to 0& and this result is assigned to h.
Consequently, any argument supplied to h will return 0.

You can easily verify the value assigned to h by doing

OwnValues[h]



  • Prev by Date: Re: pfa2pfb
  • Next by Date: Re: Mathematica, ARPACK and implicit matrices
  • Previous by thread: Re: Why does Derivative fail in this case?
  • Next by thread: Printing large symbolic matrices