0
$\begingroup$

I'm using version 11.3

Expand[(Sqrt[2] - t)^2]
2 - 2 Sqrt[2] t + t^2,

but

Factor[2 - 2 Sqrt[2] t + t^2]
2 - 2 Sqrt[2] t + t^2. 

On the other hand, without the $\sqrt{2}$ the expression is factored as expected.

Factor[1 - 2  t + t^2]
(-1 + t)^2
$\endgroup$
1
  • 1
    $\begingroup$ Please do not use the bugs tag when posting a new question. See the tag description for why. $\endgroup$
    – Szabolcs
    Mar 24, 2019 at 21:21

2 Answers 2

7
$\begingroup$

If you want irrational coefficients, you need to tell it which numbers to use as an extension of the rationals.

Factor[2 - 2 Sqrt[2] t + t^2, Extension -> {Sqrt[2]}]
(* (Sqrt[2] - t)^2 *)
$\endgroup$
1
$\begingroup$

If you do not know what extension to use with Factor

expr = 2 - 2 Sqrt[2] t + t^2;
expr2 = (a + b*t)^2;

sol = expr2 /. Solve[Thread[CoefficientList[expr, t] ==
     CoefficientList[expr2, t]], {a, b}]

(* {(-Sqrt[2] + t)^2, (Sqrt[2] - t)^2} *)

expr == sol // Thread // Simplify

(* {True, True} *)
$\endgroup$

Not the answer you're looking for? Browse other questions tagged or ask your own question.