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$

closed as off-topic by m_goldberg, MarcoB, Alex Trounev, Daniel Lichtblau, José Antonio Díaz Navas Mar 28 at 19:23

This question appears to be off-topic. The users who voted to close gave this specific reason:

  • "This question arises due to a simple mistake such as a trivial syntax error, incorrect capitalization, spelling mistake, or other typographical error and is unlikely to help any future visitors, or else it is easily found in the documentation." – m_goldberg, MarcoB, Alex Trounev, Daniel Lichtblau, José Antonio Díaz Navas
If this question can be reworded to fit the rules in the help center, please edit the question.

  • 1
    $\begingroup$ Please do not use the bugs tag when posting a new question. See the tag description for why. $\endgroup$ – Szabolcs Mar 24 at 21:21
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.