 Forum index » Science and Technology » Math » num-analysis
Author Message
Pratim Vakish
science forum beginner

Joined: 17 Jul 2006
Posts: 2 Posted: Mon Jul 17, 2006 2:27 pm    Post subject: Integrate erf type expression My question is probably very basic. I am a novice in the field.

I would like to compute/simplify the following expression:

Integrale [from -infinity to z] of [e^-(x-y)^2]dx

Best Peter Spellucci
science forum Guru

Joined: 29 Apr 2005
Posts: 702 Posted: Mon Jul 17, 2006 3:37 pm    Post subject: Re: Integrate erf type expression In article <13642928.1153146486183.JavaMail.jakarta@nitrogen.mathforum.org>,
Pratim Vakish <pratim_usc@hotmail.com> writes:
 Quote: My question is probably very basic. I am a novice in the field. I would like to compute/simplify the following expression: Integrale [from -infinity to z] of [e^-(x-y)^2]dx Could you please help? Best

what about a little substitution to get it into
const* integral_{-infinity to somewhere} exp(-t^2/2) dt
then using the normal distribution function?
hth
peter science forum beginner

Joined: 07 May 2006
Posts: 38 Posted: Mon Jul 17, 2006 4:16 pm    Post subject: Re: Integrate erf type expression On Mon, 17 Jul 2006 10:27:35 EDT, Pratim Vakish
<pratim_usc@hotmail.com> wrote:

 Quote: My question is probably very basic. I am a novice in the field. I would like to compute/simplify the following expression: Integrale [from -infinity to z] of [e^-(x-y)^2]dx Could you please help? Best

In what follows, I have used Mathematica's definitions of Erf and Erfc
as given here:
<http://mathworld.wolfram.com/Erf.html>
<http://mathworld.wolfram.com/Erfc.html>

Some authors define these functions without the factor 2/sqrt(pi).

Given
I = Int[-oo...z] e^-(x-y)^2 dx

= sqrt(pi)/2 Erf(x-y) | [-oo...z]

= sqrt(pi)/2 [ Erf(z-y) - Erf(-oo-y) ]

Now, Erf is an odd function and Erf(oo) = 1, so

I = sqrt(pi)/2 [ -Erf(y-z) + Erf(oo) ]

= sqrt(pi)/2 [ 1 - Erf(y-z) ]

I = sqrt(pi)/2 Erfc(y-z)

The 'erf' functions can be evaluated numerically using Mathematica
here:
<http://functions.wolfram.com/GammaBetaErf/>

Click on Erfc, then 'Evaluation'.

HTH Pratim Vakish
science forum beginner

Joined: 17 Jul 2006
Posts: 2 Posted: Mon Jul 17, 2006 10:20 pm    Post subject: Re: Integrate erf type expression Thank you very much for your answer Badger. Just an additional question to be sure I have fully understood. Let me consider this expression: I = Int[-oo...z] e^-1/2*((x-y)/0.1)^2 dx = sqrt(pi)/2 * Erf(x/(sqrt(2)*0.1) - y/((sqrt(2)*0.1))) | [-oo...z] = sqrt(pi)/2 [Erf(z/(sqrt(2)*0.1) - y/(sqrt(2)*0.1)) - Erf(-oo-y/(sqrt(2)*0.1)) ] Now, Erf is an odd function and Erf(oo) = 1, so I = sqrt(pi)/2 [ -Erf(y / (sqrt(2)*0.1) - z (sqrt(2)*0.1)) + Erf(oo) ] = sqrt(pi)/2 [ 1 - Erf(y/(sqrt(2)*0.1)-z/(sqrt(2)*0.1))] Now if I take the derivative of the expression above with respect to y, is it correct to say that it is equal to: = - sqrt(pi)/2*2/sqrt(pi) * 1/(sqrt(2)*0.1) * e^[(y/(sqrt(2)*0.1)-z/(sqrt(2)*0.1))] = -1/(sqrt(2)*0.1) * e^[(y/(sqrt(2)*0.1)-z/(sqrt(2)*0.1))] Is it correct? Is ther simplication I can do beforehand? science forum beginner

Joined: 07 May 2006
Posts: 38 Posted: Tue Jul 18, 2006 1:49 pm    Post subject: Re: Integrate erf type expression On Mon, 17 Jul 2006 18:20:54 EDT, Pratim Vakish
<pratim_usc@hotmail.com> wrote:

 Quote: Thank you very much for your answer Badger. Just an additional question to be sure I have fully understood. Let me consider this expression: I = Int[-oo...z] e^-1/2*((x-y)/0.1)^2 dx = sqrt(pi)/2 * Erf(x/(sqrt(2)*0.1) - y/((sqrt(2)*0.1))) | [-oo...z]

Not correct. Because of the constants you introduced into the
problem, there will be a new constant factor in the antiderivative.

To see this, let's say you want to evaluate

