• solving sqrt(y)=x for

    From Nasser M. Abbasi@21:1/5 to All on Mon Jan 11 17:33:05 2021
    Should CAS solve

    sqrt(y)=x

    for y by giving solution as y=x^2 without saying this is valid only for x>=0 ?

    Only Maxima would ask the user if x was negative,positive or zero when
    solving this equation.

    Maple:
    =======
    eq:=sqrt(y)=x;
    PDEtools:-Solve(eq,y);
    y = x^2

    Mathematica:
    =============
    eq = Sqrt[y] == x;
    Solve[eq, y]
    {{y -> x^2}}

    Maxima
    =======
    (%i1) solve(sqrt(y)=x,y)
    Is x positive, negative or zero?
    positive
    2
    (%o1) [y = x ]

    Fricas
    ========
    solve(sqrt(y)=x,y)
    2
    (4) [y = x ]


    At school, if I wrote in the exam that the solution of
    sqrt(y)=x is y=x^2 without saying this is for x>=0, the
    teacher will take one or more point off.

    Why do then most CAS systems get away with it then? Is this just by convention then?

    --Nasser

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Albert Rich@21:1/5 to Nasser M. Abbasi on Tue Jan 12 00:51:01 2021
    On Monday, January 11, 2021 at 1:33:07 PM UTC-10, Nasser M. Abbasi wrote:
    Should CAS solve

    sqrt(y)=x

    for y by giving solution as y=x^2 without saying this is valid only for x>=0 ?

    Only Maxima would ask the user if x was negative,positive or zero when solving this equation.

    Maple:
    =======
    eq:=sqrt(y)=x;
    PDEtools:-Solve(eq,y);
    y = x^2

    Mathematica:
    =============
    eq = Sqrt[y] == x;
    Solve[eq, y]
    {{y -> x^2}}

    Maxima
    =======
    (%i1) solve(sqrt(y)=x,y)
    Is x positive, negative or zero?
    positive
    2
    (%o1) [y = x ]

    Fricas
    ========
    solve(sqrt(y)=x,y)
    2
    (4) [y = x ]


    At school, if I wrote in the exam that the solution of
    sqrt(y)=x is y=x^2 without saying this is for x>=0, the
    teacher will take one or more point off.

    Why do then most CAS systems get away with it then? Is this just by convention
    then?

    --Nasser

    Derive 6.10 returns y = if(x>0, x^2)

    Albert

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Albert Rich@21:1/5 to Nasser M. Abbasi on Tue Jan 12 00:45:54 2021
    On Monday, January 11, 2021 at 1:33:07 PM UTC-10, Nasser M. Abbasi wrote:
    Should CAS solve

    sqrt(y)=x

    for y by giving solution as y=x^2 without saying this is valid only for x>=0 ?

    Only Maxima would ask the user if x was negative,positive or zero when solving this equation.

    Maple:
    =======
    eq:=sqrt(y)=x;
    PDEtools:-Solve(eq,y);
    y = x^2

    Mathematica:
    =============
    eq = Sqrt[y] == x;
    Solve[eq, y]
    {{y -> x^2}}

    Maxima
    =======
    (%i1) solve(sqrt(y)=x,y)
    Is x positive, negative or zero?
    positive
    2
    (%o1) [y = x ]

    Fricas
    ========
    solve(sqrt(y)=x,y)
    2
    (4) [y = x ]


    At school, if I wrote in the exam that the solution of
    sqrt(y)=x is y=x^2 without saying this is for x>=0, the
    teacher will take one or more point off.

    Why do then most CAS systems get away with it then? Is this just by convention
    then?

    --Nasser

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From nobody@nowhere.invalid@21:1/5 to Albert Rich on Tue Jan 12 11:24:39 2021
    Albert Rich schrieb:

    On Monday, January 11, 2021 at 1:33:07 PM UTC-10, Nasser M. Abbasi wrote:
    Should CAS solve

    sqrt(y)=x

    for y by giving solution as y=x^2 without saying this is valid only
    for x>=0 ?

    Only Maxima would ask the user if x was negative,positive or zero
    when solving this equation.

    Maple:
    =======
    eq:=sqrt(y)=x;
    PDEtools:-Solve(eq,y);
    y = x^2

    Mathematica:
    =============
    eq = Sqrt[y] == x;
    Solve[eq, y]
    {{y -> x^2}}

    Maxima
    =======
    (%i1) solve(sqrt(y)=x,y)
    Is x positive, negative or zero?
    positive
    2
    (%o1) [y = x ]

    Fricas
    ========
    solve(sqrt(y)=x,y)
    2
    (4) [y = x ]


    At school, if I wrote in the exam that the solution of
    sqrt(y)=x is y=x^2 without saying this is for x>=0, the
    teacher will take one or more point off.

    Why do then most CAS systems get away with it then? Is this just by convention then?


    Derive 6.10 returns y = if(x>0, x^2)


    Surprisingly, the solution for x = 0 is excluded here. When x is
    restricted beforehand, however:

    x :epsilon Real [0, inf)

    SOLVE(SQRT(y) = x, y)

    y = x^2

    x :epsilon Real (-inf, 0]

    SOLVE(SQRT(y) = x, y)

    false

    x :epsilon Real [0, 0]

    SOLVE(SQRT(y) = x, y)

    y = 0

    then x = 0 is included in the first and last case, but is
    understandably not separated out in the second case. I suppose this
    implements what school teachers want.

    Martin.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From antispam@math.uni.wroc.pl@21:1/5 to Nasser M. Abbasi on Tue Jan 12 17:41:31 2021
    Nasser M. Abbasi <nma@12000.org> wrote:

    Should CAS solve

    sqrt(y)=x

    for y by giving solution as y=x^2 without saying this is valid only for x>=0 ?

    Only Maxima would ask the user if x was negative,positive or zero when solving this equation.

    Maple:
    =======
    eq:=sqrt(y)=x;
    PDEtools:-Solve(eq,y);
    y = x^2

    Mathematica:
    =============
    eq = Sqrt[y] == x;
    Solve[eq, y]
    {{y -> x^2}}

    Maxima
    =======
    (%i1) solve(sqrt(y)=x,y)
    Is x positive, negative or zero?
    positive
    2
    (%o1) [y = x ]

    Fricas
    ========
    solve(sqrt(y)=x,y)
    2
    (4) [y = x ]


    At school, if I wrote in the exam that the solution of
    sqrt(y)=x is y=x^2 without saying this is for x>=0, the
    teacher will take one or more point off.

    Why do then most CAS systems get away with it then? Is this just by convention
    then?

    When you solve for 'y' assumption (given) is that sqrt(y) = x.
    By any reasonable definition of square root you have than
    x^2 = y. The sitation is different when you solve for x,
    that is want to compute square root. Than you actually
    have equation to solve, namely equation x^2 = y.
    Quadratic equation in algebraicaly complete field have
    two solutions (counting double root (when y = 0) as two
    solution). You have than multiple conventions. One
    is that 'sqrt' represents one of solutions without
    saying which one. This is reasonable because by Galois
    theory there is no _algebraic_ way to distinguish
    solutions. In analysis we deal with functions and
    natural requirement is that we want continuous functions.
    Then convention is that root which makes your function
    continuous is correct one (this is also good convention
    when solving physical and technical problems). For
    holomorphic function this still leaves open which
    value to take at single point, but once you made
    choice at single point per connected component values
    in corresponding connected components are uniquely determined.
    In numerical computations routines are expected to return
    a number, so square root function must make a choice
    and usual convention is to take "principal value".
    However, this should be seen not as virtue, but
    as unavoidable limitation: numerical square root
    may be wrong for actual (say physical) problem
    that you are solving, and users may be forced to
    change root to correct one.

    Another problem is that you may work in something
    which is not algebraically closed, like real numbers.
    Then eqation y = x^2 is not solvable for x when
    y < 0. High school typically avoids talking
    about complex numbers and only uses real numbers.
    Hence square root of negative numbers is left
    undefined (treated as error). In real numbers
    there is algebraic distincion between root:
    for nonzero y one x is negative, other is positive.
    Positive numbers are defined in algebraic way,
    because nozero real number y is positive <=>
    equation y = x^2 is solvable for x. So in
    highs schools frequently use convention that
    square root is nonnegative (forcing choice of
    square root in this way). However, even
    if you start from real numbers you may get
    complex square roots in formulas and normally
    results obtained via complex numbers are
    valid. And complex way is easier than real
    one. Famous "casus irredutiblis" for equations
    of degree 3 nicely illustrates difficulties
    you have when you insist on staying within
    real numbers (there are 3 real solutions,
    but usual formulas produce complex numbers
    in intermediate steps).

    Anyway, in high school checking that x >= 0
    when solving sqrt(y) = x for y is really
    checking if your initial assumption is valid.
    Of course, it makes sense to do extra checks
    to verify that you made no mistake, but
    checking assumptions is normally not considered
    part of solution. Outside high school
    nonreal roots are useful, so actually there
    is no extra assumprion to check.

    --
    Waldek Hebisch

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Richard Fateman@21:1/5 to All on Sat Jan 16 13:04:43 2021

    The question is, what should a CAS provide as an answer.
    y=x^2 is, by common usage in CAS, incomplete or outright wrong.
    Consider sqrt(y)=-5 (that is, x=-5)
    y=25 would seem to be the specific "answer".

    Yet sqrt(25) is commonly held to be 5, not -5, and so the given
    answer does not satisfy the equation.

    If you view sqrt as multivalued, and sqrt(25) is therefore the
    set {-5,5}, then it is also false that the set {-5,5} is equal to
    5 (or the set {5} ).

    Maxima seems to be headed in the right direction, though perhaps the answer could
    be stated as some kind of conditional, if (x is real and x>=0 ) then y=x^2 else....

    The rule of thumb I was taught was that you can square (etc) both side of an equation at
    the risk of introducing extraneous solutions, and so they must be checked.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)