Message Boards Message Boards

0
|
3859 Views
|
5 Replies
|
4 Total Likes
View groups...
Share
Share this post:

[?] Avoid problem with the parametrization of a line integral?

Posted 5 years ago

Hello everyone. I have parametrized a straight line to go from point A (0,0) to point B (2,3) with two different aproaches. The first, is to make x=2t and y=3t and 0<t<1. The second one is to make x=rcos(ArcTg(2/3)) and y=rsin(ArcTg(2/3)); however, I obtain results that are different enough to make me think that I am doing something wrong. However, I don't seem to find where the problem lies at.

This is my code for the first method:

varianza= 2;
Integrate[(Sqrt[2^2 + 3^2]*Exp[(-1.)*((2*t)^2 + (3*t)^2)/(2.*varianza)]/(2*Pi*varianza)), {t, 0, 1}]

and the output is 0.139526.

And for the second:

angulo = ArcTan[2, 3];
Integrate[(r*Exp[(-1.)*((Cos[angulo]*r)^2 + (Sin[angulo]*r)^2)/(2.*varianza)]/(2*Pi*varianza)), {r, 0, Sqrt[2^2+3^2]}];

with output: 0.152984.

I cannot find what is wrong with this. Any help is appreciated. Thanks.

POSTED BY: Jaime de la Mota
5 Replies

But you could change your integral to a real line-integral of 1st kind by deleting the SquareRoot[ 13 ] from your integrand. I take a constant factor out of the integral:

In[1]:= xx[t_] := 2 t; yy[t_] := 3 t;
varianza = 2;
integral = 
 1/(2 Pi*varianza) Integrate[( Exp[(-1.) ((xx[t])^2 + (yy[t])^2)/(2. varianza)]) Sqrt[
     D[xx[t], t]^2 + D[yy[t], t]^2], {t, 0, 1}]


Out[3]= 0.139526

or

In[4]:= xx[t_] := t Cos[ArcTan[3/2]]; yy[t_] := t Sin[ArcTan[3/2]];
varianza = 2;
integral = 
 1/(2 Pi*varianza) Integrate[( Exp[(-1.) ((xx[t])^2 + (yy[t])^2)/(2. varianza)]) Sqrt[
     D[xx[t], t]^2 + D[yy[t], t]^2], {t, 0, Sqrt[13]}]


Out[6]= 0.139526
POSTED BY: Hans Dolhaine

And another remark. If you really want to do a line integral (1st type of line integral of a function f[ x, y ] along a line { x[ t ], y[ t ] } ) this is defined (there are good reasons for this definition) by

J = Integral[ f[x[t], y[t] ]  Sqrt[D[x[t], t]^2 + D[y[t], t]^2],  {t, t1, t2}]

giving in your case

xx[t_] := 2 t; yy[t_] := 3 t;

In[2]:= varianza = 2;
integral = 
 Integrate[(Sqrt[2^2 + 3^2] Exp[(-1.) ((xx[t])^2 + (yy[t])^2)/(2. varianza)]/(2 Pi*varianza)) Sqrt[
   D[xx[t], t]^2 + D[yy[t], t]^2], {t, 0, 1}]

Out[3]= 0.503068
POSTED BY: Hans Dolhaine

Should you want to proceed from {0,0} to {2,3} in a nonlinear way (nonlinear means, the straight line remains straight, but is divided in non-uniform intervals), e.g.

t = r^n/Sqrt[13];

then

xx[r_] := r^n Cos[w]; yy[r_] := r^n Sin[w];   

Indeed

In[3]:= w = ArcTan[3/2];
{xx[13^(1/(2 n))], yy[13^(1/(2 n))]} // PowerExpand

Out[4]= {2, 3}

and

In[5]:= varianza = 2;
integral = 
 Integrate[(Sqrt[2^2 + 3^2] Exp[(-1.) ((xx[r])^2 + (yy[r])^2)/(2. varianza)]/(2 Pi*varianza)) D[t, r], 
{r, 0,13^(1/(2 n))}]

Out[6]= (1/(4 \[Pi]))n If[n > 0, 1.75333/n, 
  Integrate[E^(-0.25 r^(2 n)) r^(-1 + n), {r, 0, 13^(1/(2 n))}, 
   Assumptions -> n <= 0]]

Looks complicated, but

In[7]:= Simplify[integral, n > 0]
Out[7]= 0.139526
POSTED BY: Hans Dolhaine

Thank you very much. This is mostly helpful.

POSTED BY: Jaime de la Mota

1) your integral is not really a line-integral. 2) your ArcTan seems to be wrong:

define, as you do

xx[r_] := r Cos[w]; yy[r_] := r Sin[w];

then with

In[2]:= w = ArcTan[2/3];
{xx[Sqrt[2^2 + 3^2]], yy[Sqrt[13]]}

Out[3]= {3, 2}

and that is not your B.

Then if you change your parameter from t to r your Integral should read (rule of Substitution)

Integrate[f[x[t], y[t]], t] ==  Integrate[f[x[t[r]], y[t[r]]] D[t, r], r]

Taking into account that your t-Domain ( 0, 1 ) is mapped unto the r -Domain ( 0, Sqrt[ 13 ] ) one can say

t = r / Sqrt[ 13 ]

Hence

D[ t, r ] = 1 / Sqrt[ 13 ]

With this and the correct ArcTan you get

In[13]:= varianza = 2; w = ArcTan[3/2]; 
Integrate[(Sqrt[2^2 + 3^2] Exp[(-1.) ((xx[r])^2 + (yy[r])^2)/(2. varianza)]/(2 Pi*varianza)) 1/Sqrt[13], 
{r, 0, Sqrt[2^2 + 3^2]}]        

Out[13]= 0.139526
POSTED BY: Hans Dolhaine
Reply to this discussion
Community posts can be styled and formatted using the Markdown syntax.
Reply Preview
Attachments
Remove
or Discard

Group Abstract Group Abstract