[Date Index] [Thread Index] [Author Index]
Re: Why D[x', x] isn't 0 ?
On 29 Apr 2006, at 16:40, Vladimir wrote: > Hello! > > D[x'', x'] => 0 (* okay *) > > D[x', x] => x'' (* unexpected despite being similar to above *) > > D[f[x'], x] => x'' f'[x'] (* unexpected as well *) > > Why the last 2 lines don't produce zeroes and how to make them > do so (for any function f) because it's quite common in mechanics > where velocity is treated as independent of position, etc. > > -- > Vladimir > Consider the case D[x', x]. Mathematica does it as follows. The FullForm of the expression is: D[Derivative[x], x] So Mathematica sees it as having the form f[x], where f is the function Derivative. Next, Derivative is differentiated as a function to obtain Derivative. Finally Derivative[x] is returned and re-written as x''. Now the case D[x'', x'] The FullForm is D[Derivative[x], Derivative[x]]. Now the expression that is being differentiated is not seen as an explicit function of the expression Derivative[x] with respect to which the differentiation is being performed, so the answer 0 is returned. The other case should now be obvious. As for your other question: the easiest way is the most obvious one: In:= x'=v; In:= D[f[x'], x] Out= 0 In:= D[x',x] Out= 0 There are other, more elaborate ways, but I can't imagine that they would be preferable to the above. Andrzej Kozlowski Tokyo, Japan