I would like to use FactorTerms
to factor out constant numerical terms out of an expression, this works as follows:
2 x^2 + 2 y^2 + 4 x y // FactorTerms
(* = 2 (x^2 + 2 x y + y^2) *)
However, this doesn't seem to work if there are square roots:
Sqrt[2] x^2 + Sqrt[2] y^2 + 2 Sqrt[2] x y // FactorTerms
(* = Sqrt[2] x^2 + 2 Sqrt[2] x y + Sqrt[2] y^2 *)
I'm not sure whether that's the way it's supposed to behave or a bug. If that's the desired behaviour, then what is the correct way of factoring out constant numerical terms containing square roots?
$Version
gives 11.2.0 for Mac OS X x86 (64-bit) (September 11, 2017).