Section 16.2: Line Integrals
MAT329, Fall, 2015
Andy Long

Clear[x,y,t];

Example 4, p. 1091: although this graph isn’t included in the problem, we can think about it as this line integral in this vector field:

Show[
{
VectorDensityPlot[{y^2,x },{x,-5,4},{y,-3,2}]
,ParametricPlot[{5t-5,5t-3},{t,0,1}]
,ParametricPlot[{4-y^2,y},{y,-3,2}]
}
]

#8, p. 1096: similarly, we can think of this line integral in this vector field:

Show[
{
VectorDensityPlot[{x^2,y^2 },{x,0,4},{y,0,3}]
,ParametricPlot[{2Cos[t],2Sin[t]},{t,0,Pi/2}]
,ParametricPlot[{x,x/4+2},{x,0,4}]
}
]
(* this close-up shows us why the line integral along the arc of the circle is 0: *)
Show[
{
VectorDensityPlot[{x^2,y^2 },{x,0,2},{y,0,2}]
,ParametricPlot[{2Cos[t],2Sin[t]},{t,0,Pi/2}]
,ParametricPlot[{x,x/4+2},{x,0,4}]
}
]
(* Now let's do the integral more simply: using path independence, because this field is a gradient field. *)
y[x_]:=3/2(x-2)
Show[
{
VectorDensityPlot[{x^2,y^2 },{x,0,4},{y,0,3}]
,ParametricPlot[{x,y[x]},{x,2,4}]
}
]

Integrate[x^2 + y[x]^2y'[x],{x,2,4}]

#12, p. 1097:

f[x_,y_,z_]:=x^2+y^2+z^2
x[t_]:=t
y[t_]:=Cos[2t]
z[t_]:=Sin[2t]
ds[t_]:=Sqrt[x'[t]^2+y'[t]^2+z'[t]^2]

Integrate[f[x[t],y[t],z[t]]*ds[t],{t,0,2Pi}]

#32, p. 1097

Show[
{VectorDensityPlot[{x^2,x y},{x,-1,1},{y,-1,1}],
Plot[{Sqrt[1-x^2],-Sqrt[1-x^2]},{x,-1,1}]}
]
Clear[F,r,x,y]
F[x_,y_]:={x^2,x y}
(* Parameterize the curve: *)
x[t_]:=2Cos[t]
y[t_]:=2Sin[t]
(* create r[t]: *)
r[t_]:={x[t],y[t]}
(* create the line integral: *)
Integrate[Dot[F[x[t],y[t]],r'[t]],{t,0,2Pi}]
(* Now understand why you got the result you got!:*)