# Question:How to define an ordering on partial derivatives?

## Question:How to define an ordering on partial derivatives?

Maple

Notional example:
I use mtaylor compute the Taylor expansion of a function f (U) of several variables U1, .., UN.
In the resul the terms are ordered this way:

• the leftmost term is f (P) where P denotes the point where the expansion is done
• followed by a succession of terms :
• firstly ranked according to the total order of derivation of  f.
• and among terms of same derivation order, ranked in some kind of lexicographic order

For instance

 > Vars    := [seq(U[i], i=1..2)]: AtPoint := [seq(P[i], i=1..2)]: mt      := mtaylor(f(Vars[]), Vars =~ AtPoint, 3)

 (1)
 > map(t -> op([0, 0], select(has, [op(t)], D)[]), [op(mt)][2..-1])
 (2)

How could I define another ordering of the terms in this mtaylor expansion?
For instance 1 being identified to some letter and 2 to another one such that 1 <  2 a lexicographic order would be

`D[1], D[1, 1], D[1, 2], D[2], D[2, 2]`