Results 1 to 6 of 6

Math Help - [maxima] approaching integral values

  1. #1
    Moo
    Moo is offline
    A Cute Angle Moo's Avatar
    Joined
    Mar 2008
    From
    P(I'm here)=1/3, P(I'm there)=t+1/3
    Posts
    5,618
    Thanks
    6

    [maxima] approaching integral values

    Hi !

    I just needed to compute (get an approximating value) \frac 23 \left(\int_0^1 x e^{x^2} ~dx+\int_1^2 e^{x^2} ~dx\right)

    I've taken a class in Maxima, but erm... either we didn't do integrals, either I forgot what we did lol!
    (the second option may be the more relevant ^^)

    I typed this (for the second one)
    Code:
    integrate(exp(x^2)*2/3, x, 1, 2)
    and it gives something with the erf function (nothing surprising)
    and when adding the float(...), it gives the erf function as well...

    And it looks like it works with Maple, but I don't have Maple, I'm a poor student... xD


    Anyway, do you know some good (and free) website where it is possible to compute such things ?

    Thanks
    Follow Math Help Forum on Facebook and Google+

  2. #2
    Grand Panjandrum
    Joined
    Nov 2005
    From
    someplace
    Posts
    14,972
    Thanks
    4
    Quote Originally Posted by Moo View Post
    Hi !

    I just needed to compute (get an approximating value) \frac 23 \left(\int_0^1 x e^{x^2} ~dx+\int_1^2 e^{x^2} ~dx\right)

    I've taken a class in Maxima, but erm... either we didn't do integrals, either I forgot what we did lol!
    (the second option may be the more relevant ^^)

    I typed this (for the second one)
    Code:
    integrate(exp(x^2)*2/3, x, 1, 2)
    and it gives something with the erf function (nothing surprising)
    and when adding the float(...), it gives the erf function as well...

    And it looks like it works with Maple, but I don't have Maple, I'm a poor student... xD


    Anyway, do you know some good (and free) website where it is possible to compute such things ?

    Thanks
    There is nothing wrong with the Maxima solution, its just that Maxima does not know enough about erfi to simplify it any further or eveluate it numerically.

    QuickMath will simplify it somewhat (not much though) but still leave an answer in terms of erfi.

    So if you are interested in a numerical value you may as well just go the whole hog and eveluate it as a numerical integral:

    Code:
    >lo=1;
    >hi=2;
    >
    >dx=(hi-lo)/1000;
    >
    >x=lo+dx/2:dx:hi;
    >
    >ii=(2/3)*exp(x^2);
    >
    >II=sum(ii)*dx
          10.9684 
    >
    CB
    Follow Math Help Forum on Facebook and Google+

  3. #3
    Moo
    Moo is offline
    A Cute Angle Moo's Avatar
    Joined
    Mar 2008
    From
    P(I'm here)=1/3, P(I'm there)=t+1/3
    Posts
    5,618
    Thanks
    6
    Yep, I had guessed that Maxima couldn't handle erfi.
    But I wanted to be sure, if there wasn't a way to make it calculate.

    As for the code... Actually, I was looking for a precise value (like it's given in Maple), because I wrote a code for estimating this value, with the Monte-Carlo method, and wanted to be sure I had the correct answer.
    So since I don't have maple, I wanted to try it with maxima

    or is there a table of approximated values for the erfi function, like for the z-table erf function ?


    thanks for your answer ^^
    Follow Math Help Forum on Facebook and Google+

  4. #4
    Grand Panjandrum
    Joined
    Nov 2005
    From
    someplace
    Posts
    14,972
    Thanks
    4
    Quote Originally Posted by Moo View Post
    Yep, I had guessed that Maxima couldn't handle erfi.
    But I wanted to be sure, if there wasn't a way to make it calculate.

    As for the code... Actually, I was looking for a precise value (like it's given in Maple), because I wrote a code for estimating this value, with the Monte-Carlo method, and wanted to be sure I had the correct answer.
    So since I don't have maple, I wanted to try it with maxima

    or is there a table of approximated values for the erfi function, like for the z-table erf function ?


    thanks for your answer ^^
    You do realise that a table of erfi will have been derived using a numerical technique (probably more elegant that the mid-point rule).

    I will look erfi up in Abramowitz and Stegun when I get back to where my copy is stashed (or you could look for the online version for yourself).

    CB
    Follow Math Help Forum on Facebook and Google+

  5. #5
    Grand Panjandrum
    Joined
    Nov 2005
    From
    someplace
    Posts
    14,972
    Thanks
    4
    Quote Originally Posted by Moo View Post
    Yep, I had guessed that Maxima couldn't handle erfi.
    But I wanted to be sure, if there wasn't a way to make it calculate.

    As for the code... Actually, I was looking for a precise value (like it's given in Maple), because I wrote a code for estimating this value, with the Monte-Carlo method, and wanted to be sure I had the correct answer.
    So since I don't have maple, I wanted to try it with maxima

    or is there a table of approximated values for the erfi function, like for the z-table erf function ?


    thanks for your answer ^^
    In a word (two actually but who's counting) "Dawson's Integral" (it's tabulated in Abramowitz and Stegun (which is available online, you will need to Google for it)).

    F(x)=e^{-x^2}\int_0^x e^{\xi^2}~d\xi

    CB
    Last edited by CaptainBlack; April 28th 2009 at 06:52 AM.
    Follow Math Help Forum on Facebook and Google+

  6. #6
    Moo
    Moo is offline
    A Cute Angle Moo's Avatar
    Joined
    Mar 2008
    From
    P(I'm here)=1/3, P(I'm there)=t+1/3
    Posts
    5,618
    Thanks
    6
    Quote Originally Posted by CaptainBlack View Post
    You do realise that a table of erfi will have been derived using a numerical technique (probably more elegant that the mid-point rule).

    I will look erfi up in Abramowitz and Stegun when I get back to where my copy is stashed (or you could look for the online version for yourself).

    CB
    I know, I just wanted sure ways of approximating it.
    Because our method consists in simulating random variables and then use the large of law numbers.
    So we wanted to know if there was any flaw in our program ^^

    In a word (two actually but who's counting) "Dawson's Integral" (it's tabulated in Abramowitz and Stegun (which is available online, you will need to Google for it)).

    F(x)=e^{-x^2}\int_0^x e^{\xi^2}~d\xi

    CB
    Thanks
    Follow Math Help Forum on Facebook and Google+

Similar Math Help Forum Discussions

  1. Replies: 2
    Last Post: March 26th 2010, 04:48 AM
  2. Replies: 6
    Last Post: March 3rd 2010, 04:31 PM
  3. Approaching complex problem.....
    Posted in the Calculus Forum
    Replies: 3
    Last Post: February 8th 2009, 05:41 PM
  4. Limits: h approaching zero
    Posted in the Calculus Forum
    Replies: 7
    Last Post: December 13th 2008, 01:57 PM
  5. approaching a limit
    Posted in the Pre-Calculus Forum
    Replies: 1
    Last Post: September 23rd 2008, 09:45 AM

Search Tags


/mathhelpforum @mathhelpforum