Int e^-( a (x-y) )^2 dx

where a is a real constant > 0 (this form is sufficient to do your new
integral).

Make the substitution

t = a (x-y)

Then dt = a dx, or dx = dt / a

The integral becomes

Int (1/a) e^-t^2 dt = sqrt(pi)/2 (1/a) Erf(t)

Notice the constant factor 1/a, and remember that the sqrt(pi)/2 is
present because of the way Mathematica defines the Erf function.

Now, substitute for t, and we have the antiderivative

sqrt(pi)/2 (1/a) Erf( a (x-y) )

For your new problem, you want to evaluate

I = Int[-oo...z] e^-1/2*((x-y)/0.1)^2 dx

which, if I'm reading it correctly, can be written

I = Int[-oo...z] e^-( (x-y) / (0.1 sqrt(2)) )^2 dx

= Int[-oo...z] e^-( 5 sqrt(2) (x-y) )^2 dx

So, using our result above, with a = 5 sqrt(2), we have

I = sqrt(pi)/2 1/(5 sqrt(2)) Erf( 5 sqrt(2) (x-y) ) | [-oo...z]

= sqrt(pi)/2 1/(5 sqrt(2)) [ Erf( 5 sqrt(2) (z-y) ) - Erf(-oo) ]

= sqrt(pi)/2 1/(5 sqrt(2)) [ -Erf( 5 sqrt(2) (y-z) ) + 1 ]

= sqrt(pi)/2 1/(5 sqrt(2)) [ 1 - Erf( 5 sqrt(2) (y-z) ) ]

I = sqrt(pi)/2 1/(5 sqrt(2)) Erfc( 5 sqrt(2) (y-z) )

 Quote: = sqrt(pi)/2 [Erf(z/(sqrt(2)*0.1) - y/(sqrt(2)*0.1)) - Erf(-oo-y/(sqrt(2)*0.1)) ] Now, Erf is an odd function and Erf(oo) = 1, so I = sqrt(pi)/2 [ -Erf(y / (sqrt(2)*0.1) - z (sqrt(2)*0.1)) + Erf(oo) ] = sqrt(pi)/2 [ 1 - Erf(y/(sqrt(2)*0.1)-z/(sqrt(2)*0.1))] Now if I take the derivative of the expression above with respect to y, is it correct to say that it is equal to: = - sqrt(pi)/2*2/sqrt(pi) * 1/(sqrt(2)*0.1) * e^[(y/(sqrt(2)*0.1)-z/(sqrt(2)*0.1))] = -1/(sqrt(2)*0.1) * e^[(y/(sqrt(2)*0.1)-z/(sqrt(2)*0.1))] Is it correct? Is ther simplication I can do beforehand?

Not correct. You say that you want the derivative with respect to y?
Why not with respect to z? I'll do it with respect to z.

I' = d/dz sqrt(pi)/2 1/(5 sqrt(2)) Erfc( 5 sqrt(2) (y-z) )

First, I have it that

d/dz Erfc( 5 sqrt(2) (y-z) )

= 2/sqrt(pi) [ e^-( 5 sqrt(2) (y-z) )^2 ] (5 sqrt(2))

and so

I' = e^-( 5 sqrt(2) (y-z) )^2

which is equivalent to the original integrand.

Now, you should do all the work yourself and see if you agree with
these results.  Display posts from previous: All Posts1 Day7 Days2 Weeks1 Month3 Months6 Months1 Year Oldest FirstNewest First
 The time now is Mon Mar 25, 2019 6:42 pm | All times are GMT Forum index » Science and Technology » Math » num-analysis
 Jump to: Select a forum-------------------Forum index|___Science and Technology    |___Math    |   |___Research    |   |___num-analysis    |   |___Symbolic    |   |___Combinatorics    |   |___Probability    |   |   |___Prediction    |   |       |   |___Undergraduate    |   |___Recreational    |       |___Physics    |   |___Research    |   |___New Theories    |   |___Acoustics    |   |___Electromagnetics    |   |___Strings    |   |___Particle    |   |___Fusion    |   |___Relativity    |       |___Chem    |   |___Analytical    |   |___Electrochem    |   |   |___Battery    |   |       |   |___Coatings    |       |___Engineering        |___Control        |___Mechanics        |___Chemical

 Topic Author Forum Replies Last Post Similar Topics randomized Donsker-type results gasparuk Math 1 Tue Jul 18, 2006 1:46 pm How to get the analytical PDF of this expression? glare22@gmail.com num-analysis 3 Thu Jul 13, 2006 9:08 am Simplifying Algebraic expression Jeffrey Spoon Math 4 Wed Jul 12, 2006 3:04 pm ? LS expression for A*x = b Cheng Cosine num-analysis 4 Tue Jul 11, 2006 11:27 pm Large deviations principles of Non-Freidlin-Wentzell type. jaykov1 Research 0 Sat Jul 08, 2006 11:31 pm