Take the 2-minute tour ×
Mathematica Stack Exchange is a question and answer site for users of Mathematica. It's 100% free, no registration required.

Can I do something like this:

$$\partial_t = D[f, t]$$

i.e. create a symbol instead of a function so that each time I call it, it executes the operation as defined?

share|improve this question
1  
Yes. Look up the Notations package in the docs. –  Mike Honeychurch Feb 13 at 22:37

3 Answers 3

up vote 2 down vote accepted

With the notation package something like this is easy. I would never use this by myself, because IMO such sugar can easily introduce bugs and undesired behavior if one is not cautious. I will paste a screenshot so that you see how I used the Notation` package, but first of all you have to load it:

<< Notation`

then you can use

Mathematica graphics

Testing it

Mathematica graphics

or

Mathematica graphics

share|improve this answer

When I read this question, it seems to be asking for set-delayed. For example, say we want to calculate D[f[t],t] over and over but want to give it a name like q. Then

q := D[f[t], t]

does this. If you don't have f defined then

q
Derivative[1][f][t]

If f is defined, say

f[t_] := t^2
q
2 t
share|improve this answer

Actually $\partial _t f[t]$ in Mathematica is interpreted as D[f[t],t] by default. You don't need to redefine it.

Considering $\partial _t = D[f,t]$ given by the OP is only an example of what the OP wants to do, I regard this question as a way to redefine the basic rules for the input of the expression. You can define the low-level input rules by using MakeExpression.

In this case, I try to define $\mathbb{D}_t f[t]$ as D[f[t],t] for better understanding.

MakeExpression[RowBox[{SubscriptBox["\[DoubleStruckCapitalD]", t_], f_}], StandardForm] :=
  MakeExpression[RowBox[{"D", "[", f, ",", t, "]"}], StandardForm]

$\mathbb{D}_t$f[t]

f'[t]

You can use FullForm to check it:

$\mathbb{D}_t$f[t]//FullForm

Derivative[1][f][t]

For more details about Low-Level Input and Output Rules, pls read here.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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