1. Limited time only! Sign up for a free 30min personal tutor trial with Chegg Tutors
    Dismiss Notice
Dismiss Notice
Join Physics Forums Today!
The friendliest, high quality science and math community on the planet! Everyone who loves science is here!

Homework Help: Quick integral question

  1. Dec 12, 2009 #1
    1. The problem statement, all variables and given/known data
    [tex]
    \int \! \cos^2xdx[/tex]

    3. The attempt at a solution
    Letting u = x2 and du/dx = 2x

    To get 2x in to the integral, I multiply the outside by 1/2x?
    [tex]
    \frac{1}{2x} \int \! \cos (u) du [/tex]

    [tex]
    \frac{1}{2x} \sin (x^2) 2x + C[/tex]

    Even if I play around with this, I don't get anywhere near the correct answer, which is:

    [tex] \frac{1}{2}x + \frac{1}{4}\sin (2x) + C[/tex]

    There's something I'm not getting. Can someone please help? Thanks.
     
  2. jcsd
  3. Dec 12, 2009 #2

    tiny-tim

    User Avatar
    Science Advisor
    Homework Helper

    Hi iamsmooth! :smile:

    (try using the X2 tag just above the Reply box :wink:)
    Yes, you're confusing (cosx)2 with cos(x2) :wink:

    Try again, first using one of the standard trigonometric identities to get cos2x = a function of cos(2x) or sin(2x). :smile:
     
  4. Dec 12, 2009 #3
    Oh man, I'm an idiot... anyways...

    Trying with integration by parts (failing miserably):

    [tex]
    \int \cos^2dx [/tex]

    [tex]= \cos^2x(x) - \int 2 \cos x (x)[/tex]

    [tex]
    = \cos^2(x) - sin^2x(x)[/tex]

    [tex]
    = x(\cos^2x-sin^2x) = x(\cos2x)[/tex]

    Nope, still not getting anywhere.
     
  5. Dec 12, 2009 #4

    tiny-tim

    User Avatar
    Science Advisor
    Homework Helper

    Hi iamsmooth! :smile:

    No, the integral should be 2xcosxsinx …

    anyway, you can see that using v = x just makes it more complicated. :redface:

    If you must use integration by parts, use v = cosx, but my idea of rewriting cos2x first is much easier.
     
  6. Dec 12, 2009 #5
    Do you mean to rewrite it as:

    [tex]
    \int \cos 2x + \sin^2x dx[/tex]

    I can see that in this case cosx can be the derivative of sinx, does that mean I can use u-substitution and reverse chainrule this? I'm still unsure of how to tackle integrals. Like I know there's all these different ways of solving them, but I'm not sure how to identify what the situation is and thus know which method to use.

    From what I would do:
    1) If you see an expression and its derivative, use substitution
    2) If you see polynomial, just use reverse derivative rules
    3) Parts integration when all else fails?
     
    Last edited: Dec 12, 2009
  7. Dec 12, 2009 #6

    tiny-tim

    User Avatar
    Science Advisor
    Homework Helper

    Hi iamsmooth! :smile:

    To pass your exams, you really must learn your trigonometric identities …

    in this case, cos2x = 1/2 (1 + cos(2x)) :wink:
     
  8. Dec 12, 2009 #7
    How do you derive that equation from trig identities?

    [tex]
    cos^2x\,+\,sin^2x\,=\,1
    [/tex]

    If I manipulate this, I get cos2x = 1 - sin2x which is way wrong I guess :(

    I vaguely know trig identities, but I guess I'm really rusty on them... Am I supposed to just commit all of the stuff on this page: ( https://www.physicsforums.com/library.php?do=view_item&itemid=18 ) to memory?

    As you can see, I guess I wrongly tried to change this:

    [tex]
    \cos^2x\,-\,\sin^2x\,=\,\cos2x
    [/tex]

    into

    [tex]

    \cos^2x = \cos 2x + \sin^2x dx

    [/tex]

    Is there an easier trick for memorizing trig identities so I can derive them when I need them?
     
  9. Dec 12, 2009 #8

    tiny-tim

    User Avatar
    Science Advisor
    Homework Helper

    Hi iamsmooth! :smile:
    cos2x + sin2x = 1
    cos2x - sin2x = cos2x​
    add:
    2cos2x = 1 + cos2x​
    subtract:
    2sin2x = 1 - cos2x :wink:
    Sorry, but you do need to memorise all of them except the last four.

    The last four are too difficult to remember, but when needed you can work them out as follows …

    Sum or difference of sin always has a cos and a sin, just as in sin(A±B).

    Sum or difference of cos always has two coses or two sines, just as in cos(A±B).

    And a sum doesn't depend on the order, so it has to have cos the difference, which also doesn't; while a difference does, so it has to have sin the difference, which also does. :wink:
     
  10. Dec 12, 2009 #9
    I'll start trying to remember them then.

    Anyways this is what I have:

    [tex] \int \cos^2xdx = \int \frac{1+\cos 2x}{2}dx[/tex]

    Letting:
    [tex]u = 2x, du = 2dx, \frac{1}{2}du = dx[/tex]

    [tex]\int 1 + \cos (u) \frac{1}{2}du[/tex]

    [tex]
    = \frac{1}{2} \int 1 + \cos (u) du[/tex]

    [tex]
    = \frac{1}{2} [ x + \sin 2x ] + K[/tex]

    [tex]
    = \frac{x}{2} + \frac{\sin(2x)}{2} + K[/tex]

    I'm close to the right answer, but the second term should be [tex] \frac{\sin(2x)}{4} [/tex], where did I mess up? If I raise the u inside the cose by 1 exponent and divide, I get 1/4 but the exponent remains... not sure what's wrong here.

    Thanks.
     
  11. Dec 12, 2009 #10

    tiny-tim

    User Avatar
    Science Advisor
    Homework Helper

    Hi iamsmooth! :smile:

    You messed up twice :redface:
    You've left out the 2 in the original denominator.
    And you've left out a whole line, which is a really bad idea, especially since in this case you've made a mistake in the process …

    the integral of 1du is u (=2x), not x. :wink:
     
  12. Dec 12, 2009 #11
    [tex] \int \cos^2xdx = \int \frac{1+\cos 2x}{2}dx = \int (\frac{\cos2x}{2}+\frac{1}{2})dx[/tex]

    I was trying to group the +1/2 with the dx to remove it, but I guess you can't do that. Why is the integral of du = 2x?

    I let u = 2x, so the derivative would be du/dx = 2, which would make du = 2dx. I understand 2x would be the correct answer since the math works out, but I don't seem to be getting that for some reason.

    Is it the [itex]+\frac{1}{2}[/itex] term that becomes 2x? I got 1 = x (without denominator) because I just took the antiderivative.
     
    Last edited: Dec 12, 2009
  13. Dec 13, 2009 #12

    tiny-tim

    User Avatar
    Science Advisor
    Homework Helper

    Hi iamsmooth! :smile:

    (just got up :zzz: …)
    Yes, du = 2dx. :smile:

    Now integrate that … ∫du = ∫2dx, which is the same as ∫du = 2x (+ constant). :wink:

    I can't help feeling that if you wrote it out with the missing line inserted, you'd automatically get the right answer.
     
  14. Dec 14, 2009 #13
    Okay, I think I got this:

    [tex]
    \int \cos^2xdx = \int \frac{1+\cos 2x}{2}dx = \int (\frac{\cos2x}{2}+\frac{1}{2})dx
    [/tex]

    Moving the 1/2 to the side:
    [tex] \frac{1}{2} \int \cos2x + 1[/tex]

    Now keeping in mind that u = 2x, du = 2dx, 2du = dx, I can do the substitution:
    [tex]\frac{1}{4} \int \cos(u) + 2du[/tex]
    (Placing another 1/2 to the left of the integral to balance out the 2du)

    Now evaluating the integral:
    [tex]
    \frac{1}{4}\sin(u) + 2x[/tex]

    Subbing back in the value of u, and simplifying:
    [tex]
    \frac{\sin(2x)}{4} + \frac{x}{2}[/tex]

    I hope that's right. I just wasn't sure if the way I inserted the 2du was a legal move. Appreciate all the help, tiny-tim :D
     
  15. Dec 14, 2009 #14

    tiny-tim

    User Avatar
    Science Advisor
    Homework Helper

    Yes, that's ok, except

    i] about half-way down you got bored, and started leaving out the dx or du …

    you must keep them in …

    an ∫ is meaningless without a d(something) after it (and you'll lose marks in the exam unless the examiner thinks it's a typo), and if you keep them in you're much less likely to make a mistake (eg a factor of 2) when you change variables

    ii] you never needed to substitute for the ∫ 1/2 dx, did you? :wink:

    iii] don't say "keeping in mind" :rolleyes: … say "putting (or "let") u = 2x, du = 2dx"

    So the whole thing should look like:

    ∫cos2x dx

    = ∫(1 + cos2x)/2 dx

    putting u = 2x. du = 2dx,

    = x/2 + constant + ∫ 1/4 cosu du

    = x/2 + constant + 1/4 sinu

    = x/2 + 1/4 sin2x + constant :wink:
     
Share this great discussion with others via Reddit, Google+, Twitter, or Facebook