Results 1 to 7 of 7

Math Help - Integration calculator error? doubt it.

  1. #1
    Member pberardi's Avatar
    Joined
    Dec 2008
    Posts
    85

    Integration calculator error? doubt it.

    Hi,
    When integrating 2sin(x)cos(x), I used a simple u sub and got sin^2(x), no big deal. However when I pop this into wolfram, it results in (-1/2)cos(2x). This is the link Wolfram Mathematica Online Integrator
    I take the derivative of what wolfram gives me and it certainly is not 2sin(x)cos(x). Can someone tell me what I did wrong please?
    Follow Math Help Forum on Facebook and Google+

  2. #2
    MHF Contributor
    skeeter's Avatar
    Joined
    Jun 2008
    From
    North Texas
    Posts
    11,621
    Thanks
    426
    you didn't do anything wrong.

    graph y = \sin^2{x} and y = -\frac{\cos(2x)}{2}

    ... what do you see?
    Follow Math Help Forum on Facebook and Google+

  3. #3
    Rhymes with Orange Chris L T521's Avatar
    Joined
    May 2008
    From
    Santa Cruz, CA
    Posts
    2,844
    Thanks
    3
    Quote Originally Posted by pberardi View Post
    Hi,
    When integrating 2sin(x)cos(x), I used a simple u sub and got sin^2(x), no big deal. However when I pop this into wolfram, it results in (-1/2)cos(2x). This is the link Wolfram Mathematica Online Integrator
    I take the derivative of what wolfram gives me and it certainly is not 2sin(x)cos(x). Can someone tell me what I did wrong please?
    Both are correct.

    Differentiate your solution, and you get 2\sin x\cos x

    However, when you differentiate -\tfrac{1}{2}\cos(2x), you get \sin(2x)

    But from trig, \sin(2x)=2\sin x\cos x.

    This shows that both solutions are the same

    Does this clarify things?

    EDIT: Skeeter beat me....
    Follow Math Help Forum on Facebook and Google+

  4. #4
    Super Member

    Joined
    May 2006
    From
    Lexington, MA (USA)
    Posts
    11,550
    Thanks
    541
    Hello, pberardi!

    When integrating 2\sin x\cos x, I used a simple u sub and got \sin^2\!x

    However when I pop this into wolfram, it results in: . -\tfrac{1}{2}\cos(2x)
    This is a classic problem/puzzle . . .


    You had: . 2\int\sin x(\cos x\,dx)

    . . You let: u \,=\,\sin x\quad\Rightarrow\quad du \,=\,\cos x\,dx

    . . Substitute: . 2\int u\,du \:=\:u^2+C

    . . Back-substitute: . \boxed{\sin^2\!x + C}


    We also have: . 2\int \cos x(\sin x\,dx)

    . . Let: u \,=\,\cos x\quad\Rightarrow\quad du \,=\,-\sin x\,dx \quad\Rightarrow\quad \sin x\,dx \,=\,-du

    . . Substitute: . 2\int u(-du) \:=\:-\int u\,du \:=\:-u^2 + C

    . . Back-substitute: . \boxed{-\cos^2\!x + C}


    We have the identity: . 2\sin\theta\cos\theta \:=\:\sin2\theta

    So: . \int2\sin x\cos x\,dx \:=\:\int\sin2x\,dx \:=\:\boxed{-\tfrac{1}{2}\cos2x + C}



    And all three answers are correct!

    Follow Math Help Forum on Facebook and Google+

  5. #5
    Member pberardi's Avatar
    Joined
    Dec 2008
    Posts
    85
    Ok that all makes sense, so they are the same function. But why is it that when I plug in pi/4 in sin^2(x) I get 1/2 and when I plug in pi/4 into (-1/2)cos(2x), I get 0? Shouldn't they give me the same answer? I know this is silly and I am probably just making a stupid error somewhere but I dont know where.
    Follow Math Help Forum on Facebook and Google+

  6. #6
    Flow Master
    mr fantastic's Avatar
    Joined
    Dec 2007
    From
    Zeitgeist
    Posts
    16,948
    Thanks
    5
    Quote Originally Posted by pberardi View Post
    Ok that all makes sense, so they are the same function. But why is it that when I plug in pi/4 in sin^2(x) I get 1/2 and when I plug in pi/4 into (-1/2)cos(2x), I get 0? Shouldn't they give me the same answer? I know this is silly and I am probably just making a stupid error somewhere but I dont know where.
    If you're using the anti-derivative to evaluate a definite integral, then you will be substituting two numbers (the upper terminal and the lower terminal). Then you will get the same answer, assuming you perform the calculation correctly.
    Follow Math Help Forum on Facebook and Google+

  7. #7
    MHF Contributor
    skeeter's Avatar
    Joined
    Jun 2008
    From
    North Texas
    Posts
    11,621
    Thanks
    426
    Quote Originally Posted by pberardi View Post
    Ok that all makes sense, so they are the same function. But why is it that when I plug in pi/4 in sin^2(x) I get 1/2 and when I plug in pi/4 into (-1/2)cos(2x), I get 0? Shouldn't they give me the same answer? I know this is silly and I am probably just making a stupid error somewhere but I dont know where.
    they are not the same function ... did you look at their graphs as I recommended?

    graph them. what do you see?
    Follow Math Help Forum on Facebook and Google+

Similar Math Help Forum Discussions

  1. Replies: 2
    Last Post: May 6th 2012, 02:16 PM
  2. Error in Integration....
    Posted in the Calculus Forum
    Replies: 9
    Last Post: March 7th 2010, 04:10 AM
  3. Using Calculator for Integration
    Posted in the Calculus Forum
    Replies: 3
    Last Post: February 18th 2010, 03:19 PM
  4. Replies: 4
    Last Post: March 2nd 2009, 09:09 AM
  5. Replies: 1
    Last Post: August 5th 2007, 01:17 AM

Search Tags


/mathhelpforum @mathhelpforum