# Simplify power of KroneckerDelta

Why doesn't Mathematica simplify the following expression:

FullSimplify[KroneckerDelta[x,y]^3]


Since KroneckerDelta only returns 0 or 1 the ^3 could be simply ignored.

Don't employ the simplification rule suggested in another proposed answer, since it will yield incorrect answers in many cases:

FullSimplify[KroneckerDelta[x, y]^2 f[x, y]/KroneckerDelta[x, y]]


(* f[x, y] KroneckerDelta[x, y] *)

Correct.

But if you apply the rule proposed elsewhere,

rule = KroneckerDelta[x_, y_]^n_ /; n > 0 -> KroneckerDelta[x, y];


to the numerator and denomiator:

myg[x, y] = KroneckerDelta[x, y]^2 f[x, y];
myh[x, y] = KroneckerDelta[x, y];


as here,

mynewg[x, y] = myg[x, y] /. rule;
mynewh[x, y] = myh[x, y] /. rule;


then the original term becomes

FullSimplify[mynewg[x, y]/mynewh[x, y]]


(* f[x, y] *)

Incorrect.

In short: leave the powers of the KroneckerDelta unaltered.

• You should not apply the rule before the end of operation. rule = KroneckerDelta[x_, y_]^n_ /; n > 0 -> KroneckerDelta[x, y]; myg[x, y] = KroneckerDelta[x, y]^2 f[x, y]; myh[x, y] = KroneckerDelta[x, y]; myg[x, y]/myh[x, y] /. rule yields f[x, y] KroneckerDelta[x, y] correct. – Alexei Boulbitch Jan 16 '15 at 8:53

One method is to use the fact that KroneckerDelta is idempotent, so include this as an assumption to FullSimplify:

FullSimplify[
KroneckerDelta[x,y]^3,
KroneckerDelta[x,y]==KroneckerDelta[x,y]^2
]


KroneckerDelta[x, y]

Yes, it does not. If you need to actually simplify some expressions containing powers of Kroneker deltas you might want to use this rule:

rule = KroneckerDelta[x_, y_]^n_ /; n > 0 -> KroneckerDelta[x, y];


acting as follows:

    KroneckerDelta[a, b]^3 /. rule

(*   KroneckerDelta[a, b]   *)


Have fun!