rtoy / maxima

A Clone of Maxima's repo
Other
0 stars 0 forks source link

How does solve treat (-1)^(1/3)? #604

Open rtoy opened 4 months ago

rtoy commented 4 months ago

Imported from SourceForge on 2024-07-03 02:07:51 Created by macrakis on 2017-07-06 20:53:33 Original: https://sourceforge.net/p/maxima/bugs/3317


%solve(x^(1/3) = -1) => %union(), regardless of the setting of domain.

Not -1? Is this working as intended?

Maxima version: "5.38.0" Maxima build date: "2016-04-03 08:56:53" Host type: "x86_64-apple-darwin15.4.0" Lisp implementation type: "SBCL" Lisp implementation version: "1.2.10"

rtoy commented 4 months ago

Imported from SourceForge on 2024-07-03 02:07:52 Created by willisbl on 2017-07-06 21:57:41 Original: https://sourceforge.net/p/maxima/bugs/3317/#30d3


Generally, to_poly_solve makes the negative real axis a branch cut for fractional powers--this behavior isn't controlled by the setting of domain. That makes the range of the cube root the set {z in C | -pi/3 < ph(z) <= pi/3}.

This isn't, I think, what many users want or expect (or even understand all that well). And maybe that makes it a bug.

--Barton


From: Stavros Macrakis macrakis@users.sf.net Sent: Thursday, July 6, 2017 3:53:34 PM To: Ticket 3317 Subject: [maxima:bugs] #3317 How does solve treat (-1)^(1/3)?


