# [Maxima] ratsimp bad, rectform good

Richard Fateman fateman at cs.berkeley.edu
Tue May 19 20:05:11 CDT 2009

```May be related to your starting expression being ambiguous. There are 6
values for (-1)^(1/6).
There are as many as 36 values for the expression.  (Though probably
fewer distinct ones).

Edwin Woollett wrote:
> I have checked this by hand. rectform(y10) gives the
> correct result with  (-1)^(1/6) = cos(%pi)^(1/6) =
> %i/2+sqrt(3)/2  = (%i + sqrt(3)/2.
>
> (%i89) display2d:false\$
>
> here is the starting expression
>
> (%i90) y10;
> (%o90) sqrt(2)*( sqrt(3)*%i / 2 - 1/2 )/( 2*(-1)^(1/6) )
>         +(-1)^(1/6)*(-sqrt(3)*%i / 2 - 1/2 ) / sqrt(2)
>
> (%i91) y10re : rectform(y10);
> (%o91) 0
>
> (%i92) y10ra : ratsimp(y10);
> (%o92) sqrt(3)*%i/((-1)^(1/6)*sqrt(2))
>
> (%i93) realpart(y10ra);
> (%o93) sqrt(3)/(2*sqrt(2))
>
> (%i94) imagpart(y10ra);
> (%o94) 3/(2*sqrt(2))
>
> (%i95) rectform(y10ra);
> (%o95) 3*%i/(2*sqrt(2))+sqrt(3)/(2*sqrt(2))
>
> so ratsimp returns nonzero answer which has
> both a real and imaginary part.
>
> If we simply use our replacement for
> ( -1 )^(1/6) in y10, automatic simplification
> gives zero:
>
> (%i96) z : rectform( (-1)^(1/6) );
> (%o96) %i/2+sqrt(3)/2
>
> (%i97) ratsubst(z,(-1)^(1/6),y10);
> (%o97) 0
>
> -------------
> So what am I doing wrong?
>
> Ted Woollett
> win xp, 5.18.1
>
> _______________________________________________
> Maxima mailing list
> Maxima at math.utexas.edu
> http://www.math.utexas.edu/mailman/listinfo/maxima
>

```