## On constants and D's behaviour

### On constants and D's behaviour

Dear people,
just a thought, from a frustrated mind:

given that one can explicitely tell a symbol is a constant by modifying
its attributes, then why the hell doesn't the partial derivative D take
advantage of it, and treat nonconstant symbol as.... nonconstants, by
default ??

Cheers,
Nicolas

### On constants and D's behaviour

You need to use Dt rather than D.

Thus

Dt[a,x]

gives

Dt[a,x]

whereas

Dt[a,x,Constants\[Rule]{a}]

gives

0

Steve Luttrell

### On constants and D's behaviour

Why should D duplicate another functions behaviour? Use Dt instead of D:

Dt[c, x]

Dt[c, x]

SetAttributes[c, Constant]

Dt[c, x]

0

Andrzej Kozlowski
Chiba, Japan
http://www.yqcomputer.com/ ~andrzej/
http://www.yqcomputer.com/ ~akoz/

### On constants and D's behaviour

I suspect part of the problem with D and Dt is that a set of conventions
that might suit one problem domain would not seem right in another
context. In any case, I am sure the rules for these operations are cast
in stone because too much stuff would break if WRI changed them! I must
say though (relating to your previous question) I have never understood
why D evaluates if either of its arguments is a pattern!

It is, however, very easy to supply a recursive definition for dD that
uses whatever rules you see fit. One option is to define dD using a set
of transformation rules and then apply them with //. if and when you
want your derivatives evaluated. That way you can leave expressions like
d(sin(x))/dx unevaluated in your expressions, which can be useful in
some contexts.

David Bailey