question on factorization



hello Maxima users,

a question from a newby:
I define a function and take the derivative of it
wrt some variables. The result is horribly long
but it is the sum of many terms. If I examine those terms,
for each, some factorization could be done, but are not.
To simplify the problem, consider for instance:
f: y1*exp(x1)+y1*cos(x1)+(x1-x2)^2;
How come that Maxima do not put y1 as a common factor for exp(x1) and 
cos(x1) ?
How to tell Maxima to factorize as much as possible (assuming I do not 
know myself that
y1 is a common factor for the first two terms)  ?
If I use radcan, I get the result I want, but (x1-x2)^2 gets expanded,
something I would like to avoid.

thanks for any help,

regards,
Laurent