MathGroup Archive 2008

[Date Index] [Thread Index] [Author Index]

Search the Archive

Re: PowerExpand in version 6

  • To: mathgroup at
  • Subject: [mg85882] Re: PowerExpand in version 6
  • From: Szabolcs Horvát <szhorvat at>
  • Date: Tue, 26 Feb 2008 07:50:50 -0500 (EST)
  • Organization: University of Bergen
  • References: <fpoonm$1ev$> <fpud48$mgl$>

sashap wrote:
> Dear Andrzej,
> Assuming works by setting $Assumptions, and this has the desired
> effect for most of the functions, because their Assumptions options
> is defaulted to $Assumptions.
> Here is a list of all System` context symbols with Assumptions option:
> In[184]:= ToExpression /@
>  Quiet[Select[Names["System`*"],
>    MemberQ[ToExpression[#, StandardForm,
>        Options[Unevaluated[#]] &][[All, 1]], Assumptions] &]]
> Out[184]= {ExpectedValue, FourierCosTransform, FourierSinTransform, \
> FourierTransform, FullSimplify, FunctionExpand, Integrate, \
> InverseFourierCosTransform, InverseFourierSinTransform, \
> InverseFourierTransform, LaplaceTransform, Limit, PiecewiseExpand, \
> PossibleZeroQ, PowerExpand, Refine, Residue, Series, Simplify}
> We now select the one where Assumptions is not set to $Assumptions:
> In[185]:= Select[{#, Options[#, Assumptions]} & /@ %,
>  FreeQ[#, HoldPattern[$Assumptions]] &]
> Out[185]= {{PowerExpand, {Assumptions -> Automatic}}}
> This was done for backwards compatibility. Unfortunately resetting
> this option globally might not be a very good idea, because it would
> change the behavior of some of internal code which uses PowerExpand.

Dear Oleksandr Pavlyk,

Thank you for explaining this!  I would just like to point out one 
thing:  The documentation states that Assuming should work with PowerExpand:

"You can specify default assumptions for PowerExpand using Assuming."

Using Assuming[True, PowerExpand[ ... ]] is an edge case, but it seems 
that no matter what assumptions are specified, Assuming does not work 
with PowerExpand:

In[1]:= Assuming[x < 0, PowerExpand[Sqrt[x*y]]]
Out[1]= Sqrt[x]*Sqrt[y]

In[2]:= PowerExpand[Sqrt[x*y], Assumptions -> x < 0]
Out[2]= I*E^(I*Pi*Floor[-(Arg[y]/(2*Pi))])*Sqrt[-x]*Sqrt[y]

The misleading statement should be removed from the documentation.

Szabolcs Horvát

  • Prev by Date: Re: Branch Cuts and NDSolve
  • Next by Date: Re: How to import a Matlab mat-file
  • Previous by thread: Re: PowerExpand in version 6
  • Next by thread: Legend with ListDensityPlot