I have a polynomial in two variables, e.g.
16384 k^4 - 20480 k^2 + x^4 - 320 k^2 x^2 - 128 x^2 + 4096
I'd like Mathematica to factor it as
$$(x^2 - f(k))(x^2 - g(k))$$
but Factor
does nothing. I assume that's because it's treating $k$ on an equal footing with $x$, but I'd like it to consider $k$ as a constant and just factor with respect to $x$.
I'm sure this has been asked before, but all related-looking questions seemed to have much more complicated answers, including things like the Root
function, the quartic formula, long Modules using Solve
, or Groebner bases. Surely there's a simple, one-line solution for my problem?
Simplify
and the optionComplexityFunction
. $\endgroup$poly2 = (x^2 - a) (x^2 - b) /. Solve[And @@ Thread[CoefficientList[poly, x] == CoefficientList[(x^2 - a) (x^2 - b), x]], {a, b}]
$\endgroup$