MathGroup Archive 2009

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

Search the Archive

Re: Bug in D (or Derivative) ( Was: Re: DSolve bug)

  • To: mathgroup at
  • Subject: [mg97941] Re: [mg97919] Bug in D (or Derivative) ( Was: Re: DSolve bug)
  • From: Andrzej Kozlowski <akoz at>
  • Date: Thu, 26 Mar 2009 05:21:28 -0500 (EST)
  • References: <> <> <>

On 25 Mar 2009, at 14:40, Andrzej Kozlowski wrote:

> On 25 Mar 2009, at 11:46, schochet123 at wrote:
>> The source of this bug seems to be the following bug in in D (or
>> Derivative): According to Mathematica, D[u',u] yields u''. However,
>> the correct answer is u''/u'
>> (Homework for Calculus 1: use the chain rule to prove this.)
> Not really. According to Mathematica's notion of derivative, D[u',u]  
> ought to be 0, since u' does not involve u explicitly.

Actually, I was wrong here since, of course, u' is Derivative[1][u]  
and this does involve u explicitly. Of course in this case  
D[Derivative[1][u],u] does not make any mathematical sense (unless we  
wanted this to mean the derivative in some functional sense, but then  
what Mathematica does with it makes no sense anyway). This:

D[derivative[1][u], u]

does make sense, as long as derivative is undefined, but this:

  % /. derivative -> Derivative

Still, for Mathematica to  be consistent and still make mathematical  
sense,  D[u',u] ought to return 0, as it in the example below.

Andrzej Kozlowski

> In fact,
> D[u'', u']
> 0
> which, of course, is much the same thing. The only way I know to get  
> the answer you have in mind with Mathematica is:
> Dt[Derivative[1][u][x], u[x]]
> Derivative[2][u][x]*Dt[x, u[x]]
>> The way Mathematica obtains its incorrect result is quite amusing, As
>> Trace shows, Mathematica evaluates D[u',u] by noting that the  
>> FullForm
>> of u' is Derivative[1][u], whose derivative with respect to u is (of
>> course ;) ) Derivative[1]'[u].
>> Mathematica then decides that Derivative[1]'  is Derivative[2],
>> yielding Derivative[2][u], i.e., u''.
> Indeed, this is right, and has been mentioned on this forum several  
> times in the past (at least twice by me).
> See, for example,
> Andrzej Kozlowski

  • Prev by Date: Re: SetDelayed::write ... [x_] is protected
  • Next by Date: What's going on here (Table-generated lists)?
  • Previous by thread: Re: Bug in D (or Derivative) ( Was: Re: DSolve bug)
  • Next by thread: p-value ANOVA Tukey?