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!

Wolfram Integrator Error, Am I Missing Something?

  1. Dec 13, 2011 #1
    So I put the function 1/(2*(cos(2*pi*x))^2+3*(sin(2*pi*x))^2) into the Wolfram indefinite integral calculator here: http://integrals.wolfram.com/index.jsp?expr=1%2F%282*%28cos%282*pi*x%29%29%5E2%2B3*%28sin%282*pi*x%29%29%5E2%29&random=false. And I get an antiderivative which when evaluated from 0 to 1 is clearly equal to 0.

    Now I take the same function and put it into Wolfram's definite integral calculator evaluated from 0 to 1 here: http://www.wolframalpha.com/input/?i=integrate+1%2F%282*%28cos%282*pi*x%29%29%5E2%2B3*%28sin%282*pi*x%29%29%5E2%29+dx+from+x%3D0+to+1. And I get 1/sqrt(6), what is going on with this discrepancy, is Wolfram wrong, or am I missing something?
     
  2. jcsd
  3. Dec 13, 2011 #2

    Office_Shredder

    User Avatar
    Staff Emeritus
    Science Advisor
    Gold Member

    That's crazy. Did you take the derivative of the function the indefinite integral calculator gives you to make sure it was right?

    Your function is always positive so it's clear that the answer of 0 is wrong
     
  4. Dec 13, 2011 #3
    I tried integrating your function using a TI-89, and I come up with a definite integral of (√6) / 6 when evaluated from 0 to 1.

    The indefinite integral is quite long ....
     
  5. Dec 13, 2011 #4

    Dick

    User Avatar
    Science Advisor
    Homework Helper

    You are hitting Wolfram Alpha in a weak point. It doesn't understand what you are going to do with the antiderivative. Your integral clearly goes to infinity as the upper limit of the definite integral goes to infinity. WA's indefinite integral doesn't. Because arctan is really multivalued unless you restrict the domain of tan. It gave you what is probably a valid antiderivative in a certain range of x. It's not valid on the whole range 0 to 1. I'll give it some points for getting the answer right when you told it the limits.
     
  6. Dec 13, 2011 #5
    So does that mean there is not one antiderivative for this function that works over any interval, but actually a plurality of them depending on what range of x values you are interested in?

    Although if that was the case I can't see how taking the derivative of all these different antiderivatives would give you the same function back.
     
  7. Dec 13, 2011 #6

    SammyS

    User Avatar
    Staff Emeritus
    Science Advisor
    Homework Helper
    Gold Member

    Look at a graph of the function that's given as the anti-derivative. It's discontinuous (with jump discontinuities) on the interval over which you are integrating.

    Here is what WolframAlpha shows. attachment.php?attachmentid=41923&stc=1&d=1323838474.gif
     

    Attached Files:

  8. Dec 13, 2011 #7

    Ray Vickson

    User Avatar
    Science Advisor
    Homework Helper

    Maple gives exactly the same thing (with slightly different ways of writing equivalent results). If you plot the antiderivative function F(x) as given by Mathematica or Maple, you will see it has jump discontinuities at x = 1/4 and x = 3/4. You could have a *continuous* antiderivative by essentially adding the jump discontinuity to the formula in (1/4,3/4) and once again in (3/4,1). Basically, this amounts to changing the constant of integration as you pass through x = 1/4 and again as you pass through x = 3/4. For that continuous antiderivative, Fc(x) we do, indeed, get the definite integral as the difference Fc(1)-Fc(0).

    Fortunately, both Mathematica and Maple are smart enough to know they must be more careful when dealing with the definite integral. In fact, we can get Maple to give us the appropriate result using the commands J1 := int(f,x=0..t) assuming t>0,t<1/4; and J2:=int(f,x=0..t) assuming t>1/4,t<3/4. The result for t>1/4, t<3/4 has an extra term that switches on at t = 1/4 (and again at t = 3/4), to give a continuous F(t).

    RGV
     
  9. Dec 14, 2011 #8

    D H

    User Avatar
    Staff Emeritus
    Science Advisor

    The integrand is always positive. How could a definite integral from 0 to some positive number ever be negative?

    What Mathematica is doing is using a substitution involving the principal branch of the inverse tangent that is only valid in the range x∈(-1/4,1/4).
     
Know someone interested in this topic? Share this thread via Reddit, Google+, Twitter, or Facebook




Similar Discussions: Wolfram Integrator Error, Am I Missing Something?
Loading...