Py point was that sqrt (or, more generally [image: 
\displaystyle{x^{\frac{k}{p}}},\ k,p\in\mathbb{N}^+]) is/are *multivalued* 
functions, and that neither Sage's solver nor the various solvers in 
Maxoma, Giac,Fricas and Mathematica account for this. In my example; 
`x:->sqrt(x)+x^(1/3)+2`  is a 6-valued function of `x`, and the solvers 
solve only for one *unspecified (!)* of them.

A *convention* exists that privilegies the positive square root of positive 
real numbers and sometimes the real root of of real numbers of the same 
sign as the argument, but this convention has no mathematical foundation 
defensible outside of high school (and not even then when high-schoolers 
discover complexes and the so-called Cardan solution to the quadrinomial…).

I was thinking that a discussion of this problem might be in order in the 
Sage reference manual, and wonder what is the advice of Sage users and 
developers, which are much more mathematically educated than I am.

BTW, the same thing could be said of log, whose extension to [image: 
\mathbb{C}] is done by analytic continuation, and therefore makes it 
multivalued. But in this case, there is no obvious conflict with 
polynomials… and the users of log of complexes are usually already aware of 
it.
​
Le samedi 6 mai 2023 à 14:13:16 UTC+2, Oscar Benjamin a écrit :

> In the notebook you note that the results returned by sympy "do not 
> check". I suspect this is because sympy's solve function is being called 
> with check=False under the hood:
>
> In [43]: x = symbols('x')
>
> In [44]: eq = sqrt(x) + cbrt(x) + 2
>
> In [45]: print(solve([eq], [x]))
> []
>
> In [46]: print(solve([eq], [x], check=False))
> [((1 + (3*sqrt(87) + 28)**(1/3) + (3*sqrt(87) + 
> 28)**(2/3))**6/(729*(3*sqrt(87) + 28)**2),), ((-4 + (1 - sqrt(3)*I)*(2 - (1 
> - sqrt(3)*I)*(3*sqrt(87) + 28)**(1/3))*(3*sqrt(87) + 
> 28)**(1/3))**6/(46656*(1 - sqrt(3)*I)**6*(3*sqrt(87) + 28)**2),), ((-4 + (1 
> + sqrt(3)*I)*(2 - (1 + sqrt(3)*I)*(3*sqrt(87) + 28)**(1/3))*(3*sqrt(87) + 
> 28)**(1/3))**6/(46656*(1 + sqrt(3)*I)**6*(3*sqrt(87) + 28)**2),)]
>
> With radical equations like this sympy's solve will transform them to 
> polynomial equations and compute all solutions to the polynomial equations. 
> Transforming to polynomials introduces spurious solutions so solve then 
> checks to see which of the solutions satisfy the original radical 
> equations. Passing check=False means that the checking is disabled and so 
> you get all solutions to the polynomial equation which may or may not be 
> solutions to the radical equation.
>
> --
> Oscar
>
>
> On Sat, 6 May 2023 at 10:28, Emmanuel Charpentier <emanuel.c...@gmail.com> 
> wrote:
>
>> *Typo* in the preceding message : The polynomial system is of course 
>> |x2^2-x1, 
>> x3^3-x1, x2+x3+2]
>>
>> Sorry for the noise !
>> ​
>> Le samedi 6 mai 2023 à 11:25:07 UTC+2, Emmanuel Charpentier a écrit :
>>
>>> TLDR : Sage easily gets the roots of the polynomial system |x2^2-x1, 
>>> x3^4-x1, x2+x3+2] but interprets [image: \sqrt[3]{x}+\sqrt{x}+2] 
>>> inconsistently : this expression is *not* zero for the above roots.
>>>
>>> Details : see the enclosed Jupyter Lab sheet.
>>>
>>> This seems to be little discussed in Sage documentation. Is it worth to 
>>> discuss it ?
>>> ​
>>>
>> -- 
>> You received this message because you are subscribed to the Google Groups 
>> "sage-devel" group.
>> To unsubscribe from this group and stop receiving emails from it, send an 
>> email to sage-devel+...@googlegroups.com.
>> To view this discussion on the web visit 
>> https://groups.google.com/d/msgid/sage-devel/dc5d995c-e76c-4e5b-89f9-beb640a1b9e8n%40googlegroups.com
>>  
>> <https://groups.google.com/d/msgid/sage-devel/dc5d995c-e76c-4e5b-89f9-beb640a1b9e8n%40googlegroups.com?utm_medium=email&utm_source=footer>
>> .
>>
>

-- 
You received this message because you are subscribed to the Google Groups 
"sage-devel" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sage-devel+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/sage-devel/dd4ce586-5abb-4e28-8e4f-68ae80f123e2n%40googlegroups.com.

Reply via email to