`cost of evaluated part of integral:`, 1,
cost(parts[_k_]) );
if _k_ > 0 then
debug_print( procname, `simplifying...`, 1 );
parts[_k_] := collect(parts[_k_],[sin,cos],factor);
debug_print( procname,
`cost of evaluated part of integral:`, 1,
cost(parts[_k_]) );
fi;
debug_print( procname,
`evaluated part of integral is stored in parts[`._k_.`]`, 0 );
# select the remainder integral
remdr := select( has, q, Int );
debug_print(procname,`new integral expression:`,3,remdr);
# now we want to simplify the new (and messy) integrand
# grab the integral and store in H
if type( remdr, function ) and op(0,remdr)=Int then
H := remdr;
locI := [];
else
H := select( has, remdr, Int );
locI := location( remdr, H );
fi;
debug_print(procname,
`location of integral in integral expression: `,3,locI);
# get the integrand and store in K
K := op(1,H);
debug_print(procname,`full integrand:`,3,K);
# grab the new polynomial part and store in p
q := remove( has, %, {sin,cos} );
if type(q,`+`) then
p := q;
else
for p in q do
if type(p,`+`) then
break;
fi;
od:
fi;
if not has(p,{s,g}) then
locp := location( K, p );
debug_print(procname,`new polynomial factor p:`,1,p);
debug_print(procname,`location of p in integrand: `,2,locp);
debug_print(procname,`full non-sin/cos term: `,1,q);
else
locp := [];
debug_print(procname,`no new polynomial factor!`,1);
fi;
# sub for the new polynomial part of the
# integrand, simplify the trig part, then sub back
debug_print(procname,`cost of new integrand:`,1,cost(K));
debug_print( procname,
`simplifying sin/cos part of new integrand...`, 0 );
Page 8