Re: Answer for Simplify[Cos[x]^4-Sin[x]^4]?
- To: mathgroup at smc.vnet.net
- Subject: [mg104600] Re: Answer for Simplify[Cos[x]^4-Sin[x]^4]?
- From: Bill Rowe <readnews at sbcglobal.net>
- Date: Wed, 4 Nov 2009 01:40:23 -0500 (EST)
On 11/3/09 at 2:51 AM, lawrenceteo at yahoo.com (Lawrence Teo) wrote:
>Thanks for the insight. So Simplify[] in Mathematica is right. But
>why I observe small delta if I subtract the two expressions with //
>N? Is it because of machine precision related limitation?
>a = Cos[x]^2 - Sin[x]^2
>b = Cos[x]^4 - Sin[x]^4
>Table[a - b, {x, -10, 10}] // N
>Return small delta...
The issue is the limitations of machine precision numbers. This
is easily demonstrated by
In[36]:= a = Cos[x]^2 - Sin[x]^2;
b = Cos[x]^4 - Sin[x]^4;
Union[Table[a - b, {x, -10, 10}] // Simplify]
Out[38]= {0}
or
In[39]:= Union[Table[a - b, {x, -10, 10}] // N // Chop]
Out[39]= {0}
or most directly by
In[41]:= a - b // Simplify
Out[41]= 0