sqrt(x)*sqrt(x)



Yes, I agree with you Michel, and Prof. Fateman.

This is a very interesting and useful thread. I'm glad things have calmed 
down a little.  It all begs the question, "What is a function"!

The usual modern definition of a function $f$ is a rule, which takes each 
element of the domain $X$, and assigns a unique element in the range $Y$.

It is perhaps surprising to learn that this particular definition of 
function is a relatively recent innovation.  Even more interesting I would 
argue that some older notions might still have a place in the design of a 
CAS, (or any other *mathematical* software which needs functions).  Just 
over one hundred years G. H. Hardy, in his "Pure Mathematics", made the 
following remarks about functions.

"We must point out that the simple examples of functions mentioned above 
possess three characteristics which are by no means involved in the 
general idea of a function, viz:
  * $y$ is determined for every value of $x$;
  * to each value of $x$ for which $y$ is given corresponds
    one and only one value of $y$;
  * the relation between $x$ and $y$ is expressed by means
       of an analytical formula.
[...] All that is essential is that there should be some relation between 
$x$ and $y$ such that to some values of $x$ at any rate correspond values 
of $y$."

Hardy then goes on to give a number of further examples to illustrate 
these ideas which can be broadly separated into two groups.  Firstly are 
those which involve a formula, equation or algebraic expression in $x$ and 
$y$. This might include an infinite sum such as a series.  Maxima, being a 
CAS concentrates on these kinds of functions.

The second class of examples of functions given by Hardy are when the 
relationship between $x$ and $y$ follow from some geometrical 
construction.

Even further back Leonhard Euler makes the same distinction in the two 
volumes of Introduction to Analysis of the Infinite.

     "\S4.  A function of a variable quantity is an analytic
     expression composed in any way whatsoever of the variable
     quantity and numbers or constant quantities.  Hence every
     analytic expression, in which all component quantities except
     the variable $z$ are constants, will be a function of that $z$;
     thus $a+3z$; $az-4z^2$; $az+\sqrt{a^2-z^2}$; $c^z$; etc.~are
     functions of $z$.  (Vol 1)"

It is important to realize in connection with this statement that the 
*same algebraic expression* represents the function.  For example, if we 
think about $y=x^3$ again, for Euler, this is as much a function of $y$ as 
it is a function of $x$.  It all depends on how you are thinking about it 
at any moment.  This is quite neat, and avoids the sqrt(x)^2 discussion we 
are having.

A result of this is that functions can be multiple valued: "\S10. Finally 
we make a distinction between single-valued and multiple-valued 
functions." In particular, Euler gives $\sqrt{2z+z^2}$ as an example of a 
two-valued function.

"Whatever value is assigned to $z$, the expression $\sqrt{2z+z^2}$ has a 
twofold significance, either positive or negative."

If we look at the next volume there is quite a different notion.

   "\S6 Thus any function of $x$ is translated into geometry and determines a
   line, either straight or curved, whose nature is dependent on the
   nature of the function. [...] a curve can define a function. (Vol 2)"

But Euler really means *implicit* functions which are *MULTIVALUED*! Quite 
different from the Weierstrass modern single-valued version we have now. 
"\S16.  If $y$ is any kind of function of $z$, then likewise, $z$ will be 
a function of $y$."

I think that implicit functions really should have a stronger place, 
especially with modern techniques like Grobner bases. Enough of history! 
Furthermore, in my view, education has a lot to answer for with the damage 
done when people have to "unlearn" the square root algebra trick later.

Chris