Ask your own question, for FREE!
Calculus1 15 Online
OpenStudy (gorica):

Can you help me to evaluate integral?

OpenStudy (gorica):

\[\int\limits_{-1}^{1} (x+e^{-\frac{ 1 }{ 2 }x^2}) dx\]

OpenStudy (gorica):

I know how to evaluate \[\int\limits_{-\infty}^{\infty} e^{-\frac{1}{2}x^2} dx\] but I don't know how to do it over interval [-1,1]

OpenStudy (solomonzelman):

you know what the integral of an x is going to be in this case.

OpenStudy (solomonzelman):

\(\large\color{black}{ e^{\frac{1}{2}x^2}}\) is not really an odd function, because the exponent wouldn't make it negative.

OpenStudy (solomonzelman):

wait, are you sure it is: \(\large\color{black}{\displaystyle\int\limits_{~}^{~} e^{\frac{1}{2}x^2}~dx}\) ? (without an x next to it) ?

hartnn (hartnn):

yeah, please verify whether x is added to e term or multiplied...

OpenStudy (gorica):

yes. only there is minus sign in exponent

OpenStudy (solomonzelman):

\(\large\color{black}{\displaystyle\int\limits_{~}^{~} e^{-\frac{1}{2}x^2}~dx}\) ?

OpenStudy (gorica):

\[\int\limits_{-1}^{1} (x+e^{-\frac{1}{2}x^2}) dx\]

hartnn (hartnn):

are you expecting answer in terms of error function erf ? http://www.wolframalpha.com/input/?i=integral+-1+to+1+++%28++e%5E%7B-x%5E2%2F2%7D%29

OpenStudy (gorica):

I took a look at wolfram before. In fact, I need only the value of that integral but I would like to know how to get it. I tried doing it using polar coordinates, but I got another value (1,572336)

OpenStudy (solomonzelman):

I was thinking of: \(\large\color{black}{\displaystyle\int\limits_{~}^{~} e^{-\frac{1}{2}x^2}~dx}\) \(\large\color{black}{\displaystyle\int\limits_{~}^{~} e^{-\frac{1}{2}x^2}~dx=xe^{-\frac{1}{2}x^2}+\displaystyle\int\limits_{~}^{~} x^2e^{-\frac{1}{2}x^2}~dx}\) \(\large\color{black}{\displaystyle\int\limits_{~}^{~} e^{-\frac{1}{2}x^2}~dx=xe^{-\frac{1}{2}x^2}+\displaystyle\int\limits_{~}^{~} \frac{x^2\times x}{x}e^{-\frac{1}{2}x^2}~dx}\) u=x^2, -4du=x dx, (again x^2=u, and) x=sqrt{-2u} \(\large\color{black}{\displaystyle\int\limits_{~}^{~} e^{-\frac{1}{2}x^2}~dx=xe^{-\frac{1}{2}x^2}-4\displaystyle\int\limits_{~}^{~} \frac{u}{\sqrt{-2u}}e^{u}~dx}\)

hartnn (hartnn):

is that the original question ? or a subpart of it...may we have a screenshot of the original Q ?

OpenStudy (solomonzelman):

I tried wolfram too, to see if it is that I am dump that can't do it, or is the problem un-do-able...

OpenStudy (solomonzelman):

in last line should be du, but it doesn't matter I either way can't do it...

hartnn (hartnn):

or if you have the answer, it may help

OpenStudy (solomonzelman):

the exponent is negative, so the graph is this: https://www.desmos.com/calculator/rf8bpeho1i

hartnn (hartnn):

even function, so you can as well try to evaluate from 0 to 1

OpenStudy (gorica):

Original question is to generate random numbers from distribution\[f(x) \approx x+e^{-\frac{x^2}{2}} , x\in[-1,1]\]. So I have to find a coefficient C such that \[\int\limits_{-1}^{1} Cf(x)=1\] so that f(x) is probability density function.

ganeshie8 (ganeshie8):

I think you can forget about \(x\) as it is odd : \[\int\limits_{-1}^{1} (x+e^{-\frac{1}{2}x^2}) dx = \int\limits_{-1}^{1} x~dx+\int\limits_{-1}^{1}e^{-\frac{1}{2}x^2}dx = 0 + \int\limits_{-1}^{1}e^{-\frac{1}{2}x^2}dx \]

ganeshie8 (ganeshie8):

evaluating that integral is trivial if you use error function

ganeshie8 (ganeshie8):

\[ \int\limits_0^x e^{-t^2} dt = \frac{\sqrt{\pi}}{2}\mathrm{erf x} \]

ganeshie8 (ganeshie8):

As a start substitute \(\frac{x}{\sqrt{2}} = u\)

OpenStudy (anonymous):

erf?

OpenStudy (gorica):

Ok, I have this: \[\int\limits_{-1}^{1} e^{-\frac{x^2}{2}} dx=\int\limits_{-1}^{1} e^{-u^2} \sqrt{2} du=\sqrt{2}\int\limits_{-1}^{1} e^{-u^2}du\] but now I stuck here :/ Can you help me about error function. How to use it?

ganeshie8 (ganeshie8):

so far so good!

hartnn (hartnn):

http://en.wikipedia.org/wiki/Error_function just for the reference

ganeshie8 (ganeshie8):

erf(x) is just a new function defined based on integrals like log function : \[\int e^{-t^2} dt = \frac{\sqrt{\pi}}{2}\mathrm{erf(x)} + C\]

hartnn (hartnn):

\(\int \limits_0^xe^{-t^2} dt = \frac{\sqrt{\pi}}{2}\mathrm{erf(x)} \)

OpenStudy (michele_laino):

