Dismiss Notice
Join Physics Forums Today!
The friendliest, high quality science and math community on the planet! Everyone who loves science is here!

Integrating sin(x)*cos(x) paradox

  1. Oct 5, 2014 #1
    I am encountering a paradox when calculating the integral ##\int sin(x)\cos(x)\,dx## with integration by parts:

    Defining ##u = sin(x), v' = cos(x)##:

    ##\int sin(x)cos(x) dx = sin^2(x) - \int cos(x) sin(x) dx##

    ##\Leftrightarrow \int sin(x) * cos(x) dx = +1/2*sin^2(x)##.

    On the other hand, defining ##u = cos(x), v' = sin(x)##:

    ##\int sin(x)cos(x) dx = -cos^2(x) - \int cos(x) sin(x) dx##

    ##\Leftrightarrow \int sin(x) * cos(x) dx = -1/2*cos^2(x)##.



    ##1/2*sin^2(x) \neq -1/2*cos^2(x)##, and I know that the second one is the correct one. But I can't find an error in my upper calculation. Does somebody see the error I made?

    Thanks!
     
  2. jcsd
  3. Oct 5, 2014 #2

    ShayanJ

    User Avatar
    Gold Member

    [itex] \frac 1 2 \sin^2 x=\frac 1 2 (1-\cos^2 x)=-\frac 1 2 \cos^2 x + \frac 1 2=-\frac 1 2 \cos^2 x + const [/itex].
    So they are equivalent solutions for the integral!
     
  4. Oct 5, 2014 #3
    Oh, ok. So there's just a constant offset between the two solutions that we do not care about. :)
     
  5. Oct 5, 2014 #4
    The correct version of your first solution is that ##\int\sin x\cos x\ dx=\frac{1}{2}\sin x+C##, where ##\frac{1}{2}\sin^2 x+C## indicates the family of functions which differ from ##\frac{1}{2}\sin x## by a constant. ##\frac{1}{2}\sin^2 x## is a member of that family, as is ##-\frac{1}{2}\cos^2 x##. ##-\frac{1}{4}\cos 2x##, the "representative" you would have found if you had used the trig identity ##\sin x\cos x=\frac{1}{2}\sin 2x##, is also a member of that family.

    When you see a problem that asks you to compute ##\int f(x)\ dx##, it is essentially asking you to find all of the functions ##g## satisfying ##\frac{dg}{dx}=f(x)##. There's a theorem that says that any two functions ##g_1## and ##g_2## satisfying ##g_1'=g_2'## on an interval differ only by a constant on that interval. and so to answer the question of what is ##\int f(x)\ dx##, we need only find one function ##g## satisfying ##\frac{dg}{dx}=f(x)## (which I called a "representative" earlier), and every other function ##\tilde{g}## satisfying ##\frac{d\tilde{g}}{dx}=f(x)## is of the form ##\tilde{g}(x)=g(x)+c## for some constant ##c##.

    Now you can either understand all of that, or you can just know that you can't forget the ##+C## when you're doing indefinite integral. Most students learning this stuff for the first time chose the latter, although the former is not particular hard to wrap your head around. The bottom line is that we do care about the "constant offset", and it most definitely does matter.
     
Know someone interested in this topic? Share this thread via Reddit, Google+, Twitter, or Facebook




Similar Discussions: Integrating sin(x)*cos(x) paradox
  1. Integral sin(x)/x (Replies: 2)

Loading...