I am dealing with an algebraic mess of variables for a project and for some reason, even though the function is real, Mathematica had been spitting out imaginary values to me. This issue has been plaguing me for weeks and I finally pinned it down to the fact that Mathematica freezes when it is faced with something like
$(-x^3)^{1/3}$
When I supply a real positive value for $x$, it will always go for the imaginary number.
Now I know about the CubeRoot function and the Surd function. However, I have expressions with ~200-2000 terms in it and I don't want to take the time to hunt down every instance of cube roots. How can I force Mathematica to just give me the real values?
expr /. a_^(1/3) :> Surd[a, 3]. – march Apr 23 '21 at 21:36