|
From: David S. <tom...@us...> - 2026-10-25 08:54:11
|
- **status**: open --> closed - **Comment**: Fixed by commit [ddfef2]. --- **[bugs:#5613] rectform, polarform and carg disagree with \(-8\)^\(1/3\) = -2 under domain : real** **Status:** closed **Group:** None **Labels:** rectform polarform carg domain real **Created:** Tue Sep 29, 2026 11:07 AM UTC by David Scherfgen **Last Updated:** Tue Sep 29, 2026 11:08 AM UTC **Owner:** nobody With the default `domain : real`, the simplifier takes the real root for an odd root of a negative number, so `(-8)^(1/3)` simplifies to `-2`, and `sign` agrees. `rectform`, `realpart`, `imagpart`, `polarform` and `carg` take the principal branch instead, so substituting before or after them gives different results. `conjugate` doesn't simplify such a power at all, although it is real: ``` (%i1) display2d:false$ (%i2) rectform(x^(1/3)); (%o2) %i*sin(atan2(0,x)/3)*abs(x)^(1/3)+cos(atan2(0,x)/3)*abs(x)^(1/3) (%i3) subst(x = -8,%); (%o3) sqrt(3)*%i+1 (%i4) rectform(subst(x = -8,x^(1/3))); (%o4) -2 (%i5) carg(x^(1/3)); (%o5) atan2(0,x)/3 (%i6) subst(x = -8,%); (%o6) %pi/3 (%i7) polarform(x^(1/3)); (%o7) %e^((%i*atan2(0,x))/3)*abs(x)^(1/3) (%i8) subst(x = -8,%); (%o8) 2*((sqrt(3)*%i)/2+1/2) (%i9) conjugate(x^(1/3)); (%o9) conjugate(x^(1/3)) ``` For a base known to be negative, `rectform` and `polarform` contradict `sign`, and `carg` contradicts `polarform`: ``` (%i10) assume(y < 0)$ (%i11) sign(y^(1/3)); (%o11) neg (%i12) rectform(y^(1/3)); (%o12) (sqrt(3)*%i*(-y)^(1/3))/2+(-y)^(1/3)/2 (%i13) imagpart(y^(1/3)); (%o13) (sqrt(3)*(-y)^(1/3))/2 (%i14) carg(y^(1/3)); (%o14) %pi (%i15) polarform(y^(1/3)); (%o15) %e^((%i*%pi)/3)*(-y)^(1/3) (%i16) conjugate(y^(1/3)); (%o16) conjugate(y^(1/3)) ``` Under `domain : real`, these functions should treat an odd root of a real base as the real root, like the simplifier and `sign` do. With `domain : complex`, the principal branch is correct. --- Sent from sourceforge.net because max...@li... is subscribed to https://sourceforge.net/p/maxima/bugs/ To unsubscribe from further messages, a project admin can change settings at https://sourceforge.net/p/maxima/admin/bugs/options. Or, if this is a mailing list, you can unsubscribe from the mailing list. |