[bugs:#3317]https://urldefense.proofpoint.com/v2/url?u=https-3A__sourceforge.net_p_maxima_bugs_3317_&d=DwMCAg&c=9ZQuuHhOefNvAzlN-3viIA&r=Y-7rxY5GkJ0PrHulpV2qSA&m=-IlfmHN2ibi8CQ15WaEF5NUfubAHBgsR-4lfo48B9Rk&s=KLAYtH8ntf5M-b34RlOZ6auzUYhrxThvy8_gBbDI8ks&e= How does solve treat (-1)^(1/3)?

Status: open Group: None Created: Thu Jul 06, 2017 08:53 PM UTC by Stavros Macrakis Last Updated: Thu Jul 06, 2017 08:53 PM UTC Owner: Barton Willis

%solve(x^(1/3) = -1) => %union(), regardless of the setting of domain.

Not -1? Is this working as intended?

Maxima version: "5.38.0" Maxima build date: "2016-04-03 08:56:53" Host type: "x86_64-apple-darwin15.4.0" Lisp implementation type: "SBCL" Lisp implementation version: "1.2.10"


Sent from sourceforge.net because you indicated interest in https://sourceforge.net/p/maxima/bugs/3317/https://urldefense.proofpoint.com/v2/url?u=https-3A__sourceforge.net_p_maxima_bugs_3317_&d=DwMCAg&c=9ZQuuHhOefNvAzlN-3viIA&r=Y-7rxY5GkJ0PrHulpV2qSA&m=-IlfmHN2ibi8CQ15WaEF5NUfubAHBgsR-4lfo48B9Rk&s=KLAYtH8ntf5M-b34RlOZ6auzUYhrxThvy8_gBbDI8ks&e=

To unsubscribe from further messages, please visit https://sourceforge.net/auth/subscriptions/https://urldefense.proofpoint.com/v2/url?u=https-3A__sourceforge.net_auth_subscriptions_&d=DwMCAg&c=9ZQuuHhOefNvAzlN-3viIA&r=Y-7rxY5GkJ0PrHulpV2qSA&m=-IlfmHN2ibi8CQ15WaEF5NUfubAHBgsR-4lfo48B9Rk&s=U-Almk6DWoxgBd2qtMlqayGEZfeCEj0yAXOCCNVEL3Q&e=

Attachments:

rtoy commented 4 months ago

Imported from SourceForge on 2024-07-03 02:07:56 Created by robert_dodier on 2017-07-08 22:40:52 Original: https://sourceforge.net/p/maxima/bugs/3317/#411e


Hmm, I see that to_poly (x^(1/3) = -1, [x]) yields [[%g7+1, x = %g7^3], [-%pi/3 < parg(%g7), parg(%g7) <= %pi/3], []]. Does that seem right?

solve([%g7+1, x = %g7^3], [x, %g7]) yields [[x = - 1, %g7 = - 1]]. I wonder why to_poly_solve doesn't return x = -1.

rtoy commented 4 months ago

Imported from SourceForge on 2024-07-03 02:07:59 Created by willisbl on 2017-07-10 15:16:55 Original: https://sourceforge.net/p/maxima/bugs/3317/#411e/a5e1


Using the negative real as the branch cut of the cube root function, we have (-1)^(1/3) = exp(%i %pi / 3) =/= -1. So -1 isn't in the solution set of x^(1/3) = -1. For -1 to be in the solution set, we need to use ph(-1) = 3 %pi. Then (-1)^(1/3) = exp(3 %pi %i / 3) = exp(%pi %i) = -1.

The to poly solver could be greatly simplified by gutting the logic that imposes a branch for for the non-integer powers along the negative real axis. As I see it, that would make, for example, %i/2 (and -%i/2) both solutions to

 sqrt(x) + sqrt(-x) = %i.

That is arguably true, but it requires that the two square roots be defined using different branches. That is, I think, problematic.

--Barton


From: Robert Dodier robert_dodier@users.sf.net Sent: Saturday, July 8, 2017 5:40:53 PM To: [maxima:bugs] Subject: [maxima:bugs] #3317 How does solve treat (-1)^(1/3)?

Hmm, I see that to_poly (x^(1/3) = -1, [x]) yields [[%g7+1, x = %g7^3], [-%pi/3 < parg(%g7), parg(%g7) <= %pi/3], []]. Does that seem right?

solve([%g7+1, x = %g7^3], [x, %g7]) yields [[x = - 1, %g7 = - 1]]. I wonder why to_poly_solve doesn't return x = -1.


[bugs:#3317]https://urldefense.proofpoint.com/v2/url?u=https-3A__sourceforge.net_p_maxima_bugs_3317_&d=DwMCAg&c=9ZQuuHhOefNvAzlN-3viIA&r=Y-7rxY5GkJ0PrHulpV2qSA&m=2fnU5_5JMMoV90p1xZilYqcpUTnsEGsliUWoqWEvHGo&s=LIGB0HoJtBMT-c5KHOQRJlZWqnkYnulQ_DlncLQzX_I&e= How does solve treat (-1)^(1/3)?

Status: open Group: None Created: Thu Jul 06, 2017 08:53 PM UTC by Stavros Macrakis Last Updated: Thu Jul 06, 2017 08:53 PM UTC Owner: Barton Willis

%solve(x^(1/3) = -1) => %union(), regardless of the setting of domain.

Not -1? Is this working as intended?

Maxima version: "5.38.0" Maxima build date: "2016-04-03 08:56:53" Host type: "x86_64-apple-darwin15.4.0" Lisp implementation type: "SBCL" Lisp implementation version: "1.2.10"


Sent from sourceforge.net because you indicated interest in https://sourceforge.net/p/maxima/bugs/3317/https://urldefense.proofpoint.com/v2/url?u=https-3A__sourceforge.net_p_maxima_bugs_3317_&d=DwMCAg&c=9ZQuuHhOefNvAzlN-3viIA&r=Y-7rxY5GkJ0PrHulpV2qSA&m=2fnU5_5JMMoV90p1xZilYqcpUTnsEGsliUWoqWEvHGo&s=LIGB0HoJtBMT-c5KHOQRJlZWqnkYnulQ_DlncLQzX_I&e=

To unsubscribe from further messages, please visit https://sourceforge.net/auth/subscriptions/https://urldefense.proofpoint.com/v2/url?u=https-3A__sourceforge.net_auth_subscriptions_&d=DwMCAg&c=9ZQuuHhOefNvAzlN-3viIA&r=Y-7rxY5GkJ0PrHulpV2qSA&m=2fnU5_5JMMoV90p1xZilYqcpUTnsEGsliUWoqWEvHGo&s=a59TzVoUE5xjpkeZoGpQlcABWSm771aP8cXy67c9dys&e=

Attachments: