Message Boards Message Boards

0
|
462 Views
|
10 Replies
|
3 Total Likes
View groups...
Share
Share this post:

Forcing Solve to give real-valued root

Posted 2 months ago
Solve[y^3+x==0, y, Reals]

gives the answer in terms of the Root function. How can I make Wolfram solve it with the real-valued root and output x^(1/3)?

Solve[x-(8+1/y)^3 == 0, y]

also gives a very long answer, instead of 1/(x^(1/3)-8).

POSTED BY: Paul R
10 Replies

I don't know if it can be done automatically, but you can write your own solver:

surdSolve[a_ + b_^n_ == 0] := b == Surd[-a, n];
surdSolve[a_ - b_^n_ == 0] := b == Surd[a, n];
surdSolve[y^3 + x == 0]
surdSolve[x - (8 + 1/y)^3 == 0]
surdSolve[x - (8 + 1/(y - 2))^3 == 0]
Solve[%, y] // Simplify
POSTED BY: Gianluca Gorni

The Power[] expression x^(1/3) is not real-valued for negative x. Are you sure that's what you want?

In other words, you cannot represent the real solutions as a parametrized Power[] expression, except as a Piecewise[] expression.

Principal-value real radicals are represented by Surd in Mathematica.

POSTED BY: Michael Rogers
Posted 1 month ago

That's the problem.

How to tell Wolfram to use real-valued roots? I can't write y^3 in terms of Surd.

Also even the simplest example Solve[2 + (x - 3)^5 == 0, x, Reals] doesn't give 3-2^(1/5).

POSTED BY: Paul R

The Solve/Reduce complex of solvers implement real roots via Root[]. In general, solutions cannot be expressed in terms of Surd[]. For instance, the solutions to something as seemingly simple as 8 x^3 == 1 + 6 x, which are three real roots, cannot be expressed in terms of Surd[]. This is, I suppose, why Wolfram has adopted Root[] for expressing polynomial roots.

So, yeah, it's a problem. I'm not sure how to help. Or if I know how to help.

Of course, the solutions to certain forms of equations can be expressed in terms of Surd[]. Do all your equations have one of the forms u^n + a == 0 or u^(-n) + a == 0, where u and a are expressions in terms of y and x and n is an integer?

POSTED BY: Michael Rogers
Posted 1 month ago

No. Not all. I'm searching for a more general solution.

POSTED BY: Paul R

Then if I'm understanding correctly, it cannot be done in general, which has been proven (e.g. Wantzel, 1843, for casus irreducibilis).

POSTED BY: Michael Rogers
Posted 1 month ago

Your first example: If you drop the third argument then Solve will return all 3 roots. The real root is, obviously, the first one.

Solve[y^3+x==0,y]
{{y->-x^(1/3)},{y->(-1)^(1/3) x^(1/3)},{y->-(-1)^(2/3) x^(1/3)}}

Your second example: Take the real root and use Simplify on it.

realRoot=Solve[x-(8+1/y)^3==0,y]//First
Simplify[realRoot,Assumptions->Element[x,PositiveReals]]
POSTED BY: Hans Milton
Posted 1 month ago

Thank you for you response. The approach is problem-specific. I mean that for other problems like Solve[x - (8 + 1/(y - 2))^3 == 0, y] or Solve[1/(1 + E^y^3)^3 == x, y] it will not work.

Possibly, there is some function that will filter "real" roots...

POSTED BY: Paul R
Posted 1 month ago

To select the real roots (if any) you could try this function:

realRoots[r_List]:=Select[r,FreeQ[#,(-1)^_]&&FreeQ[#,I]&&FreeQ[#,Complex]&]
POSTED BY: Hans Milton
Posted 1 month ago

realRoots[Solve[y + (x - 3)^5 == 0, x]]. I expect the output to be 3-y^(1/5).

POSTED BY: Paul R
Reply to this discussion
Community posts can be styled and formatted using the Markdown syntax.
Reply Preview
Attachments
Remove
or Discard

Group Abstract Group Abstract