# Question:How to order with respect to functions AND derivatives

## Question:How to order with respect to functions AND derivatives

Maple

Good mornig,

I've this expression

diff(Q(theta, `&varphi;`), `&varphi;`, `&varphi;`)+diff(S(theta, `&varphi;`), `&varphi;`, `&varphi;`)+(diff(S(theta, `&varphi;`), theta)+diff(Q(theta, `&varphi;`), theta))*cos(theta)*sin(theta)+(4*M*G*k*(diff(Q(theta, `&varphi;`), theta, theta))-4*M*G*k*S(theta, `&varphi;`)+4*M*G*k*Q(theta, `&varphi;`)-4*M*G*k*(diff(S(theta, `&varphi;`), theta, theta))-(diff(S(theta, `&varphi;`), theta, theta))-(diff(Q(theta, `&varphi;`), theta, theta)))*sin(theta)^2

And I would order the factors in order to have all the factors with S(theta,phi) after (or before) ALL the factors with Q(theta,phi).

I've tried with sort(..., Q(theta,phi)) but this seems not work on the derivative like diff(Q(...),theta)

So, there is a metod to obtein this ordering? Or (better) to print this expression like two differential operator acting on S and Q?

Thank you

S.

﻿