Question: How to take off a term in XY

I want to remove the term XY
f:=(x,y)->2*x²+xy+y²+4x-y-2=0;
eq := simplify(subs(x = X-9/7, y = Y+8/7, f(x, y)));
theta:=Pi/8;
ex := simplify(subs(X = cos(theta)*X-sin(theta)*Y, Y = sin(theta)*X+cos(theta)*Y, eq)); evalf(%);
How to obtain (3+sqrt(2))/2*X²+(3-sqrt(2))/2=36 ? Thank you.

 

Please Wait...