2
$\begingroup$

This question already has an answer here:

I am doing some calculations that end up popping out a lot of $-1$s to various fractional powers, and Mathematica doesn't seem to want to set them to $-1$. Is there an easy way to do this?

$\endgroup$

marked as duplicate by m_goldberg, Henrik Schumacher, Coolwater, Community Feb 4 at 17:30

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

  • $\begingroup$ See if you agree with the output of ComplexExpand[(-1)^(1/3), TargetFunctions -> {Re, Im}]. $\endgroup$ – b.gates.you.know.what Feb 1 at 17:39
  • 11
    $\begingroup$ If you know you're only interested in the real roots when you're taking roots, you might be interested in using Surd instead of fractional powers. $\endgroup$ – eyorble Feb 1 at 17:43
  • $\begingroup$ These solutions both seemed to have work. On a more general note, I have a variable $L$ that I am using. I have other terms that are written in terms of $L$. At some point in my output, Mathematica writes "$\sqrt{L^2} \sqrt{L}$." How can I force them to combine? $\endgroup$ – swygerts Feb 1 at 18:04
  • 1
    $\begingroup$ Only some functions in Mathematica check the assumptions only under some conditions. Simplify is one of those. As you might have seen, if you type in some expression there is a default very lightweight quick simplification done to that, like 3+5 being replaced by 8, but that does not invoke all the power of Simplify or make use of all the power of Assumptions. That means Mathematica works much more quickly if you choose when and where you want to have it spend time doing Simplify and using Assumptions $\endgroup$ – Bill Feb 1 at 19:36
  • 2
    $\begingroup$ Possible duplicate of this question $\endgroup$ – m_goldberg Feb 2 at 4:03
2
$\begingroup$

First Question: (-1)^(1/3) is not equal to -1
(-1)^n is only equal to -1 for odd, integer values of n.

Second Question:
Try Assuming[L \[Element] Reals, FullSimplify[Sqrt[L^2] Sqrt[L]]]

$\endgroup$
2
$\begingroup$
rule = x_^(1/3) -> CubeRoot[x];

(-1)^(1/3) /. rule
(*-1*)
$\endgroup$

Not the answer you're looking for? Browse other questions tagged or ask your own question.