       Re: Question on Integrate[ F . Dt[r], ?]

• To: mathgroup at yoda.physics.unc.edu
• Subject: Re: Question on Integrate[ F . Dt[r], ?]
• From: John Lee <lee at math.washington.edu>
• Date: Fri, 7 Feb 92 17:02:52 -0800

```To compute a potential from a form such as u[x,y]Dt[x]+v[x,y]Dt[y], you
need to integrate u w.r.t. x AND v w.r.t. y.  More precisely, if V is the
the equations

(1) D[V,x] = u
(2) D[V,y] = v

Integrating the first with respect to x, you get

V = intu + f[y]  (* the "constant of integration" can depend on y *)

Then, differentiating w.r.t. y and using (2),

v = D[V,y] = D[intu,y] + f'[y]

Finally, integrating w.r.t. y and solving for f gives

f[y] = intv - Int[ D[intu,y], y].

Plugging this in above, we get a formula for u.  Of course, this only works
if the vector field (u,v) is conservative, i.e. D[u,y] = D[v,x].

Here is a simple Mathematica function that implements this algorithm.

In:= Literal[Potential[ u_ Dt[x_] + v_ Dt[y_] ]] := Module[{intu,intv},
If[ Expand[D[u,y] - D[v,x] ] =!= 0,
(*then*) Print[ "Error: ",u Dt[x] + v Dt[y]," is not conservative" ];
Return[Null],
(*else*) intu = Integrate[u,x];
intv = Integrate[v,y];
Return[ intu + intv - Integrate[ D[ intu, y ], y]]
]];

In:= Potential[x Dt[x] + y Dt[y]]

2    2
x    y
Out= -- + --
2    2

In:= Potential[ x Dt[y] + y Dt[x]]

Out= x y

In:= Potential[ x y Dt[x] + y Dt[y]]

Error: x y Dt[x] + y Dt[y] is not conservative

In:= dV = (x^2-y^2) Dt[x] - 2 x y Dt[y];

In:= Potential[dV]

3
x       2
Out= -- - x y
3

You can probably find a fuller explanation of the mathematics in any

Jack Lee
Dept. of Mathematics
Univ. of Washington
Seattle, WA

```

• Prev by Date: Question on Integrate[ F . Dt[r], ?]
• Next by Date: crystal structure graphics??
• Previous by thread: Question on Integrate[ F . Dt[r], ?]
• Next by thread: crystal structure graphics??