4
$\begingroup$

I want MMA to tell me if two, rather large, expressions are equal. My minimum working example follows. I want MMA to tell me that the following is true:$$x^n = \left(\frac{1}{x}\right)^{-n}$$ I have tried

x^n == (x^(-1))^(-n)

and

FullSimplify[x^n == (x^(-1))^(-n)]

Neither indicates that the expressions are equal. In fact:

PossibleZeroQ[x^n - (x^(-1))^(-n)]

returns False. Is there any way to get MMA to tell me that the equality holds? Or maybe a better approach/paradigm?

$\endgroup$
2
  • 1
    $\begingroup$ It's not generally true, but it is for integers. Try FullSimplify[x^n == (x^(-1))^(-n), n \[Element] Integers]. -- Also for positive bases: FullSimplify[x^n == (x^(-1))^(-n), x > 0] $\endgroup$
    – Michael E2
    Commented Aug 2, 2015 at 2:14
  • $\begingroup$ Exactly what I needed. Thank you. $\endgroup$
    – user39275
    Commented Aug 2, 2015 at 2:20

1 Answer 1

10
$\begingroup$

One of the pitfalls new users face, especially if they have analysis (calculus) of only real functions of real variables, is that Mathematica assumes by default that variables are complex and functions are the complex functions. Power functions in particular can seem strange; even those who know it is complex sometimes forget. The cube root is a simple example:

(-1)^(1/3)
(*  (-1)^(1/3)         -- not -1  *)

N[(-1)^(1/3)]
(*  0.5 + 0.866025 I   -- it's a complex 3rd root of -1 *)

We can see that the OP's proposed identity does not hold generally:

Block[{x = -1, n = 1/3},
 N@ {x^n, (x^(-1))^(-n)}
 ]
(*  {0.5 + 0.866025 I, 0.5 - 0.866025 I}   -- different imaginary parts  *)

There are two cases where it does hold:

FullSimplify[x^n == (x^(-1))^(-n), n ∈ Integers]
FullSimplify[x^n == (x^(-1))^(-n), x > 0]
(*
  True
  True
*)

One can find other cases, too:

Block[{x = I, n = 1/3},
 x^n == (x^(-1))^(-n)]
(*  True  *)

Related:

$\endgroup$

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.