Nasser M. Abbasi <
[email protected]> 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)