[Maxima] I want to tell maxima (-1)^0.33333333333333=-1, what should i do?

Martin Schönecker ms_usenet at gmx.de
Wed Feb 18 03:57:10 CST 2009


> (%i70) (-5)^(1/3),numer;
> (%o70) 1.709975946676697*(-1)^0.33333333333333
> 
> OR
> 
> I want to plot2d for f(x) between (-1,0)
> (%i98) f(x);
> (%o98) 
> (sqrt(-16*x^4-16*x^3+20*x^2+12*x+23)/(6*sqrt(3))+(16*x^3-12*x^2-6*x-25)/54)^(1/3)

wxMaxima 0.8.1 http://wxmaxima.sourceforge.net
Maxima 5.17.1 http://maxima.sourceforge.net
Using Lisp GNU Common Lisp (GCL) GCL 2.6.8 (aka GCL)
Distributed under the GNU Public License. See the file COPYING.
Dedicated to the memory of William Schelter.
The function bug_report() provides bug reporting information.
(%i11) kill(all);
(%o0) done
(%i1) /* No problem for the first example: */
(-5)^(1/3);
%, numer;
(%o1) -5^(1/3)
(%o2) -1.709975946676697
(%i3) 
f(x):=(sqrt(-16*x^4-16*x^3+20*x^2+12*x+23)/(6*sqrt(3))+(16*x^3-12*x^2-6*x-25)/54)^(1/3)$
(%i4) /* plot2d(f(x),[x,-1,0]); */
" This indeed does not work, why? "$
(%i5) linspace(a,b,n) := makelist(a+(i-1)*(b-a)/(n-1), i,1,n)$
(%i6) /* you could evaluate the function at discrete points and plot the 
resulting vectors */
xvec: linspace(-1,0,10)$
yvec: float(map(f, xvec))$
(%i8) pairs(l1,l2) := args(transpose(addrow(matrix(), xvec, yvec)))$
(%i9) xy: pairs(xvec,yvec)$
(%i10) plot2d([discrete, xy]);
(%o10)



More information about the Maxima mailing list