I know this is very simple but I couldn't find a reasonable solution for it in the archive. It seems that my Mathematica does not take into account the assumptions when it wants to simplify the expression. Here is the thing
I have the following expression for gs1
gs1=-((Sqrt[3] (1/(1 + \[Alpha]^3))^(1/3))/2^(
2/3)) + (r^3 (1 + Cos[\[Theta]] Sin[\[Theta]])^(3/2) + (
3 Sqrt[3]
r^3 (-1 + \[Alpha]^3) (Cos[\[Theta]] + Sin[\[Theta]]) Sin[
2 \[Theta]])/(4 (1 + \[Alpha]^3)))^(1/3)
If you copy and paste the above expression in your Mathematica notebook you will see that it contains the cube root of r^3
, which upon assuming that r is positive must be simply r
. So I simplify it using the following command
gs2 = Simplify[gs1, Assumptions -> r > 0]
However, it doesn't do anything. This is very trivial and it should easily take r^3
out of the cube root and make it r
but it doesn't.
I was thinking that maybe this is not the correct way of doing it so I tested it with a very simple expression
Simplify[Surd[x^3, 3], Assumptions -> x > 0]
and it gives x
as the result.
Following the answer of @Nasser, I found something strange.
ClearAll[a, b, r];
term = (r^3 b + (r^3)/2)^(1/3);
Simplify[term, Assumptions -> r > 0]
this does not simplify the term, however, when I edit the term and eliminate the denominator by multiplying by 0.5
, instead of dividing by 2
, I get what I am looking for
ClearAll[a, b, r];
term = (r^3 b + (r^3)*0.5)^(1/3);
Simplify[term, Assumptions -> r > 0]
Here is the screenshot also
ClearAll[a, b, r]; term = (r^3 b + (r^3) /2)^(1/3); Assuming[r > 0, Simplify[term]]
and you can see it does not factorr
as you wanted. UsingExpandAll
does not help hereAssuming[r > 0, ExpandAll[term]]
. One way is to forceCollect
, like thisClearAll[a, b, r]; term = (r^3 b + (r^3) /2); term = Collect[term, r^3]^(1/3) Assuming[r > 0, Simplify@term]
and now it works. !Mathematica graphics $\endgroup$ExpandAll
worked for your specific example. ButExpandAll
will not works for all cases, as the above example shows. $\endgroup$