I want D[Subscript[a, k],Subscript[a,j]]
to return something like the Kronecker delta. Is this possible?
1 Answer
Of course, if you don't instist on logical correctness.
Subscript /: D[Subscript[a_, b_], Subscript[a_, c_]] :=
KroneckerDelta[b, c]
Subscript /: D[ Subscript[a_, _], Subscript[b_, _]] := 0 /; a != b
D[ Subscript[a,k], Subscript[a,j]]
Subscript[\[Delta], j,k]
D[ Subscript[a,k], Subscript[1,k]]
0
-
1$\begingroup$ I am not sure why
Subscript[\[Delta], j,k]
appears in the code $\endgroup$ May 19 at 20:37 -
$\begingroup$ Probably you are able to Trace the answer easily. Evaluation algorithm produces terms Derivatives[1,0][Subscript] and Derivative[0,1][Subscript] . The rest is printers professional secret. $\endgroup$– Roland FMay 20 at 4:56
-
$\begingroup$ I think I might have understood what you did to get the
Subscript[\[Delta], j,k]
. Maybe you used copy as then selected plain text rather than directly copy which would showKroneckerDelta[j, k]
. $\endgroup$ May 20 at 7:03