In this case the following works:
%%% (217) -> )type on
%%% (217) -> foo := integrate(x*tan(x)^4, x = 0..%pi/4,"noPole")
2
64 log(2) + 3 %pi - 16 %pi - 16
(217) --------------------------------
96
Type: Union(f1: OrderedCompletion(Expression(Integer)),...)
%%% (218) -> foo::Expression(Fraction Integer)
2 1 2 1 1
(218) - log(2) + -- %pi - - %pi - -
3 32 6 6
Type: Expression(Fraction(Integer))
In general, I think, it is not that easy.
Ralf