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

Discussion in 'Mathematica' started by Lawrence Teo, Oct 30, 2009.

1. ### Lawrence TeoGuest

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.

Lawrence Teo, Oct 30, 2009

2. ### Peter BreitfeldGuest

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, Oct 31, 2009

3. ### CuppoJavaGuest

cos(x)^4 - sin(x)^4 = (cos(x)^2 - sin(x)^2)(cos(x)^2 + sin(x)^2)

hope this helps
-Patrick

CuppoJava, Oct 31, 2009
4. The two expressions are in fact equal.

Cos[x]^4 - Sin[x]^4 factors into

(Cos[x]^2 + Sin[x]^2)(Cos[x]^2 - Sin[x]^2)

and Cos[x]^2 + Sin[x]^2 == 1 (Pythagorean Identity)

hence Cos[x]^4 - Sin[x]^4 == Cos[x]^2 - Sin[x]^2

QED

Helen Read, Oct 31, 2009
5. ### Peter BreitfeldGuest

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, Oct 31, 2009
6. ### CuppoJavaGuest

cos(x)^4 - sin(x)^4 = (cos(x)^2 - sin(x)^2)(cos(x)^2 + sin(x)^2)

hope this helps
-Patrick

CuppoJava, Oct 31, 2009
7. The two expressions are in fact equal.

Cos[x]^4 - Sin[x]^4 factors into

(Cos[x]^2 + Sin[x]^2)(Cos[x]^2 - Sin[x]^2)

and Cos[x]^2 + Sin[x]^2 == 1 (Pythagorean Identity)

hence Cos[x]^4 - Sin[x]^4 == Cos[x]^2 - Sin[x]^2

QED

Helen Read, Oct 31, 2009
8. ### David ReissGuest

Because

(Cos[x]^4 - Sin[x]^4) = (Cos[x]^2 - Sin[x]^2) (Cos[x]^2 + Sin[x]^2)

and

Cos[x]^2 + Sin[x]^2 = 1

--David

David Reiss, Oct 31, 2009
9. ### Szabolcs HorvátGuest

Cos[x]^4 - Sin[x]^4 ==
== (Cos[x]^2 + Sin[x]^2) * (Cos[x]^2 - Sin[x]^2) ==
== 1 * Cos[2x] ==
== Cos[2x]

Szabolcs Horvát, Oct 31, 2009
10. ### pratipGuest

Hi,
Please remember the basic identity
Cos[x]^2+Sin[x]^2=1 (* We multiply both sides of the
equation with (Cos[x]^2-Sin[x]^2) *)
=>(Cos[x]^2+Sin[x]^2)*(Cos[x]^2-Sin[x]^2)=1*(Cos[x]^2-Sin[x]
^2) (* remember (a+b)(a-b)=a^2-b^2 *)
=>(Cos[x]^4-Sin[x]^4)=Cos[2x]
Also for this type of doubt one can take help of the Plot function in
Mathematica.

Plot[Evaluate[{Cos[x]^4 - Sin[x]^4, Cos[2 x],
Cos[x]^2 - Sin[x]^2}], {x, -2 Pi, 2 Pi},
PlotStyle -> {{Red}, {Blue, Dashed}, {Cyan}}]

You will see all the three functions that we are plotting will
coincide.
Hope this helps you.

Regards,
Pratip

pratip, Oct 31, 2009
11. ### Lawrence TeoGuest

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}$$

Lawrence Teo, Nov 3, 2009
12. ### DrMajorBobGuest

Anything less than 10^-$MachinePrecision is zero.$MachinePrecision

15.9546

Bobby

DrMajorBob, Nov 4, 2009
13. ### David ParkGuest

Why do you use N? Mathematica is pretty smart and can handle many things
symbolically and exactly. So keep things that way as long as possible.

If you do use N then also use Chop.

David Park

http://home.comcast.net/~djmpark/

From: Lawrence Teo [mailto:]

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}$$

David Park, Nov 4, 2009
14. ### Szabolcs HorvátGuest

It's because of rounding errors.

http://mathworld.wolfram.com/RoundoffError.html

Try this instead of Table:

Plot[Cos[x]^2 - Sin[x]^2 - (Cos[x]^4 - Sin[x]^4), {x, 0, 2 Pi}]

Szabolcs Horvát, Nov 5, 2009