Re: Simplification

• To: mathgroup at smc.vnet.net
• Subject: [mg75445] Re: [mg75431] Simplification
• Date: Tue, 1 May 2007 03:21:30 -0400 (EDT)

```One can implement the convert-to-sin function similar to
what the other CAS has as a couple of replacement rules.
And indeed, it helps here a lot. I will add the rules to
FullSimplify.

In[1]:= f[k_] := Product[Cos[(2^j*Pi)/(2^(k + 1) - 1)], {j, 0,
k}]/Product[Cos [(2^j*Pi)/(2^(k + 1) + 1)], {j, 0, k}]

In[2]:= Table[f[k], {k, 2, 100}]//.
{Cos[x_]->Sin[2 x]/(2 Sin[x]), Sec[x_]->2 Sin[x]/Sin[2 x]}

Out[2]= {-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
>    -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
-1, -1,
>    -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
-1, -1,
>    -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
-1, -1,
>    -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
-1, -1,
>    -1, -1, -1, -1, -1, -1, -1, -1, -1, -1}

In[3]:= TimeUsed[]
Out[3]= 1.09183

This is with the development version, soon to become Mathematica 6.
With Mathematica 5.2 one needs to add some trig canonicalization
rules that are built in the development version:

In[1]:= f[k_] := Product[Cos[(2^j*Pi)/(2^(k + 1) - 1)], {j, 0,
k}]/Product[Cos [(2^j*Pi)/(2^(k + 1) + 1)], {j, 0, k}]

In[2]:= large[x_] := x>Pi/4

In[3]:= Table[f[k], {k, 2, 100}]//.
{Cos[x_?large]:>Sin[Pi/2-x], Sin[x_?large]:>Cos[Pi/2-x],
Sec[x_?large]:>Csc[Pi/2-x], Csc[x_?large]:>Sec[Pi/2-x],
Cos[x_]->Sin[2 x]/(2 Sin[x]), Sec[x_]->2 Sin[x]/Sin[2 x]}

Out[3]= {-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
>    -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
-1, -1,
>    -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
-1, -1,
>    -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
-1, -1,
>    -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
-1, -1,
>    -1, -1, -1, -1, -1, -1, -1, -1, -1, -1}

Best Regards,

Wolfram Research

Andrzej Kozlowski wrote:
> *This message was transferred with a trial version of CommuniGate(tm) Pro*
> Actually, this is a special case of a general fact:
>
> Let
>
> f[k_] := Product[Cos[(2^j*Pi)/(2^(k + 1) - 1)], {j, 0, k}]/Product[Cos
> [(2^j*Pi)/(2^(k + 1) + 1)], {j, 0, k}]
>
> then for every integer k>0, f[k]= -1. The problem that you have  stated
> is showing that f[9]= -1. Mathematica can only do the simplest  case:
>
> FullSimplify[f[1]]
> -1
>
> but fails on the next one:
>
>
> FullSimplify[f[2]]
>
> Cos[Pi/7]*Cos[(2*Pi)/7]*Cos[(4*Pi)/7]*Sec[Pi/9]*Sec[(2*Pi)/9]*Sec
> [(4*Pi)/9]
>
>
> However, one can prove a more exact theorem:
>
> Product[Cos[(2^j*Pi)/(2^(k + 1) - 1)], {j, 0, k}] == -2^(k+1) and
> Product[Cos[(2^j*Pi)/(2^(k + 1) + 1)], {j, 0, k}]  ==   2^(k+1)
>
> defining
>
> g[k_] := Product[Cos[(2^j*Pi)/(2^(k + 1) + 1)], {j, 0, k}]
>
> and
>
> h[k_] := Product[Cos[(2^j*Pi)/(2^(k + 1) - 1)], {j, 0, k}]
>
> we see that Mathematica actually performs a little better when  dealing
> with g and h:
>
>
> Table[FullSimplify[g[k]], {k, 1, 3}]
>
> {1/4, 1/8, 1/16}
>
> with h, however, this happens:
>
>
> Table[FullSimplify[h[k]], {k, 1, 3}]
>
>
> {-(1/4), Cos[Pi/7]*Cos[(2*Pi)/7]*Cos[(4*Pi)/7], -(1/16)}
>
> That's as much as Mathematica seems to be able to do. It would be
> interesting to know if the other CAS can go beyond f[9], and if it  can,
> whether it takes it longer to do so.
>
>
> Andrzej Kozlowski
>
>
>
>
> On 30 Apr 2007, at 16:40, dimitris wrote:
>
>> This appeared in another forum.
>>
>> (Converting to Mathematica InputForm.)
>>
>> In[2]:=
>> oo = Product[Cos[(2^j*Pi)/1023], {j, 0, 9}]/Product[Cos[(2^j*Pi)/
>> 1025], {j, 0, 9}];
>>
>> The expression can be simplified to -1.
>>
>> Indeed, adopted by someone's reply, in another CAS, we simply have
>>
>> Product(cos(Pi*2^j/1023), j= 0..9)/ Product(cos(Pi*2^j/1025), j=
>> 0..9):
>>  p:=value(%):
>>  convert(p, sin):
>>  simplify(%);
>>                                                    -1
>>
>> However, no matter what I tried I was not able to succeed in
>> simplifying above expression
>> to -1 with Mathematica, in reasonable time. Futhermore, even the much
>> more simpler of
>> showing oo==-1 didn't work.
>>
>> So I would really appreciate if someone pointing me out:
>> 1) A way to show (in Mathematica!) that oo is simplified to -1
>> 2) That the equality oo==-1 (or oo-1==0 alternatively) can be
>> simplified
>> to True.
>>
>> Any ideas?
>>
>> BTW, I found the function convert of the other CAS, very useful.
>> Has anyone implementated a similar function in Mathematica?
>> (I ain't aware of a Mathematica built-in function, similar to convert
>> from the other CAS.)
>>
>> Dimitris
>>
>>
>

```

• Prev by Date: Re: Simplification
• Next by Date: Re: Re: Re: RE: Re: Sometimes <space> means multiple
• Previous by thread: Re: Simplification
• Next by thread: Re: Simplification