Question: Do you know how to collect the terms in the same variable in this expression ?

From this expression I want to extract only terms with the variable x.

F := (1/2/Pi+Q*cos(k*x))^2*(1/2/Pi+Q*cos(k*y))/(1+beta^2*(1/2/Pi+Q*cos(k*x))^2);

 

I don't want to manually write it out rather extract the terms programmaticallly. I want to be left with

(1/2/Pi+Q*cos(k*x))^2 / (1+beta^2*(1/2/Pi+Q*cos(k*x))^2)

I have tried the collect fucntion but that did not seem to do it. Any suggestions as to what command, function or approach I could utilise to do this ?

Please Wait...