How to create MAX integrate rule?



Hi, maxima experts,

Is sombody know how to prepare a rule to integrate functions with MAX(.,.)?
I try to proceed as follows, but fail. What is needed, can be seen from 
line (D39), below.
E.g., instead of (D45), I would like to have something like this:

                             ta
                            /
                            [
(D45)                       I  (ta - x1) dx1
                            ]
                            /
                             0


Thanks,
--
Alexander


P.S. The MAXIMA-5.9.0 was compiled with clisp-2.27 recently (I'm beginner)


/*******BEGIN MAXIMA********/
(C39) disprule(IntMax);
(D39) IntMax : INTEGRATE(MAX(ta - x1, 0), x1, 0, A) -> 

BLOCK(IF A >= ta THEN RETURN(INTEGRATE(ta - x1, x1, 0, ta))

 ELSE RETURN(INTEGRATE(ta - x1, x1, 0, A)))
(C40) apply2(IntMax,INTEGRATE(MAX(ta-x1,0),x1,0,A));
Improper name or value in functional position:
ERREXP1
 -- an error.  Quitting.  To debug this try DEBUGMODE(TRUE);)
(C41) apply1(IntMax,INTEGRATE(MAX(ta-x1,0),x1,0,A));
Improper name or value in functional position:
ERREXP1
 -- an error.  Quitting.  To debug this try DEBUGMODE(TRUE);)
(C42) tellsimp(INTEGRATE(MAX(ta - x1, 0), x1, 0, A),BLOCK(IF A >= ta THEN RETURN(INTEGRATE(ta - x1, x1, 0, ta))));
(D42)                       [INTEGRATERULE1, FALSE]
(C43) testF(ta,A):=INTEGRATE(MAX(ta - x1, 0), x1, 0, A);
(D43)        testF(ta, A) := INTEGRATE(MAX(ta - x1, 0), x1, 0, A)
(C44) assume(A>=ta);
(D44)                              [A >= ta]
(C45) testF(ta,A);
                             A
                            /
                            [
(D45)                       I  MAX(ta - x1, 0) dx1
                            ]
                            /
                             0
(C46) apply1(IntMax,d45);
D45 not found
 -- an error.  Quitting.  To debug this try DEBUGMODE(TRUE);)
(C47) facts(ta,A);
FACTS takes zero or one argument only.
 -- an error.  Quitting.  To debug this try DEBUGMODE(TRUE);)
(C48) facts(ta);
(D48)              [KIND(ta, REAL), ta > 0, t > ta, A >= ta]
/*********END MAXIMA*******/