CHAPTER 10 - Vectors and Analytic Geometry in Space

Section 10.1, page 794

Problem 30

>   eqn:=x^2-6*x*y(x)+8*y(x)^2-2*x-1=0;

eqn := x^2-6*x*y(x)+8*y(x)^2-2*x-1 = 0

>   slope:=solve(diff(eqn,x),diff(y(x),x));

slope := (x-3*y(x)-1)/(3*x-8*y(x))

>   subs(x=1,y(1)=1,slope);

3/5

So the slope of the graph is 3/5 at the point. A vector in this direction is [1,3/5], but to make it a unit vector, we divide by the length:

>   len:=sqrt(1^2+(3/5)^2);

len := 1/5*34^(1/2)

>   tanvec:=simplify([1/len,3/5/len]);

tanvec := [5/34*34^(1/2), 3/34*34^(1/2)]

>   opptanvec:=-tanvec;

opptanvec := [-5/34*34^(1/2), -3/34*34^(1/2)]

>   normvec:=[tanvec[2],-tanvec[1]];

normvec := [3/34*34^(1/2), -5/34*34^(1/2)]

>   oppnormvec:=-normvec;

oppnormvec := [-3/34*34^(1/2), 5/34*34^(1/2)]

>   oppnormvec[1]^2+oppnormvec[2]^2;

1

(Just checking.)

Section 10.2, page 804

Problem 53

>   P1:=[1,4,5]; P2:=[4,-2,7];

P1 := [1, 4, 5]

P2 := [4, -2, 7]

>   dotp:=(V,W)->V[1]*W[1]+V[2]*W[2]+V[3]*W[3];

dotp := proc (V, W) options operator, arrow; V[1]*W[1]+V[2]*W[2]+V[3]*W[3] end proc

>   P1-P2;

[-3, 6, -2]

>   dist:=sqrt(dotp(P1-P2,P1-P2));

dist := 7

>   direction:=(P2-P1)/dist;

direction := [3/7, -6/7, 2/7]

>   midpt:=(P1+P2)/2;

midpt := [5/2, 1, 6]

Section 10.3, page 812

Problem 57

>   y1:=3/2-x^2; y2:=x^2;

y1 := 3/2-x^2

y2 := x^2

>   xvals:=solve(y1=y2,x);

xvals := -1/2*3^(1/2), 1/2*3^(1/2)

At the first point:

>   tanvec1:=[1,subs(x=xvals[1],diff(y1,x))];

tanvec1 := [1, 3^(1/2)]

>   tanvec2:=[1,subs(x=xvals[1],diff(y2,x))];

tanvec2 := [1, -3^(1/2)]

We'll use the "dotp" program defined as above to get the angle between these vectors:

>   dotp:=(V,W)->V[1]*W[1]+V[2]*W[2];

dotp := proc (V, W) options operator, arrow; V[1]*W[1]+V[2]*W[2] end proc

>   angle1:=arccos(dotp(tanvec1,tanvec2)/sqrt(dotp(tanvec1,tanvec1)*dotp(tanvec2,tanvec2)));

angle1 := 2/3*Pi

Now for the second point:

>   tanvec1:=[1,subs(x=xvals[2],diff(y1,x))];

tanvec1 := [1, -3^(1/2)]

>   tanvec2:=[1,subs(x=xvals[2],diff(y2,x))];

tanvec2 := [1, 3^(1/2)]

Of course, since these are the same vectors in the opposite order, the angle is the same.

Section 10.4, page 820

Problem 37

We'll assume that the vertices are in fact those of a parallelogram. So we'll take two vectors AB and AD. We'll put them in three dimensions so we can take cross products.

>   AB:=[2,0,0]-[-1,2,0]; AD:=[4,3,0]-[-1,2,0];

AB := [3, -2, 0]

AD := [5, 1, 0]

>   cprod:=(V,W)->[V[2]*W[3]-V[3]*W[2],V[3]*W[1]-V[1]*W[3],V[1]*W[2]-V[2]*W[1]];

cprod := proc (V, W) options operator, arrow; [V[2]*W[3]-V[3]*W[2], V[3]*W[1]-V[1]*W[3], V[1]*W[2]-V[2]*W[1]] end proc

>   cprod(AB,AD);

[0, 0, 13]

So the area of the parallelogram is 13.

Section 10.5, page 827

Problem 27

We'll write the lines parametrically as follows:

>   line1:=[2*t+1,3*t+2,4*t+3]; line2:=[s+2,2*s+4,-4*s-1];

line1 := [2*t+1, 3*t+2, 4*t+3]

line2 := [s+2, 2*s+4, -4*s-1]

We want to solve for the values of s and t where the lines meet - you can only solve two equations for two unknowns, so we'll just use two of the coordinates (and then check the third -- remember, in general, lines in 3-space don't meet):

>   sol:=solve({line1[1]=line2[1],line1[2]=line2[2]},{s,t});

sol := {s = -1, t = 0}

>   subs(sol,line1),subs(sol,line2);

[1, 2, 3], [1, 2, 3]

So the intersection point is (1,2,3). To find the plane, note that from the parametrizations of the lines, the vectors

>   V1:=diff(line1,t); V2:=diff(line2,s);

V1 := [2, 3, 4]

V2 := [1, 2, -4]

are along the lines. We calculate their cross product using the cprod program from the preceding section:

>   plane:=cprod(V1,V2);

plane := [-20, 12, 1]

This is the normal vector to the plane, and we get the equation of the plane as:

>   -20*x+12*y+z=subs(x=1,y=2,z=3,-20*x+12*y+z);

-20*x+12*y+z = 7

Section 10.6, page 839

Problem 52

>   plot3d(x^2+y^2+1,x=-3..3,y=-3..3);

[Maple Plot]

A better parametrization is polar:

>   x:=r*cos(t); y:=r*sin(t);

x := r*cos(t)

y := r*sin(t)

>   plot3d([x,y,x^2+y^2+1],r=0..3,t=0..2*Pi);

[Maple Plot]

This is a paraboloid.

Section 10.7, page 846

Problem 43

We're starting from the equation rho = 1-cos(phi). We'll plot the surface using this as a parametrization:

>   x:=rho*sin(phi)*cos(theta); y:=rho*sin(phi)*sin(theta); z:=rho*cos(phi);

x := rho*sin(phi)*cos(theta)

y := rho*sin(phi)*sin(theta)

z := rho*cos(phi)

>   rho:=1-cos(phi);

rho := 1-cos(phi)

>   plot3d([x,y,z],theta=0..2*Pi,phi=0..Pi,scaling=constrained);

[Maple Plot]

The surface is "apple shaped" - the rotation of a cardioid around the z-axis.