I want to separate a symbolic expression into two sub-expressions, one sub-expression with a certain variable and the other without the variable. For example, with the following function, f,
var('x,y')
f=cos(x)*(3*y+2)^2
I want to obtain two sub-expressions as
f1=cos(x)
f2=(3*y+2)^2