4

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?

user39275
  • 53
  • 5
  • 1
    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] – Michael E2 Aug 02 '15 at 02:14
  • Exactly what I needed. Thank you. – user39275 Aug 02 '15 at 02:20

1 Answers1

10

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:

Michael E2
  • 235,386
  • 17
  • 334
  • 747