Chouette

20 Reputation

3 Badges

6 years, 98 days

MaplePrimes Activity


These are replies submitted by Chouette

@Kitonum I just realized that both rationalize(simplify(...)) and Algebraic[Normal](...) may fail to put products of radicals into a canonical form:

rationalize(simplify(sqrt(3)*sqrt(2)));
rationalize(simplify(sqrt(6)));
{%} intersect {%%};

Algebraic[Normal](sqrt(3)*sqrt(2));
Algebraic[Normal](sqrt(6));
{%} intersect {%%};

Both intersections are empty.

Maybe one has to pass through the minimal polynomial (with rational coefficients) of the algebraic numbers if one really wants a bullet-proof solution to this problem...

@acer Thank you for submitting the bug report. By the way, what is the right way to do it? Do you just fill this form?

@Kitonum Thanks for the workarounds! They work great. However for more general equations, some caution is needed for the second workaround, because the same algebraic number can be expressed in two different forms in Sol1 and Sol2, and intersect will not recognize this. It can be quite tricky to turn the two different expressions into the same form, as in the following example.

Sol1 := {solve( R^2-sqrt(2)*R-1 )};
Sol1_simplify := simplify(Sol1);
Sol1_normal   := Algebraic[Normal](Sol1);

Sol2 := {solve( (sqrt(3)+1)*R^2 = sqrt(3)-1 )};
Sol2_simplify := simplify(Sol2);
Sol2_normal   := Algebraic[Normal](Sol2);

Sol1 intersect Sol2;
Sol1_simplify intersect Sol2_simplify;
Sol1_normal intersect Sol2_normal;

The first two intersections are empty, and the last is not.

@Carl Love

Thanks for the suggestion on the relation between sovle and eliminate. Another observation is that, for polynomial equations, solve seems to mess up only when the coefficients are not (real) rational:

[solve({x^2=4,x^3=8})];
[solve({x^4=4,x^6=8},explicit=true)];
[solve({x^2=Pi^2,x^3=Pi^3},explicit=true)];

work just fine, but

[solve({x^2=2,x^3=sqrt(8)})];
[solve({x^2=-1,x^3=I})];
[solve({x^4=2,x^6=sqrt(8)},explicit=true)];
[solve({x^2=Pi,x^3=Pi^(3/2)},explicit=true)];

fail to find any solutions.
Ultimately, we should probably just look into the code of solve (which is indeed very long...) to track down the origin of the problem. But that's for another day ;-)  (when I have some hours to kill)

Page 1 of 1