Group Abstract Group Abstract

Message Boards Message Boards

Unable to find roots for a simple equation

POSTED BY: Willem Verheijen
4 Replies

I get Root with version 12.3 and the Reals option:

Solve[(2 Sqrt[2] V (m \[Epsilon]f)^(3/2))/(3 \[Pi]^2 \[HBar]^3) == 
  Ntot, \[Epsilon]f, Reals]

I have not tried version 13 yet.

POSTED BY: Gianluca Gorni

I am not replicating your results.

In[244]:= Solve[(2 Sqrt[
      2] V (m \[Epsilon]f)^(3/2))/(3 \[Pi]^2 \[HBar]^3) == 
  Ntot, \[Epsilon]f]

During evaluation of In[244]:= Solve::nongen: There may be values of the parameters for which some or all solutions are not valid.

Out[244]= {{\[Epsilon]f -> ((-3)^(2/3) Ntot^(2/3) \[Pi]^(
    4/3) \[HBar]^2)/(2 m V^(2/3))}, {\[Epsilon]f -> (
   3^(2/3) Ntot^(2/3) \[Pi]^(4/3) \[HBar]^2)/(
   2 m V^(2/3))}, {\[Epsilon]f -> -(((-1)^(1/3) 3^(2/3) Ntot^(
     2/3) \[Pi]^(4/3) \[HBar]^2)/(2 m V^(2/3)))}}

Possibly you are using an older version that gives the Root[...] form of result?

POSTED BY: Daniel Lichtblau

Thank you, it still confuses me but I find solace in your remark that I am not the only one.

POSTED BY: Willem Verheijen

The problem is that you are probably asking for the plain real solution, while Mathematica assumes that your parameters are complex and you ask for all complex solutions. This topic is an endless source of confusion. You can use ToRadicals and then pick manually the solution that looks real when the variables are in your expected range:

Solve[(2 Sqrt[2] V (m \[Epsilon]f)^(3/2))/(3 \[Pi]^2 \[HBar]^3) == 
   Ntot, \[Epsilon]f] // ToRadicals

You can ask Solve to give the real solution, but it will be expressed as a Root object, which is appreciated only by Mathematica fans:

Solve[(2 Sqrt[2] V (m \[Epsilon]f)^(3/2))/(3 \[Pi]^2 \[HBar]^3) == 
  Ntot, \[Epsilon]f, Reals]

Sadly, ToRadicals applied to the Root object gives an answer that is probably wrong for your needs:

Solve[(2 Sqrt[2] V (m \[Epsilon]f)^(3/2))/(3 \[Pi]^2 \[HBar]^3) == 
   Ntot, \[Epsilon]f, Reals] // ToRadicals

Same for Reduce:

Reduce[(2 Sqrt[2] V (m \[Epsilon]f)^(3/2))/(3 Pi^2 \[HBar]^3) == 
   Ntot && \[HBar] > 0 && V > 0 && m > 0 && 
  Ntot > 0, \[Epsilon]f, Reals]
% // ToRadicals
POSTED BY: Gianluca Gorni
Reply to this discussion
Community posts can be styled and formatted using the Markdown syntax.
Reply Preview
Attachments
Remove
or Discard