Mathematica 9 is now available
Services & Resources / Wolfram Forums / MathGroup Archive

MathGroup Archive 2008

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

Search the Archive

Re: Incoherent value for partial derivative

  • To: mathgroup at
  • Subject: [mg91110] Re: Incoherent value for partial derivative
  • From: Albert Retey <awnl at>
  • Date: Wed, 6 Aug 2008 05:07:04 -0400 (EDT)
  • References: <g76auv$dks$>

Miguel wrote:
> Let
> In[1]: g[x_]:=3x^2+5x;
> FullForm[g'[x]]
> Out[1]: Plus[5,Times[6,x]]
> In[2]: g'[2]
> Out[2]: 17
> Mathematica works fine and the result is correct. First, it executes
> the derivation and then the delayed substitution/assignation. But for
> partial derivative Mathematica works different way (not correspondig
> to FullForm
> In[3]: f[x_,y_]:=x^2+x y^2;
> FullForm[\!\(
> \*SubscriptBox[\(\[PartialD]\), \(x\)]\ \(f[x, y]\)\)]
> Out[3]: Plus[Times[2,x],Power[y,2]]
> In[4]: \!\(
> \*SubscriptBox[\(\[PartialD]\), \(x\)]\ \(f[1, 2]\)\)
> Out[4]: 0
> I dont understand the reason.

Others have answered your question, but there is something that might
make clearer what the reason for this might be, at least as far as I can

g' is just a short notation for Derivative[1][g] which, as others have
mentioned, works correctly if there are suitable definitions for g even
without arguments given. The same is true for the more general forms of
Derivative, e.g. Derivative[0,1][f], for which there is also a nice
notation in StandardForm, which you can generate by evaluating it for an
f with no definition. The reason why it works (and can work) is because
both notations implicitly work by positional arguments.

On the other hand D[f[x,y],y] and the nicer looking
StandardForm-Notation with \[PartialD] you have used work with the names
of the arguments, and of course can only work correctly when arguments
are given.

To my understanding this is the deeper reason why g'[x] and
\!\(\*SubscriptBox[\(\[PartialD]\), \(x\)]\ \(f[x, y]\)\)
behave so differently.



This will create the Standard-Form Notation for Derivative[1,0][f] if
evaluated in a notebook:

      RowBox[{"(", RowBox[{"1", ",", "0"}], ")"}],
   ]] // DisplayForm

  • Prev by Date: Re: Evaluate part of rhs of RuleDelayed
  • Next by Date: Re: Derivative of Dot[]
  • Previous by thread: Re: Incoherent value for partial derivative
  • Next by thread: Re: How can I make the colored lines inside a Mathematica