Section 16.2: Homework
MAT329
Andy Long

Clear[x,y,t];

#7, p. 1096:

(* Parameterize straight lines in the obvious way: *)
c1[t_]:={0,0}(1-t)+{2,1}t
c2[t_]:={2,1}(1-t)+{3,0}t
x1[t_]:=c1[t][[1]]
y1[t_]:=c1[t][[2]]
x2[t_]:=c2[t][[1]]
y2[t_]:=c2[t][[2]]
Show[{
ParametricPlot[c1[t],{t,0,1},PlotRange->All],
ParametricPlot[c2[t],{t,0,1},PlotRange->All]
}
]

Integrate[Dot[{x1[t]+2y1[t],x1[t]^2},c1'[t]],{t,0,1}]+Integrate[Dot[{x2[t]+2y2[t],x2[t]^2},c2'[t]],{t,0,1}]

#10, p. 1097:

f[x_,y_,z_]:=x y z^2
c[t_]:={-1,5,0}(1-t)+{1,6,4}t
x[t_]:=c[t][[1]]
y[t_]:=c[t][[2]]
z[t_]:=c[t][[3]]
Integrate[f[x[t],y[t],z[t]]*Norm[c'[t]],{t,0,1}]
N[%]

#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!:*)

#40, p. 1098:

Clear[F,r,x,y,t]
F[x_,y_]:={x^2,y E^x}
Show[
{VectorDensityPlot[F[x,y],{x,1,2},{y,0,1}],
ParametricPlot[{y^2+1,y},{y,0,1}]}
]
(* Parameterize the curve: *)
Clear[x,y,r]
x[t_]:=t^2+1
y[t_]:=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,1}]
N[%]