8
$\begingroup$

Simplify and FullSimplify do not simplify this kind of expression: $(r^\frac{1}{x})^x$. Consider

FullSimplify[r^2+(r^(2/x))^x+(r^(2/(x+y)))^(x+y)]

Mathematica's output is the same as my input, instead of 3 r^2. Is there a way to simplify $(r^\frac{1}{x})^x$ to $r$?

$\endgroup$
1
  • 5
    $\begingroup$ Hint: It is valid only under certain assumptions for $x,y$ and $r$. Try providing that to FullSimplify or Simplify $\endgroup$
    – rm -rf
    Commented Oct 29, 2013 at 16:17

2 Answers 2

17
$\begingroup$

To expand on rm -rf's hint, the variables need to be positive and real in order for the result you wish to see to hold. You can tell Mathematica to do this using the Assumptions option:

FullSimplify[r^2 + (r^(2/x))^x + (r^(2/(x + y)))^(x + y), 
             Assumptions -> {x > 0, y > 0, r > 0}]
3 r^2

To see that this is really needed, consider an example where it is violated:

r^2 + (r^(2/x))^x + (r^(2/(x + y)))^(x + y) /. {r -> -1, x -> -1/3, y -> -1}
2 - (-1)^(1/3)

which is not equal to 3 r^2. (Thanks to rm -rf for the improved example).

PowerExpand automatically assumes that the variables are real and positive, so you do not need to state it explicitly.

$\endgroup$
3
  • $\begingroup$ The example isn't illustrative though... the imaginary term is just due to FP math. Exact quantities will give you $3/100$, which is in fact $3r^2$. Perhaps {r -> -1, x -> -1/3, y -> -1} would be better... it gives you $2 - (-1)^{1/3}$, whose value depends on the branch of the cube root. $\endgroup$
    – rm -rf
    Commented Oct 29, 2013 at 17:37
  • $\begingroup$ @rm -rf Thanks for the improved example. BTW -- I didn't mean to steal your answer -- I was assuming that you didn't want to write it up. If I'm mistaken, please let me know. $\endgroup$
    – bill s
    Commented Oct 29, 2013 at 17:58
  • $\begingroup$ Oh, there is absolutely no problem! Feel free to take such comments and convert it to an answer :) I didn't post it as an answer because I'm quite certain that this is a duplicate (perhaps of several!), but I didn't have the time to search for it. So I just provided a hint to help the OP move forward with their problem for the time being (but it looks like they are AFK). $\endgroup$
    – rm -rf
    Commented Oct 29, 2013 at 18:25
12
$\begingroup$

When I want an expression like this to simplify, I'll use PowerExpand after FullSimplify

Try this:

PowerExpand[r^2+(r^(2/x))^x+(r^(2/(x+y)))^(x+y)]
$\endgroup$
1
  • 8
    $\begingroup$ It should be noted that PowerExpand makes the assumptions about the reality and positivity of the variables. $\endgroup$
    – rcollyer
    Commented Oct 29, 2013 at 17:33

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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