Differentiate conditional expressions?



Hi,

I'm trying to use Maxima for differentiation, but
don't know how to differentiate conditional expressions.
For example, in Mathematica I have such result:
In[1]:=D[Sin[x]*(If [x > 1, x, -x^2]), x]
Out[1]=Cos[x] If[x > 1, x, -x^2)] + If[x > 1, 1, -2 x] Sin[x]

and the same in Maxima fails with an error.
(%i1) diff(sin(x)*(if (x>1) then x else -x^2),x);
MACSYMA was unable to evaluate the predicate:
x > 1
 -- an error.  Quitting.  To debug this try DEBUGMODE(TRUE);

Is there any way to differentiate such expressions in Maxima?

Thanks in advance,
Michael