Message Boards Message Boards

0
|
4453 Views
|
22 Replies
|
4 Total Likes
View groups...
Share
Share this post:

What is needed to get a^(p/q) == Power[a^p, q^-1] to return True?

Posted 2 years ago

I was experimenting with some basic math and wanted to see if the Kernel would evaluate the following correctly:

a^(p/q) == Power[a^p, q^-1]

It returns unevaluated, then I tried:

a^(p/q) === Power[a^p, q^-1]

it returns False.

So what is the Kernel needing to evaluate True. Btw, should I have used Surd?? Needed to use Assuming?? Elements? I would have thought after 20+ yrs this powers relation be a simple thing to symbolically confirm.

Thanks.

POSTED BY: Andrew Meit
22 Replies
Posted 2 years ago

Nothing is wrong with Mathematica with respect to the statements you appear resistant to acknowledging that those aren't generally true (despite counterexamples given to you). I would argue that is is you who needs to supply the assumptions appropriate for your objectives.

And you've used the wrong form and location for Assuming in the code you posted. (An indication that an error occurred should have been observed.) The statement in your code

a^p/a^q == a^(p - q), Assuming[a, a != 0]

should probably be

Assuming[b > 0 && a > 0 && p > 0, (a/b)^p == a^p/b^p]

although that doesn't get you anywhere. You can explore with various assumptions. Consider the following:

FullSimplify[(a/b)^p == a^p/b^p, Assumptions -> {b > 0}]
(* True *)
FullSimplify[(a/b)^p == a^p/b^p, Assumptions -> {b < 0 && a < 0}]
(* True *)

While I am no mathematician, it does appear that the truth of your equality depends on various assumptions.

POSTED BY: Jim Baldwin

Beware, your algebraic rules break down easily:

In[2]:= With[{a = -I, b = I, p = 1/2}, (a/b)^p == a^p/b^p ]

Out[2]= False
POSTED BY: Gianluca Gorni
Posted 2 years ago

Ok, but is that a bug in Mathematica or suggest an improved rules or how to provide the correct assumptions to those rules. I am only following what Mathematica gives me. Please help me to do better, thanks.

POSTED BY: Andrew Meit
Posted 2 years ago

I did not use Surd, would that made any difference??

POSTED BY: Andrew Meit
Posted 2 years ago

Thank you all for sharing my wrestling with Mma stating the basics, at least for now on Roots. I put a notebook together to study. Suggestions and corrections welcomed.

I understand once you move into typeset statements, it can get dicey how Mma understands the statements; FullForm versions are often the best way.

The ref nb on PowerExpand needs to have examples of using it in proofs/proving.

One of my fav teachers told me, you should back to re-study the basics every 5 or 10 yrs. ;-) I still think mma should have understood my truth testing without having a deep knowledge of other functions.

POSTED BY: Andrew Meit
Posted 2 years ago

Right and need an extra ( ):

PowerExpand[Power[Power[a, (1/q)], (1/p)] == Power[a, (1/(p q))]]

This Returns True!

POSTED BY: Andrew Meit
Posted 2 years ago

Oh! back to the negative raised.... Thats what I started out with. So what Mathematica gave via copy as plaintext and pasted was correct all along? Suggestions on a workflow going forward?

Power[Power[a,Power[q,-1]],Power[p,-1]] == Power[a,Power[pq,-1]]

well, it still gives False even with PowerExpand. I guess only visually symbolically I state its true. Is it my poor understanding using Mathematica or Mathematica can't really do it at this time? Or need to load up on a long list of assumptions?

POSTED BY: Andrew Meit
Posted 2 years ago

pq is not the same as p q. You forgot to put a space inbetween.

POSTED BY: Jim Baldwin
Posted 2 years ago
(a^p)^(1/q)//FullForm
(* Power[Power[a, p], Power[q, -1]] *)
POSTED BY: Jim Baldwin
Posted 2 years ago

I selected the Tex converted form; copied it as PlainText; pasted into a cell to force into InputForm. I had removed the () around the p as well.

I selected the Tex converted form; copied it as PlainText; pasted into a cell to force into InputForm. I had removed the () around the p as well.

Now if I copied the cell and convert to StandardForm via the convert menu item no copying, I get this:

(a^p)^(1/q)

So....is there a bug going on here or am doing something wrong to get from the converted Tex to InputForm?

Oy, now am wondering if I have to redo the work I did last night.

Consider this:

PowerExpand[Power[Power[a, (1/q)], (1/p)] == Power[a, (1/pq)]]

So this returns evaluated but still not True. But notice the slight change in the typesetting when its evaluate, could that prevent the failure. I tried various Assumptions, nothing works.

So from what I read about Surds, I should use that instead of Power? Since it gives real-valued nth root of x.

