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

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

  1. Lawrence Teo

    Lawrence Teo Guest

    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
    #1
    1. Advertisements

  2. 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
    #2
    1. Advertisements

  3. Lawrence Teo

    CuppoJava Guest

    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
    #3
  4. Lawrence Teo

    Helen Read Guest

    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
    #4
  5. 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
    #5
  6. Lawrence Teo

    CuppoJava Guest

    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
    #6
  7. Lawrence Teo

    Helen Read Guest

    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
    #7
  8. Lawrence Teo

    David Reiss Guest

    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
    #8
  9. 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
    #9
  10. Lawrence Teo

    pratip Guest

    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
    #10
  11. Lawrence Teo

    Lawrence Teo Guest

    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
    #11
  12. Lawrence Teo

    DrMajorBob Guest

    Anything less than 10^-$MachinePrecision is zero.

    $MachinePrecision

    15.9546

    Bobby

     
    DrMajorBob, Nov 4, 2009
    #12
  13. Lawrence Teo

    David Park Guest

    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
    #13
  14. 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
    #14
    1. Advertisements

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.