MathGroup Archive 2009

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

Search the Archive

Re: Wrong Simplify[] Answer for Simplify[Cos[x]^4-Sin[x]^4]?

  • To: mathgroup at smc.vnet.net
  • Subject: [mg104513] Re: Wrong Simplify[] Answer for Simplify[Cos[x]^4-Sin[x]^4]?
  • From: Lawrence Teo <lawrenceteo at yahoo.com>
  • Date: Tue, 3 Nov 2009 02:51:06 -0500 (EST)
  • References: <hce437$r4t$1@smc.vnet.net> <hcgmni$cpe$1@smc.vnet.net>

Hi all,

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...
\!\({6.938893903907228`*^-17, 6.245004513516506`*^-17, 0.`,
    0.`, 7.025630077706069`*^-17, 0.`, 0.`, 3.854338723185968`*^-17,
0.`,
    1.1102230246251565`*^-16, 0.`, 1.1102230246251565`*^-16, 0.`, \
3.854338723185968`*^-17, 0.`, 0.`, 7.025630077706069`*^-17, 0.`, 0.`,
\
6.245004513516506`*^-17, 6.938893903907228`*^-17}\)



On Oct 31, 2:50 pm, Peter Breitfeld <ph... at t-online.de> wrote:
> Lawrence Teo wrote:
> > We know that Simplify[Cos[x]^2-Sin[x]^2] -> Cos[2 x]
> > But why Simplify[Cos[x]^4-Sin[x]^4] -> Cos[2 x] too?
>
> > Doing subtraction between the two expressions will give small delta.
> > This is enough to prove that the two expression shouldn't be the same.
>
> > Can anyone give me any insight? Thanks.
>
> it's simply true, because:
>
> cos^4 x - sin^4 x = (cos^2 x - sin^2 x)(cos^2 x + sin^2 x)
> = (cos^2 x - sin^2 x) * 1 = cos 2x
>
> --
> _________________________________________________________________
> Peter Breitfeld, Bad Saulgau, Germany --http://www.pBreitfeld.de



  • Prev by Date: Beginning syntax problems
  • Next by Date: Re: Conventional way of doing "struct"-like things?
  • Previous by thread: Re: Beginning syntax problems
  • Next by thread: Re: Re: Wrong Simplify[] Answer for Simplify[Cos[x]^4-Sin[x]^4]?