Can you help me to evaluate integral?
\[\int\limits_{-1}^{1} (x+e^{-\frac{ 1 }{ 2 }x^2}) dx\]
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]
you know what the integral of an x is going to be in this case.
\(\large\color{black}{ e^{\frac{1}{2}x^2}}\) is not really an odd function, because the exponent wouldn't make it negative.
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) ?
yeah, please verify whether x is added to e term or multiplied...
yes. only there is minus sign in exponent
\(\large\color{black}{\displaystyle\int\limits_{~}^{~} e^{-\frac{1}{2}x^2}~dx}\) ?
\[\int\limits_{-1}^{1} (x+e^{-\frac{1}{2}x^2}) dx\]
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
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)
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}\)
is that the original question ? or a subpart of it...may we have a screenshot of the original Q ?
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...
in last line should be du, but it doesn't matter I either way can't do it...
or if you have the answer, it may help
the exponent is negative, so the graph is this: https://www.desmos.com/calculator/rf8bpeho1i
even function, so you can as well try to evaluate from 0 to 1
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.
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 \]
evaluating that integral is trivial if you use error function
\[ \int\limits_0^x e^{-t^2} dt = \frac{\sqrt{\pi}}{2}\mathrm{erf x} \]
As a start substitute \(\frac{x}{\sqrt{2}} = u\)
erf?
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?
so far so good!
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\]
\(\int \limits_0^xe^{-t^2} dt = \frac{\sqrt{\pi}}{2}\mathrm{erf(x)} \)
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)
\[\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}\]
evaluate ^
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
\[\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 ?
you can do that but the indefinite integral form is more easy to use here. dont get so stuck up with the bounds
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 \]
watch out - the bounds are referring to x
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)?
your steps are fine but you forgot to convert the bounds when you did u substitution
yes, right :) thanks
\[\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 :)
\[\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}})\]
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
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!!!
its ok, thats why error function is not call as 'standard' function :P most of us are not familiar/comfortable using it. good luck!
Thank you very much :)
from my table I got: erf(0.71)= 26.11
If so, result wouldn't be the same as in wolfram
so you have to multiply 26.11 by 2 =52.22
and now?
erf(0.70) = 0.6778 multiply that with \(\sqrt{2\pi}\) and you will have your wolf result :)
my result is multiplied by 100, so I have 0.5222
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...
Thank you! @gorica
we're not here for medals :) you understand, thats our medal, we're glad to help :)
Then I am sorry I can't send you a chocolate now :D
lol i'll eat it myself, assuming you sent it ;)
bdw, we won't mind pizza if not chocolate ;P
|dw:1419802055945:dw|
Join our real-time social learning platform and learn together with your friends!