Question: How do I get this to factor?

I chased down a problem to factoring a square that has sqrt in the coefficients. All numbers are real,
The code is inside a procedure in a package. Iso I could do with something robust.

expand((sqrt(A+B)*x+sqrt(7-K)*y)^2)
     2      2            (1/2)          (1/2)        2      2
  A x  + B x  + 2 (A + B)      x (7 - K)      y - K y  + 7 y 

factor(%) 

 

Please Wait...