MathGroup Archive 2005

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

Search the Archive

Re: Trig functions expressed as Radicals

  • To: mathgroup at
  • Subject: [mg60080] Re: Trig functions expressed as Radicals
  • From: "Scout" <not at>
  • Date: Thu, 1 Sep 2005 02:13:14 -0400 (EDT)
  • References: <df3bfp$kmm$>
  • Sender: owner-wri-mathgroup at

Hi Mike,
I think that Mathematica treats unvaluated expressions
in order to save memory space, according with the "depth" of
representation of that particular expression.
If you try the Depth[expr] command you will receive how many
nested lists you need to represent the information.
In[1]:= FunctionExpand[Cos[Pi/7]];
In[2]:= Depth[%]
Out[2]= 15

In[3]:= FunctionExpand[Cos[Pi/2]];
In[4]:= Depth[%]
Out[4]= 1

Compare your own these results:

In[5]:= Cos[Pi/8]
Out[5]= Cos[Pi/8]
In[6]:= Depth[%]
Out[6]= 3

In[7]:= FunctionExpand[Cos[Pi/8]]
Out[7]= Sqrt[2+Sqrt[2]]/2
In[8]:= Depth[%]
Out[8]= 5


<mike_in_england2000 at>
> Hi
> When I ask mathematica what the value of Cos[Pi/4] is, it returns the
> well-known value 1/Sqrt[2].  Of course there are other values that it
> will evaluate in this way..for example Cos[Pi/6] returns Sqrt[3]/2
> Now if I put Cos[Pi/8] in then Mathematica returns it unevaluated.  I
> can get what I want using FunctionExpand[Cos[Pi/8]] but what I am
> wondering is why does Mathematica give the radical form of trig
> expressions like Cos[Pi/6] automatically but rquires the use of
> FunctionExpand[] for values like Cos[Pi/8].
> Is it something to do with the complexity of the result?  I know that
> FunctionExpand[Cos[Pi/23]] gives an extremely complicated result if you
> have the patience to wait for it (don't try and evaluate this unless
> you have a while) and so clearly it makes sense for mathematica to
> leave expressions like Cos[Pi/23] unevaluated unless the user explicity
> asks for it with FunctionExpand[].  If this is the case then what rules
> does Mathematica use in order to decide whether to leave the expression
> unevaluated or to give the radical form?
> Thanks
> Mike

  • Prev by Date: Re: How to assembly a stiffness matrix ?
  • Next by Date: Re: Best construct for control structure
  • Previous by thread: Set not-defeult options
  • Next by thread: Re: Trig functions expressed as Radicals