6
$\begingroup$
y = a + b x;

I can understand this output of the ordinary differentiation of y w.r.t. x

D[ y, x]
b

but I don't understand the mathematical meaning of this output

D[y]
a + b x

In fact there is no matching usage of D[f] (with only single argument) in the Mathematica documentation. Usually Mathematica will flag up argument count mismatch when running, e.g.

"... called with m argument; n arguments are expected"

Can anyone help me to understand the meaning of D[f]? Is this a bug or undocumented behavior in Mathematica?

$\endgroup$
13
$\begingroup$

It's not a bug if you consider this behavior as a logical continuation of the following permissible syntax:

D[a + b x^3, x, x, x]

(* ==> 6 b *)

D[a + b x^3, x, x]

(* ==> 6 b x *)

D[a + b x^3, x]

(* ==> 3 b x^2 *)

D[a + b x^3]

(* ==> a + b x^3 *)

The point is that a Sequence of variables is allowed following the first argument of D. And the empty sequence in the last example is a special case of this.

$\endgroup$
  • $\begingroup$ That's a very good and compelling reasoning for the output it provides... In my earlier comment, I didn't say undefined syntax, but invalid syntax (I can see how "invalid" is incorrect terminology as well... I should've said "undocumented"). I would consider this to either be a documentation oversight (if this use is intended) or speculative... the definition might as well be D[f_] := f as I had said in my comment :) $\endgroup$ – rm -rf Apr 1 '14 at 3:30
  • 1
    $\begingroup$ @rm-rf You may well be right - but I thought it's OK to postulate "innocent until proven guilty"... $\endgroup$ – Jens Apr 1 '14 at 3:35
  • $\begingroup$ In other words, D[f[x]] is the zeroth derivative, $f^(0)(x)$, the same as Derivative[0][f][x]. $\endgroup$ – Michael E2 Apr 1 '14 at 15:48
  • $\begingroup$ @MichaelE2 Right. I wonder if there's also a continuation to negative derivatives like in Derivative[-1], which is indeed the integral. Maybe f[x[D]]? $\endgroup$ – Jens Apr 1 '14 at 16:36
  • $\begingroup$ @Jens I'm not sure about f[x[D]]; however, I'd expect D[f[x], {x,-1}] would be ok, but it doesn't work. $\endgroup$ – Michael E2 Apr 1 '14 at 16:51

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.