On Wed, Jun 18, 2014 at 2:34 AM,  <[email protected]> wrote:
> This has been brought up many times before, but I'd like to bring up
> the possibility of adding two commands to Sage: cuberoot(x) and
> nthroot(x, n)
>


Just to be clear, if you defined nthroot in the obvious way, the code would
check for each evaluation if n is an integer, then if even or odd, right?
Wouldn't that slow down a plot compared to what you have below?


> The reason is that currently plot( x^(1/3), -5, 5) only shows values for
> x>0,
> and not for x<0. The current work-around recommended is
>
> plot(sign(x)*abs(x)^(1/3), -5, 5)
> (Track ticket #11458)
>
> which replaced the hideous
>
> plot(lambda x: RR(x).nth_root(3), -5, 5, plot_points=20)
>
> This is true in classes like Precalculus and Calculus 1, where trying to
> explain
> workarounds like these would just really a headache for the instructor and
> extremely fragile students.
>
> Also the cube root can occur in many other situations and applications.
> This is urgent, because my textbook "Sage for Undergraduates" is due
> at the American Mathematical Society on June 30th.
>
> The namespace is so huge, can't we just add two more commands?
>
> I suggest:
>
> def cuberoot(x):
>     return sign(x)*((x*sign(x))^(1/3))
>
> Last but not least, links to previous demands for exactly this problem:
>
> https://www.mail-archive.com/[email protected]/msg11563.html
> https://groups.google.com/forum/#!msg/sage-devel/_JeSMD-Kvfk/xeNstGrcvXQJ
> https://groups.google.com/forum/#!topic/sage-support/icZ8ekC_P4Y
> https://groups.google.com/forum/#!topic/sage-devel/_JeSMD-Kvfk
> http://trac.sagemath.org/ticket/11458
> https://sage.uwstout.edu/home/pub/32/
> https://groups.google.com/forum/#!topic/sage-support/ZtRWScqMHMM
> https://groups.google.com/forum/#!topic/sage-devel/_JeSMD-Kvfk
>
> --
> You received this message because you are subscribed to the Google Groups
> "sage-edu" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to [email protected].
> To post to this group, send email to [email protected].
> Visit this group at http://groups.google.com/group/sage-edu.
> For more options, visit https://groups.google.com/d/optout.

-- 
You received this message because you are subscribed to the Google Groups 
"sage-edu" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/sage-edu.
For more options, visit https://groups.google.com/d/optout.

Reply via email to