Amitabha Roy wrote:
> In Mathematica 5.2,
>
> this does not work
>
> Simplify[ (-1)^(2 x + 3 y), Element[{x, y}, Integers] ]
> gives no simplication. Neither does Refine.
>
> I forgot to mention that I am only interested in the situation when the
> variables
> take on integer values.
>
Sorry, I forgot to check version 5.2. It works in the development version.
A possible workaround:
simp[expr_, assum_] :=
expr //.
(-1)^(a_Integer b_?(Refine[Element[#,Integers],assum]&)+x_.):>
((-1)^a)^b (-1)^x
For your example:
In[14]:=
simp[(-1)^(2x+3y),Element[{x,y},Integers]]
Out[14]=
y
(-1)
Carl Woll
Wolfram Research
>
>
>
>
>
> On Jun 2, 2006, at 8:41 AM, Carl K. Woll wrote:
>
>> Amitabha Roy wrote:
>>
>>> Hello:
>>> I would like Mathematica to be able to take an expression, say,
>>> (-1)^{2 x + 3 y} and be able to simplify to (-1)^y.
>>> Is there a way one can do this ?
>>> Thanks
>>
>>
>> I presume you want this simplification to occur assuming x and y are
>> integers, as the simplification is not valid when either x or y are
>> not integers. For example, with x==0 and y==.1, we have (-1)^ (3*.1)
>> != (-1)^.1. Try:
>>
>> Simplify[ (-1)^(2 x + 3 y), Element[{x,y},Integers] ]
>>
>> y
>> (-1)
>>
>> (you could also use Refine with the same syntax instead of Simplify)
>>
>> Carl Woll
>> Wolfram Research