POSTED BY: Andrew Meit

What did you do to get back Power[a^p, q^-1]? Its standard form is (a^p)^(1/q).

POSTED BY: Gianluca Gorni
Posted 2 years ago

Btw, Mathematica gave me

Power[a^p, q^-1]

It puzzles me why that form was chosen since it is rarely seen in the textbooks unless something I missed with "new math" teaching.

Thanks for the great insights!

POSTED BY: Andrew Meit

Here is a counterexample:

With[{p = 2, q = 3, a = -1},
 a^(p/q) == Power[a^p, q^-1]]

I always tell my students that it is very dangerous to elevate a negative basis to a non-integer exponent, because the familiar algebraic rules break down. Is seems to be a little-known issue.

POSTED BY: Gianluca Gorni
Posted 2 years ago

Excellent! Just to make it even more explicit that a^(p/q) == Power[a^p, q^-1] is not generally true using your example:

With[{p = 2, q = 3, a = -1}, a^(p/q)]
(* (-1)^(2/3) *)

With[{p = 2, q = 3, a = -1}, a^(p/q)] // ComplexExpand
(* -(1/2) + (I Sqrt[3])/2 *)

With[{p = 2, q = 3, a = -1}, Power[a^p, q^-1]]
(* 1 *)
POSTED BY: Jim Baldwin
Posted 2 years ago

Then I tried this:

Assuming[
 p > 0 && p \[Element] Reals && a > 0 && a \[Element] Reals && q > 0 &&
   q \[Element] Reals,
 a^(p/q) === Power[a^p, q^-1]]

Nope; then I tried this:

  SameQ[a^(p/q),Power[a^p,q^-1], Assumptions->{a>0,p>0,q>0}]

Nope again. And it appears SameQ does not understand Assumptions (Assuming ref nb). Should I had to have read PowerExpand or Simplify before proving that the comparison is true? Am asking a larger question for those expecting Mathematica to just get it right without the deep understanding of how Mathematica works. Translating from a standard textbook on math appears much harder than I realized.

POSTED BY: Andrew Meit
Posted 2 years ago

The "simple high school math" uses unstated simplifying assumptions. Mathematica assumes (generally) that all variables could be complex numbers and therefore doesn't always simplify as one would expect from simple high school math.

POSTED BY: Jim Baldwin
Posted 2 years ago

Right. Understand better. So testing for SameQ requires spelling out the assumptions to prove the lhs===rhs. But from my reading SameQ does not use Assuming/Assumptions; or did I misunderstand.

I and others have wanted better tools for proofs and proving within Mathematica for a long time. I would have expected by now the pattern some of the high school math states be parsed better in Mathematica. PowerExpand was out of left field for proving; there are no examples of using it for proving. Learned a cool insight. :-)

POSTED BY: Andrew Meit
Posted 2 years ago

There are some assumptions that one needs to make to have your statement be true. Those assumptions (and consequences) are listed in the documentation for PowerExpand. And to show that assumptions about a and p make things work consider the following:

Simplify[Power[a^p, q^-1], Assumptions -> {a > 0, p > 0}]
Simplify[Power[a^p, q^-1], Assumptions -> {a > 0, p < 0}]
Simplify[Power[a^p, q^-1], Assumptions -> {a > 0, p < 0 || p > 0}]

with all of those resulting in a^(p/q). Also writing you own rules works:

Power[a^p, q^-1] /. Power[x_^y_, z_] -> x^(y z)
POSTED BY: Updating Name
Posted 2 years ago

Cool, and very instructive, thank you; much to study. However, I was expecting the kernel to understand the original statement without the deep contextualizing used. I wanted to take a simple high school math relationship and confirm its truth within Mathematica. Note:

WolframAlpha["a^(p/q)==Power[a^p,q^-1]", \
{{"AlternateFormAssumingAllVariablesAreRealAndPositive", 1}, 
  "Plaintext"}]

Tells me the relationship is True as I would have expected.

POSTED BY: Andrew Meit
Posted 2 years ago

yep,

PowerExpand[Power[Power[a, q^-1], p^-1] == Power[a, (p q)^-1]]

returns True

POSTED BY: Andrew Meit
Posted 2 years ago

PowerExpand works.

POSTED BY: Eric Rimbey
Posted 2 years ago

Correct, but Whoa, why need to use that? Kernel need to expand both sides internally before testing the lhs/rhs are the same? I would have thought the internal pattern matching over the past decades would have understood what am seeking not needing to expand anything. Is this a limitation of design? Thanks

POSTED BY: Andrew Meit
Reply to this discussion
Community posts can be styled and formatted using the Markdown syntax.
Reply Preview
Attachments
Remove
or Discard

Group Abstract Group Abstract