Re: FunctionExpand problem in version 6

• To: mathgroup at smc.vnet.net
• Subject: [mg82025] Re: FunctionExpand problem in version 6
• From: sashap <pavlyk at gmail.com>
• Date: Wed, 10 Oct 2007 04:18:49 -0400 (EDT)
• References: <fefi66\$jd3\$1@smc.vnet.net>

```On Oct 9, 4:38 am, michael.p.crouc... at googlemail.com wrote:
> Hi All
>
> In version 5.2 If I do
>
> FunctionExpand[Sin[Pi/13]]
>
> I get a very complicated result involving lots of square roots.  This
> is also mentioned here:
>
> http://mathworld.wolfram.com/TrigonometryAnglesPi13.html
>
> But if I do the same thing in version 6.0 then I just get the result
>
> Sin[Pi/13]
>
> Which is not nearly as impressive.

The old behavior can be recovered by applying
Developer`TrigToRadicals.

As you can see, from the following example, it might not be a good
idea to apply this transformation via FunctionExpand/FullSimplify

In[5]:= ClearSystemCache[]
TimeConstrained[
Array[Sin[# Pi/13] &, 6, 1, Times] // Developer`TrigToRadicals //
FullSimplify, 60]

Out[6]= \$Aborted

In[7]:= ClearSystemCache[]
TimeConstrained[
Array[Cos[# Pi/13] &, 6, 1, Times] // Developer`TrigToRadicals //
FullSimplify, 60]

Out[8]= \$Aborted

FullSimplify in ver 6.0 easily handles these:

In[1]:= ClearSystemCache[]
Array[Sin[# Pi/13] &, 6, 1, Times] // FullSimplify // Timing

Out[2]= {0.406,Sqrt[13]/64}

In[3]:= ClearSystemCache[]
Array[Cos[# Pi/13] &, 6, 1, Times] // FullSimplify // Timing

Out[4]= {1.37694*10^-17,1/64}

Granted, Developer`TrigToRadicals might still be useful:

In[10]:= Sin[Pi/13] + Sin[3 Pi/13] + Sin[4 Pi/13] // FullSimplify

Out[10]= Cos[(5 \[Pi])/26]+Sin[\[Pi]/13]+Sin[(3 \[Pi])/13]

In[11]:= Developer`TrigToRadicals[%] // FullSimplify

Out[11]= Sqrt[13/8+(3 Sqrt[13])/8]

Developer`TrigToRadicals tends to produce bulky output, which
leads to slow-downs:

In[20]:= LeafCount[r1 = Sin[Pi/11] // Developer`TrigToRadicals]

Out[20]= 10193

In[26]:= ClearSystemCache[];
(nr1 = N[r1, 1000];) // Timing

Out[27]= {0.109,Null}

In[28]:= ClearSystemCache[];
(nr2 = N[Sin[Pi/11], 1000];) // Timing

Out[29]= {0.016,Null}

In[31]:= nr1 == nr2

Out[31]= True

If FullSimplify used Developer`TrigToRadicals it would have hard time
proving

In[32]:= Array[Sin[# Pi/11] &, 5, 1, Times] // FullSimplify // Timing

Out[32]= {0.172,Sqrt[11]/32}

In[33]:= Array[Cos[# Pi/11] &, 5, 1, Times] // FullSimplify // Timing

Out[33]= {0.,1/32}

Oleksandr Pavlyk
Wolfram Research

> What has changed with the
> FunctionExpand function in v6 that causes this and how do I get the
> original behaviour?
>
> Best Regards,
> Mike

```

• Prev by Date: Re: Mouse cursor properties
• Next by Date: "dereference" variable
• Previous by thread: Re: FunctionExpand problem in version 6
• Next by thread: Re: FunctionExpand problem in version 6