# Forcing particular notation for derivatives

I was wondering if it is possible to force particular style of displaying derivatives in Mathematica.

For example if I type: $$AB\partial_\mu C[\mu]$$

After execution it automatically be displayed as: $$ABC'(\mu)$$

I would prefer to have my derivatives with $\partial_\mu$ symbol for reasons. Is this possible?

Edit: Thanks for the reply Carl Woll. Such terms you written will never appear. What I want is to aesthetically have terms like $A^\mu\partial_\mu B$ and not $A^\mu B'$. Former case means something to me while the latter case requires one mental step to convert $'$ to derivative.

• What do you want $AB\partial_\mu C[\mu + \nu]$ to look like? Dec 1, 2017 at 21:39

One possibility is to modify the formatting for Derivative:

Derivative /: MakeBoxes[c'[x_], StandardForm] := MakeBoxes[D[c[x], x]] If you would rather have c instead of c[μ], you could modify the above:

Derivative /: MakeBoxes[Derivative[c_][x_], StandardForm] := With[
{boxes = MakeBoxes[D[c, x]]},
InterpretationBox[boxes, Derivative[c][x]]
]


(Here I use an InterpretationBox so that the output is copy/pasteable.) Then: However, in both cases, if the argument to c is not an index, then problems arise. For example: Here is an alternative that doesn't require that you give arguments:

MakeBoxes[Dt[c_,x__], StandardForm] := With[{boxes = MakeBoxes[D[c,x]]},
InterpretationBox[boxes, Dt[c,x]]
]


Then: (Note that the use of DifferentialD above has the alias Esc d d Esc) A few more examples: 