I think that: \[\int\limits_{-1}^{1}e ^{-x ^{2}/2}dx=\sqrt{2 \pi}*68.27\] since the integral is proportional to the function erf(t)

ganeshie8 (ganeshie8):

\[\sqrt{2}\int\limits_{x=-1}^{x=1} e^{-u^2}du = \sqrt{2}\cdot \frac{\sqrt{\pi}}{2} \mathrm{erf(u)} \Bigg|_{x=-1}^{x=1}\]

ganeshie8 (ganeshie8):

evaluate ^

hartnn (hartnn):

or since \(e^{-u^2}\)is an even function, you can as well evaluate it from 0 to 1 and them multiply it by 2

OpenStudy (gorica):

\[\int\limits_{-1}^{1} e^{-\frac{u^2}{2}} du=-\int\limits_{0}^{-1}e^{-u^2} du+\int\limits_{0}^{1}e^{-u^2}du\] Can I do it like this? And then to use error function ?

ganeshie8 (ganeshie8):

you can do that but the indefinite integral form is more easy to use here. dont get so stuck up with the bounds

ganeshie8 (ganeshie8):

if you want to split the integral, use the fact that the integrand is even function : \[\int\limits_{-1}^{1} e^{-u^2} du=2\int\limits_{0}^{1}e^{-u^2}du \]

ganeshie8 (ganeshie8):

watch out - the bounds are referring to x

OpenStudy (gorica):

Let me summarize: 1. I write \[\int\limits_{1}^{1} e^{-\frac{x^2}{2}} dx = \int\limits_{-1}^{1} e^{-u^2} du\] 2. I use \[\int\limits_{0}^{x} e^{-u^2} du=\frac{ \sqrt{\pi} }{ 2 }erf(x)\] 3. I use \[\int\limits_{-1}^{1}e^{-u^2} du=2\int\limits_{0}^{1}e^{-u^2} du\] From 2 . I know that \[\int\limits_{0}^{1} e^{-u^2} du=\frac{ \sqrt{\pi} }{ 2 } erf(1)\] so\[\int\limits_{-1}^{1} e^{-u^2} du=\sqrt{\pi} \ erf(1)\] Is this ok? What is the value of erf(1)?

ganeshie8 (ganeshie8):

your steps are fine but you forgot to convert the bounds when you did u substitution

OpenStudy (gorica):

yes, right :) thanks

ganeshie8 (ganeshie8):

\[\int\limits_{-1}^{1} e^{-\frac{x^2}{2}} dx ~~\stackrel{u = x/\sqrt{2}}{===}~~\int\limits_{-1/\sqrt{2}}^{1/\sqrt{2}} e^{-u^2} \sqrt{2} ~du\] rest should be easy.. keep messing with it till you get the wolfram answer :)

OpenStudy (gorica):

\[\int\limits_{-1}^{1}e^{-\frac{x^2}{2}}dx=\int\limits_{-\frac{1}{\sqrt{2}}}^{\frac{1}{\sqrt{2}}}\sqrt{2}\ e^{-u^2}\ du\]\[=2\int\limits_{0}^{\frac{1}{\sqrt{2}}}\sqrt{2}e^{-u^2}du=2\sqrt{2}\frac{ \sqrt{\pi} }{ 2 }\ erf(\frac{1}{\sqrt{2}})\] \[=\sqrt{2\pi}\ erf(\frac{1}{\sqrt{2}})\] which is the result from wolfam, but I still don't know how how the value is 1.71125, i.e. I don't know what is the value of\[erf(\frac{1}{\sqrt{2}})\]

hartnn (hartnn):

you'll need to use calculator or a table like this : http://www.geophysik.uni-muenchen.de/~malservisi/GlobaleGeophysik2/erf_tables.pdf since , 1/sqrt 2 = 0.707 search for 0.7 row and column 0

OpenStudy (gorica):

Actually, I can use this since I have to use it in Matlab. A big Thank you to all of you. I haven't heard about error function for 5 years of studying and I think that's a shame. Thank you once again!!!

hartnn (hartnn):

its ok, thats why error function is not call as 'standard' function :P most of us are not familiar/comfortable using it. good luck!

OpenStudy (gorica):

Thank you very much :)

OpenStudy (michele_laino):

from my table I got: erf(0.71)= 26.11

OpenStudy (gorica):

If so, result wouldn't be the same as in wolfram

OpenStudy (michele_laino):

so you have to multiply 26.11 by 2 =52.22

OpenStudy (michele_laino):

and now?

hartnn (hartnn):

erf(0.70) = 0.6778 multiply that with \(\sqrt{2\pi}\) and you will have your wolf result :)

OpenStudy (michele_laino):

my result is multiplied by 100, so I have 0.5222

OpenStudy (gorica):

Thank you :) I think I can't express my thankfulness to all of you. You spent more than one hour helping me. I appreciate. I'm sorry I can give only one medal...

OpenStudy (michele_laino):

Thank you! @gorica

hartnn (hartnn):

we're not here for medals :) you understand, thats our medal, we're glad to help :)

OpenStudy (gorica):

Then I am sorry I can't send you a chocolate now :D

hartnn (hartnn):

lol i'll eat it myself, assuming you sent it ;)

hartnn (hartnn):

bdw, we won't mind pizza if not chocolate ;P

OpenStudy (gorica):

|dw:1419802055945:dw|

Can't find your answer? Make a FREE account and ask your own questions, OR help others and earn volunteer hours!

Join our real-time social learning platform and learn together with your friends!
Can't find your answer? Make a FREE account and ask your own questions, OR help others and earn volunteer hours!

Join our real-time social learning platform and learn together with your friends!