# Solve function cannot find the solution, but it exists

Posted 4 months ago
1148 Views
|
13 Replies
|
7 Total Likes
|
 Hello,Consider the following expression f=(I Sqrt[3] 2^(1/3) + 2^(1/3))/(2(-2 a-1)^(1/3)) s=Solve[f==-2,a] Mathematica returns an empty list {}. However a=-5/8 is a solution. What is wrong with Solve?
13 Replies
Sort By:
Posted 4 months ago
 Are you sure that a=-5/8 is a solution? f = (I Sqrt[3] 2^(1/3) + 2^(1/3))/(2 (-2 a - 1)^(1/3)); f /. a -> -5/8 // FullSimplify (* 1 + I Sqrt[3] *) Note that Solve[f == 2, a] (* {{a -> -(3/8)}} *)
Posted 4 months ago
 Yes, a=-5/8 is a solution.Very short way to check it would be to cube both sides. With a=-5/8, f^3 gives -8 and one of its cube root is the real number -2. The long way to check it, after substituting a=-5/8, is to find the cube root of the numerator and the denominator separately. Each has 3 roots (complex roots). And then try out the ratios of those roots (numerator to denominator) which reveal a real number. After some investigation, some ratios give the real root -2 for a=-5/8.a=-3/8 would be the solution if f== +2, not iff== -2. I think the reason you are getting 1+Sqrt[3] when you plug a=-5/8 in is because Mathematica is only returning the primary root.
Posted 4 months ago
 Someone with better mathematics knowledge than I have will need to answer. To show my ignorance level I would argue that x==2 means that x==2 only. Analogous to your cubing of both sides x^2==4 is a different equation that results in x==2 and x==-2.
Posted 4 months ago
 If the expression is simplified/rewritten then Solve will find the expected solution -5/8 f = (I Sqrt[3] 2^(1/3)+2^(1/3))/(2 (-2 a-1)^(1/3)) Use FullSimplify to get rid of the imaginary unit: g = FullSimplify@f (* (-2)^(1/3)/(-1-2 a)^(1/3) *) Then rewrite using CubeRoot: h = CubeRoot[-2]/CubeRoot[-1-2 a] Solve[h == -2, a] (* {{a -> -(5/8)}} *) Note that f and h will not evaluate to the same when a is less than -1/2
Posted 4 months ago
 This is not a bug.Your rewrite using CubeRoot changes the meaning of the expression, because (-2)^(1/3) == CubeRoot[-2] (* False *) or if you like {(-2)^(1/3), CubeRoot[-2]} // N {0.629961 + 1.09112 I, -1.25992} In general, x^(1/3) refers to the principal branch of the complex cube root. Use CubeRoot or Surd for real roots.
Posted 4 months ago
 John, did I say "bug"?
Posted 4 months ago
 Hi Hans,This is a nice work around. But, this makes me believe that Solve has a deeper problem than I thought. After simplifying to (-2)^(1/3)/(-1-2 a)^(1/3) Solve still cannot solve it unless you explicitly tell Solve that those 1/3 powers are cube roots! This means that Solve cannot properly recognize branching points if powers are given as rational fractions. I think the reason it worked with CubeRoot is because branching points are hardcoded in the function. But for any arbitrary rational fraction, Solve may fail again, which makes me worry. I don't know how Wolfram programmed Solve, but I would expect Solve to try out the work around you suggested internally and give me the result. The problem I posted here is actually a part of another problem I encountered with DSolve. DSolve correctly found the 3 roots of the general solution of a differential equation I gave it to solve, but when I asked Mathematica to solve the differential equation with a boundary condition, 2 out 3 solutions failed. I then manually applied the B.C. to the general solution Mathematica found with Solve, but I failed (as it is the topic of this thread). However, when I found a solution by hand, I realized that Solve has some issues and perhaps DSolve suffers from this as well. I reserve the problem I had with DSolve to another thread, so that we can focus on the problem Solve has.In my opinion, this is a bug. To me, (-2)^(1/3)/(-1-2 a)^(1/3)==-2 is a very simplified expression and Solve cannot solve it without an unnecessary replacement of 1/3 powers with CubeRoot.
Posted 4 months ago
 Any potential bugs and suggested improvements should be reported to Wolfram Tech Support at https://www.wolfram.com/support/contact/email/?topic=Feedback
Posted 4 months ago
 This is not a bug. 5/8 is simply not a solution to the given equation (others have pointed that out). Solve is working exactly as designed in this example.To clarify, radicals give principal branches of roots. Parametrized radicals will of course only be able to do that when numeric values are substituted for the parameters.As for Solve, when encountering a parametrized radical it creates a new variable and a new equation. For example, the expression (-1-2 a)^(1/3) would become something along the lines radicalVariable[(-1-2 a)^(1/3)] with the defining equation radicalVariable[(-1-2 a)^(1/3)]^3==(-1-2 a). The actual internals can be see below. f = (I Sqrt[3] 2^(1/3) + 2^(1/3))/(2 (-2 a - 1)^(1/3)); In[3]:= InternalMakePolynomial[f] (* Out[3]= {{(SolveParmVar[2^(1/3)] + SolveParmVar[I] SolveParmVar[2^(1/3)] SolveParmVar[Sqrt[ 3]]) SolveRecipVar[1/ SolveRadVar[(-1 - 2 SolveSolvVar[a])^(1/3)]], 1 + SolveParmVar[I]^2 == 0, -2 + SolveParmVar[2^(1/3)]^3 == 0, -3 + SolveParmVar[Sqrt[3]]^2 == 0, 1 + SolveRadVar[(-1 - 2 SolveSolvVar[a])^(1/3)]^3 + 2 SolveSolvVar[a] == 0, -1 + SolveRadVar[(-1 - 2 SolveSolvVar[a])^( 1/3)] SolveRecipVar[1/ SolveRadVar[(-1 - 2 SolveSolvVar[a])^(1/3)]] == 0}, {SolveRecipVar[1/ SolveRadVar[(-1 - 2 SolveSolvVar[a])^(1/3)]], SolveRadVar[(-1 - 2 SolveSolvVar[a])^(1/3)], SolveSolvVar[a], SolveParmVar[I], SolveParmVar[Sqrt[3]], Solve`ParmVar[2^(1/3)]}} *)
Posted 4 months ago
 Oh! I think I see the source my confusion now; When (-2)^(1/3)//N is executed I realize that Mathematica returns the principle root. However, when this expression is given in Solve I thought that Solve was looking out for all the branches internally. So it would start with one of the roots (presumably the principle root) and check if the condition was satisfied, if not, then it would rotate the point by 2Pi/3 in the complex domain to see if the other root satisfied the condition, and again if that didn't satisfy it, Solve would rotate it one more time. Obviously the roots with non zero components along the imaginary axis can never satisfy the condition, but one root lies purely on the real axis which gives the result a=-5/8. When Solve gave me the empty list, I was confused like hell because I knew that the real root satisfied the condition. And also that's why I called the rewrite of the expression with CubeRoot offered by Hans "unnecessary" because I thought Solve was internally trying that branch too, but in reality it wasn't. It is only looking at the principle root unless otherwise stated either by CubeRoot or Surd functions. Now this clears out why CubeRoot solution offered by Hans works. I hope my understanding of the working of Solve is correct now. I appreciate your help, Thanks all!
Posted 4 months ago
 It isn't really the machinery of Solve that's in question. f == 0 /. a -> -5/8 (* False *) -5/8 isn't a root of your equation. Mathematica consistently treats x^(1/3) and CubeRoot[x] as different things, defined differently. If Solve were to violate that, it would represent a bug.