[Date Index]
[Thread Index]
[Author Index]
PowerExpand in version 6
*To*: mathgroup at smc.vnet.net
*Subject*: [mg85808] PowerExpand in version 6
*From*: Andrzej Kozlowski <akoz at mimuw.edu.pl>
*Date*: Sat, 23 Feb 2008 04:22:26 -0500 (EST)
The ancient function PowerExpand, indispensable before the
Assumptions mechanism was introduced in version 4 of Mathematica,
became a bit of an embarrassment in later versions and there were even
voices, I can remember, arguing that it ought to be deprecated.
Instead, PowerExpand was modified in version 6 by making it possible
to use the Assumptions mechanism with it and this giving this almost
dead function a new lease of life. This is indeed very nice when it
works, but unfortunately the implementation still leaves some things
to be desired.
The main example in the documentation is:
PowerExpand[Sqrt[x*y], Assumptions -> True]
E^(I*Pi*Floor[-(Arg[x]/(2*Pi)) + 1/2 - Arg[y]/(2*Pi)])*
Sqrt[x]*Sqrt[y]
which gives a general expansion that is valid for all x and y. But
note that the normally equivalent form Assuming will not work:
Assuming[True, PowerExpand[Sqrt[x*y]]]
Sqrt[x]*Sqrt[y]
In fact Assuming is simply ignored and the answer returned is the same
as that given by PowerExpand without any assumptions. This is
disappointing for those (like myself) who prefer to use Assuming to
Assumptions -> , but may perhaps be a matter of deliberate design
(why?). But the next problem is certainly a bug.
First note that:
PowerExpand[Sqrt[x*y], Assumptions -> x > 0]
Sqrt[x]*Sqrt[y]
which is quite correct but suppose we make an even stronger assumption:
PowerExpand[Sqrt[x*y], Assumptions -> x > 0 && y > 0]
Sqrt[x*y]
We do not get the expansion we should obtain. Curiously we can get the
correct expansion if we use a more complicated way of stating the same
assumption, e.g.
PowerExpand[Sqrt[x*y], Assumptions -> x > 0 && Arg[y] == 0]
Sqrt[x]*Sqrt[y]
or
PowerExpand[Sqrt[x*y], Assumptions -> x > 0 && Re[y] > 0]
Sqrt[x]*Sqrt[y]
Andrzej Kozlowski
Prev by Date:
**Re: Using Mathematica figures in MS Word documents**
Next by Date:
**Re: Getting the View I want from ListPlot3D and Show**
Previous by thread:
**Re: Module and Manipulate Oddity**
Next by thread:
**Re: PowerExpand in version 6**
| |