Path integrals

If you need to integrate a scalar-valued function over a curve, it is pretty straight-forward.  For example, to integrate f(x,y,z)=x^2y^3e^z over the curve Overscript[c, ](t)={t,Sin[t],Tan[t]}, 0≤t≤ π/4, you need to simply use ArcLengthFactor to convet ds to dt and compose f  and c:

f[{x_, y_, z_}] := x^2y^3^z

c[t_] := {t, Sin[t], Tan[t]}

f[c[t]]

^Tan[t] t^2 Sin[t]^3

ArcLengthFactor[c[t], t, Cartesian]

(1 + Cos[t]^2 + Sec[t]^4)^(1/2)

NIntegrate[f[c[t]] ArcLengthFactor[c[t], t, Cartesian], {t, 0, π/4}]

0.147696

If your curve (and function) is in some other coordinate system, you simply have to specify that in the ArcLengthFactor term.  (Be careful that you specify your variables in the order Mathematica expects them in for your coordinate system, both in f and in c.)


Created by Mathematica  (March 29, 2006) Valid XHTML 1.1!