copyright © 2000 by Paul Green and Jonathan Rosenberg
In this notebook, we will evaluate integrals of the form where C is a curve directed by a choice of
forward unit tangent vector T, and F is a vector field defined in a
vicinity of C. The key observation is
that if r(t) parametrizes C in such a way that the forward
direction corresponds to increasing t,
then we have the identity
, so that the integral takes the form
, where t0 and
t1 are the initial and
terminal values of the parameter t.
It is important to understand that the parametrization r(t) and the vector field
F are independent of one another
except for the requirement that the composition F(r(t)) must make sense for
all relevant values of t. Note also that all of this makes equally good sense in the plane,
where F and r each have two components, and in 3-space, where each has three
components.
[ y^2, (4-z^2)^(1/2), x]
along the twisted cubic parametrized and directed by
[ t, t^2, t^3]
for t between 0 and 1. We must express F in terms of the parameter:
[ t^4, (4-t^6)^(1/2), t]
Now we set
integrand=realdot(Fpar,diff(tcube,t))
t^4+2*(4-t^6)^(1/2)*t+3*t^3
This integral cannot be evaluated symbolically, so we evaluate it numerically in two different ways.
integral=double(int(integrand,t,0,1))
Warning: Explicit integral could not be found.
> In D:\matlabr11\toolbox\symbolic\@sym\int.m at line 58
integral =
2.8850
alternate=quad8(inline(vectorize(integrand)),0,1)
2.8850
[ 2*y, -3*x]
around the unit circle in the xy-plane, directed counterclockwise.
We proceed now to illustrate the fundamental theorem of line
integrals, which states that if F is
the gradient of a function f, and C is a directed curve originating at A and terminating at B, then . Let us set
H=jacobian(f,[x,y,z])
x*y+cos(y*z)+exp(x*z)
H =
[ y+z*exp(x*z), x-sin(y*z)*z, -sin(y*z)*y+x*exp(x*z)]
and evaluate along the twisted
cubic in two different ways.
[ t^2+t^3*exp(t^4), t-sin(t^5)*t^3, -sin(t^5)*t^2+t*exp(t^4)]
integrand=realdot(Hpar,diff(tcube,t))
t^2+t^3*exp(t^4)+2*(t-sin(t^5)*t^3)*t+3*(-sin(t^5)*t^2+t*exp(t^4))*t^2
-1+exp(1)+cos(1)
B=subs(tcube,t,1)
ans2=subs(f,[x,y,z],B)-subs(f,[x,y,z],A)
0 0
0
B =
1 1
1
ans2 =
2.2586
0 0
0
B =
1 1
1
ans2 =
2.2586
9.6955e-017
The difference here can be attributed to round-off error.
(5+x^2+2*y^2+3*z^2)^(1/2)
and C is the directed line segment from [1,3,4] to [0,-3,8].
In connection with the fundmental theorem of line integrals, it is of interest to be able to recognize when a vector field is a gradient and recover a function of which it is a gradient. A vector field is called conservative (the term has nothing to do with politics, but comes from the notion of "conservation laws" in physics) if its line integral over every closed curve is 0, or equivalently, if it is the gradient of a function. We recall that the curl of a gradient is always 0, and that a vector field whose curl is 0 is, at least locally, a gradient.
[ 2*x*(9+y^2-4*z^2)/(-9+x^2+y^2+z^2)^2, -2*y*(-18+x^2+5*z^2)/(-9+x^2+y^2+z^2)^2, 2*z*(-27+4*x^2+5*y^2)/(-9+x^2+y^2+z^2)^2]
[ 0, 0, 0]
We see that the curl of F3 is 0, and that F3 is defined
everywhere except on the sphere . Given any point pt inside the sphere, we can
integrate F3 along the directed line segment from a reference point (in
this case, the origin 0) to the given point, and that should recover a
function whose gradient is F3. Let us try it.
seg=t*pt
F3par=subs(F3,pt,seg)
integrand=realdot(F3par,diff(seg,t))
[ x, y, z]
seg =
[ t*x, t*y, t*z]
F3par =
[
2*t*x*(9+t^2*y^2-4*t^2*z^2)/(-9+t^2*x^2+t^2*y^2+t^2*z^2)^2,
-2*t*y*(-18+t^2*x^2+5*t^2*z^2)/(-9+t^2*x^2+t^2*y^2+t^2*z^2)^2,
2*t*z*(-27+4*t^2*x^2+5*t^2*y^2)/(-9+t^2*x^2+t^2*y^2+t^2*z^2)^2]
integrand =
2*t*x^2*(9+t^2*y^2-4*t^2*z^2)/(-9+t^2*x^2+t^2*y^2+t^2*z^2)^2-2*t*y^2*(-18+t^2*x^2+5*t^2*z^2)/(-9+t^2*x^2+t^2*y^2+t^2*z^2)^2+2*t*z^2*(-27+4*t^2*x^2+5*t^2*y^2)/(-9+t^2*x^2+t^2*y^2+t^2*z^2)^2
-(x^2+2*y^2-3*z^2)/(-9+x^2+y^2+z^2)
simplify(jacobian(f3,[x,y,z])-F3)
[ 0, 0, 0]
Show that there is a function, defined for positive x, y, and z, whose gradient is G3, as defined in the following cell. Find such a function and check your answer. Because G3 is not defined at the origin, you will need to change your reference point to some point with positive coordinates such as [1,1,1]. How will this affect the analogue of seg in Example 3?
G3=[ 2/x, -2/(y^2+z^2)*y, -2/(y^2+z^2)*z]
[ 2/x, -2/(y^2+z^2)*y, -2/(y^2+z^2)*z]
Caution: Sometimes integrating along rays is not the best way to find a function whose gradient is a given conservative vector field. The problem is that sometimes the line integral will be too complicated to evaluate, while one can still find the function by "integrating one variable at a time".
This vector field is conservative, since it is everywhere defined and
[ 0, 0, 0]
However, integrating F4 along rays starting from the origin is not the best way to find a function f of which F4 is the gradient. Instead, we try to solve the equations
df/dx=F4(1), df/dy=F4(2), df/dz=F4(3), one at a time. Since the y-dependence is the simplest, it's easiest to begin with the middle equation and let
cos(x^2*y)*exp(-z)-y^2/(1+z^4)
Then if we take
simplify(F4-jacobian(f1,[x,y,z]))
[ 3/(1+z^4), 0, -12*z^3*x/(1+z^4)^2]
we're reduced to a much simpler vector field, and if
3*x/(1+z^4)
then
simplify(F4-jacobian(f1+f2,[x,y,z]))
[ 0, 0, 0]
shows F4 is the gradient of:
cos(x^2*y)/exp(z)-y^2/(1+z^4)+3*x/(1+z^4)
1.
Let F be as in
Example 1. Evaluate along the directed
line segment from [0,0,0] to [1,1,1]. Do you expect the same answer as in
Example 1? What does this have to do with curl(F) ?
2. Find a function whose gradient is H2, defined below. Check your answer.
H2=[ 4*x/(1+2*x^2+3*y^2+z^4), 6*y/(1+2*x^2+3*y^2+z^4), 4*z^3/(1+2*x^2+3*y^2+z^4)]
3.
Evaluate both directly and
using the results of Additional Problem 2, where C is the elliptical spiral parametrized below, and t runs from 0 to 2*pi.
spiral=[ 2*cos(t),3*sin(t),2*t]