Maple Lab 3 (Spring 2007 Math 251) 

Sections 05-07 

Answer Key 

Exercises 

 

Note: Use appropriate colors and plot options to make your plots look nice. The appearance of 

          you lab will be factored into your grade. You may add execution groups if you need more. 

          Please delete unused execution groups. 

> restart; 1; with(VectorCalculus); -1; with(plots); -1
 

Warning, the assigned names `<,>` and `<|>` now have a global binding 

Warning, these protected names have been redefined and unprotected: `*`, `+`, `-`, `.`, D, Vector, diff, int, limit, series 

Warning, the name changecoords has been redefined 

1. Consider the solid region E bounded by the following surfaces: 

   y = 1-x, z = 1-x^2, y = 0, x = 0, and z = 0. [See 15.7 problem #32] 

 

   Define a function f(x, y, z) = x+y^2+z^3.     

> f := proc (x, y, z) options operator, arrow; x+y^2+z^3 end proc; 1
 

(Typesetting:-mprintslash)([f := proc (x, y, z) options operator, arrow; (VectorCalculus:-`+`)((VectorCalculus:-`+`)(x, y^2), z^3) end proc], [proc (x, y, z) options operator, arrow; (VectorCalculus:-... 

> f(x, y, z); 1
 

x+y^2+z^3 

1(a).  Plot the 5 surfaces (in the same plot window) which define the bounded  

        region E. Use different colors for each surface.          

> top := plot3d([x, y, 1-x^2], x = 0 .. 1, y = 0 .. 1, color = blue); -1; bottom := plot3d([x, y, 0], x = 0 .. 1, y = 0 .. 1, color = green); -1; front := plot3d([x, 1-x, z], x = 0 .. 1, z = 0 .. 1, col...
top := plot3d([x, y, 1-x^2], x = 0 .. 1, y = 0 .. 1, color = blue); -1; bottom := plot3d([x, y, 0], x = 0 .. 1, y = 0 .. 1, color = green); -1; front := plot3d([x, 1-x, z], x = 0 .. 1, z = 0 .. 1, col...
top := plot3d([x, y, 1-x^2], x = 0 .. 1, y = 0 .. 1, color = blue); -1; bottom := plot3d([x, y, 0], x = 0 .. 1, y = 0 .. 1, color = green); -1; front := plot3d([x, 1-x, z], x = 0 .. 1, z = 0 .. 1, col...
top := plot3d([x, y, 1-x^2], x = 0 .. 1, y = 0 .. 1, color = blue); -1; bottom := plot3d([x, y, 0], x = 0 .. 1, y = 0 .. 1, color = green); -1; front := plot3d([x, 1-x, z], x = 0 .. 1, z = 0 .. 1, col...
top := plot3d([x, y, 1-x^2], x = 0 .. 1, y = 0 .. 1, color = blue); -1; bottom := plot3d([x, y, 0], x = 0 .. 1, y = 0 .. 1, color = green); -1; front := plot3d([x, 1-x, z], x = 0 .. 1, z = 0 .. 1, col...
 

> display({front, back, side, top, bottom}, orientation = [61, 71]); 1
 

Plot 

1(b). As in part (a), graph the all of the sides of the solid region E, but this time 

       get rid of the unnecessary parts of the boundary surfaces. 

> top1 := plot3d([x, y, 1-x^2], x = 0 .. 1, y = 0 .. 1-x, color = blue); -1; bottom1 := plot3d([x, y, 0], x = 0 .. 1, y = 0 .. 1-x, color = green); -1; front1 := plot3d([x, 1-x, z], x = 0 .. 1, z = 0 .....
top1 := plot3d([x, y, 1-x^2], x = 0 .. 1, y = 0 .. 1-x, color = blue); -1; bottom1 := plot3d([x, y, 0], x = 0 .. 1, y = 0 .. 1-x, color = green); -1; front1 := plot3d([x, 1-x, z], x = 0 .. 1, z = 0 .....
top1 := plot3d([x, y, 1-x^2], x = 0 .. 1, y = 0 .. 1-x, color = blue); -1; bottom1 := plot3d([x, y, 0], x = 0 .. 1, y = 0 .. 1-x, color = green); -1; front1 := plot3d([x, 1-x, z], x = 0 .. 1, z = 0 .....
top1 := plot3d([x, y, 1-x^2], x = 0 .. 1, y = 0 .. 1-x, color = blue); -1; bottom1 := plot3d([x, y, 0], x = 0 .. 1, y = 0 .. 1-x, color = green); -1; front1 := plot3d([x, 1-x, z], x = 0 .. 1, z = 0 .....
top1 := plot3d([x, y, 1-x^2], x = 0 .. 1, y = 0 .. 1-x, color = blue); -1; bottom1 := plot3d([x, y, 0], x = 0 .. 1, y = 0 .. 1-x, color = green); -1; front1 := plot3d([x, 1-x, z], x = 0 .. 1, z = 0 .....
 

> display({side1, front1, top1, bottom1, back1}, orientation = [16, 70]); 1
 

Plot 

1(c). Compute the integral using the orders of integration: 

       dz*dx*dyand dz*dx*dy. 

> int(int(int(f(x, y, z), z = 0 .. 1-x^2), x = 0 .. 1-y), y = 0 .. 1); 1
 

683/2520 

> int(int(int(f(x, y, z), z = 0 .. 1-x^2), y = 0 .. 1-x), x = 0 .. 1); 1
 

683/2520 

1(d). Compute the integral using the orders of integration: 

       dz*dx*dyand dz*dx*dy. 

> int(int(int(f(x, y, z), y = 0 .. 1-x), x = 0 .. sqrt(1-z)), z = 0 .. 1); 1
 

683/2520 

> int(int(int(f(x, y, z), y = 0 .. 1-x), z = 0 .. 1-x^2), x = 0 .. 1); 1
 

683/2520 

1(e). Compute the integral using the orders of integration: 

       dz*dx*dyand dz*dx*dy.  

 

       WARNING: You must break up the region into two pieces! 

> int(int(int(f(x, y, z), x = 0 .. sqrt(1-z)), y = 0 .. 1-sqrt(1-z)), z = 0 .. 1)+int(int(int(f(x, y, z), x = 0 .. 1-y), y = 1-sqrt(1-z) .. 1), z = 0 .. 1); 1
int(int(int(f(x, y, z), x = 0 .. sqrt(1-z)), y = 0 .. 1-sqrt(1-z)), z = 0 .. 1)+int(int(int(f(x, y, z), x = 0 .. 1-y), y = 1-sqrt(1-z) .. 1), z = 0 .. 1); 1
 

683/2520 

> int(int(int(f(x, y, z), x = 0 .. sqrt(1-z)), z = 1-(1-y)^2 .. 1), y = 0 .. 1)+int(int(int(f(x, y, z), x = 0 .. 1-y), z = 0 .. 1-(1-y)^2), y = 0 .. 1); 1
int(int(int(f(x, y, z), x = 0 .. sqrt(1-z)), z = 1-(1-y)^2 .. 1), y = 0 .. 1)+int(int(int(f(x, y, z), x = 0 .. 1-y), z = 0 .. 1-(1-y)^2), y = 0 .. 1); 1
 

683/2520 

2. Consider the solid region E bounded by the surfaces: 

   z = 1/4*x^2+1/9*y^2and z = 1. 

 

   Graph this region E (cut off unnecessary parts of the boundary 

   surfaces). 

> bottom3 := plot3d(1/4*x^2+1/9*y^2, x = -2 .. 2, y = -3*sqrt(1-1/4*x^2) .. 3*sqrt(1-1/4*x^2)); -1; top3 := plot3d(1, x = -2 .. 2, y = -3*sqrt(1-1/4*x^2) .. 3*sqrt(1-1/4*x^2)); -1
bottom3 := plot3d(1/4*x^2+1/9*y^2, x = -2 .. 2, y = -3*sqrt(1-1/4*x^2) .. 3*sqrt(1-1/4*x^2)); -1; top3 := plot3d(1, x = -2 .. 2, y = -3*sqrt(1-1/4*x^2) .. 3*sqrt(1-1/4*x^2)); -1
 

> display({bottom3, top3}, scaling = constrained, orientation = [48, 85]); 1
 

Plot 

2(a). Compute the volume of E. 

> volE := int(int(int(1, z = 1/4*x^2+1/9*y^2 .. 1), y = -3*sqrt(1-1/4*x^2) .. 3*sqrt(1-1/4*x^2)), x = -2 .. 2); 1
volE := int(int(int(1, z = 1/4*x^2+1/9*y^2 .. 1), y = -3*sqrt(1-1/4*x^2) .. 3*sqrt(1-1/4*x^2)), x = -2 .. 2); 1
 

(Typesetting:-mprintslash)([volE := 3*Pi], [3*Pi]) 

2(b). Find the centroid of E. 

> Myz := int(int(int(x, z = 1/4*x^2+1/9*y^2 .. 1), y = -3*sqrt(1-1/4*x^2) .. 3*sqrt(1-1/4*x^2)), x = -2 .. 2); 1
Myz := int(int(int(x, z = 1/4*x^2+1/9*y^2 .. 1), y = -3*sqrt(1-1/4*x^2) .. 3*sqrt(1-1/4*x^2)), x = -2 .. 2); 1
 

(Typesetting:-mprintslash)([Myz := 0], [0]) 

> Mxz := int(int(int(y, z = 1/4*x^2+1/9*y^2 .. 1), y = -3*sqrt(1-1/4*x^2) .. 3*sqrt(1-1/4*x^2)), x = -2 .. 2); 1
Mxz := int(int(int(y, z = 1/4*x^2+1/9*y^2 .. 1), y = -3*sqrt(1-1/4*x^2) .. 3*sqrt(1-1/4*x^2)), x = -2 .. 2); 1
 

(Typesetting:-mprintslash)([Mxz := 0], [0]) 

> Mxy := int(int(int(z, z = 1/4*x^2+1/9*y^2 .. 1), y = -3*sqrt(1-1/4*x^2) .. 3*sqrt(1-1/4*x^2)), x = -2 .. 2); 1
Mxy := int(int(int(z, z = 1/4*x^2+1/9*y^2 .. 1), y = -3*sqrt(1-1/4*x^2) .. 3*sqrt(1-1/4*x^2)), x = -2 .. 2); 1
 

(Typesetting:-mprintslash)([Mxy := 2*Pi], [2*Pi]) 

> CentroidE := `<,>`(Myz, Mxz, Mxy)/volE; 1
 

(Typesetting:-mprintslash)([CentroidE := Vector[column]([[0], [0], [2/3]], [ 

3. We can define 4D spherical coordinates as follows: 

  [Note: tau is the Greek letter "tau".] 

 

   x = rho*cos(theta)*sin(phi)*sin(tau), 

   y = rho*sin(theta)*sin(phi)*sin(tau), 

   z = rho*cos(phi)*sin(tau), and 

   t = rho*cos(tau) 

 

   where x, y, z, tare the 4D rectangular coordinates  

   and rho, theta, phi, tauare the 4D spherical coordinates. 

 

  As with the regular spherical coordinates, we make the following 

  restrictions:  0 < rho,  0 <= theta and theta <= 2*Pi,  and  0 <= phi and phi <= Pi.   

   

  In addition we require that:  0 <= tau and tau <= Pi. 

 

  Define the coordinate transformation functions:  

  x(rho, theta, phi, tau), y(rho, theta, phi, tau), z(rho, theta, phi, tau), and t(rho, theta, phi, tau). 

  (I will get you started with "x").  

> x := proc (rho, theta, phi, tau) options operator, arrow; rho*cos(theta)*sin(phi)*sin(tau) end proc; -1
 

> x(rho, theta, phi, tau); 1
 

rho*cos(theta)*sin(phi)*sin(tau) 

> y := proc (rho, theta, phi, tau) options operator, arrow; rho*sin(theta)*sin(phi)*sin(tau) end proc; -1
 

> y(rho, theta, phi, tau); 1
 

rho*sin(theta)*sin(phi)*sin(tau) 

> z := proc (rho, theta, phi, tau) options operator, arrow; rho*cos(phi)*sin(tau) end proc; -1
 

> z(rho, theta, phi, tau); 1
 

rho*cos(phi)*sin(tau) 

> t := proc (rho, theta, phi, tau) options operator, arrow; rho*cos(tau) end proc; -1
 

> t(rho, theta, phi, tau); 1
 

rho*cos(tau) 

3(a). Compute the Jacobian of the transformation between 

       4D spherical and 4D rectangular coordinates: 

 

       (i.e. find J = `∂`(x, y, z, t)/`∂`(rho, theta, phi, tau) ) 

 

> M, J := Jacobian([x(rho, theta, phi, tau), y(rho, theta, phi, tau), z(rho, theta, phi, tau), t(rho, theta, phi, tau)], [rho, theta, phi, tau], 'determinant'); 1
M, J := Jacobian([x(rho, theta, phi, tau), y(rho, theta, phi, tau), z(rho, theta, phi, tau), t(rho, theta, phi, tau)], [rho, theta, phi, tau], 'determinant'); 1
 

M, J := Matrix(%id = 149319864), cos(theta)^2*sin(phi)^3*sin(tau)^4*rho^3+sin(theta)^2*sin(phi)^3*sin(tau)^4*rho^3+cos(phi)^2*sin(tau)^4*rho^3*sin(theta)^2*sin(phi)+cos(phi)^2*sin(tau)^4*rho^3*cos(the...
M, J := Matrix(%id = 149319864), cos(theta)^2*sin(phi)^3*sin(tau)^4*rho^3+sin(theta)^2*sin(phi)^3*sin(tau)^4*rho^3+cos(phi)^2*sin(tau)^4*rho^3*sin(theta)^2*sin(phi)+cos(phi)^2*sin(tau)^4*rho^3*cos(the...
M, J := Matrix(%id = 149319864), cos(theta)^2*sin(phi)^3*sin(tau)^4*rho^3+sin(theta)^2*sin(phi)^3*sin(tau)^4*rho^3+cos(phi)^2*sin(tau)^4*rho^3*sin(theta)^2*sin(phi)+cos(phi)^2*sin(tau)^4*rho^3*cos(the...
M, J := Matrix(%id = 149319864), cos(theta)^2*sin(phi)^3*sin(tau)^4*rho^3+sin(theta)^2*sin(phi)^3*sin(tau)^4*rho^3+cos(phi)^2*sin(tau)^4*rho^3*sin(theta)^2*sin(phi)+cos(phi)^2*sin(tau)^4*rho^3*cos(the...
M, J := Matrix(%id = 149319864), cos(theta)^2*sin(phi)^3*sin(tau)^4*rho^3+sin(theta)^2*sin(phi)^3*sin(tau)^4*rho^3+cos(phi)^2*sin(tau)^4*rho^3*sin(theta)^2*sin(phi)+cos(phi)^2*sin(tau)^4*rho^3*cos(the...
M, J := Matrix(%id = 149319864), cos(theta)^2*sin(phi)^3*sin(tau)^4*rho^3+sin(theta)^2*sin(phi)^3*sin(tau)^4*rho^3+cos(phi)^2*sin(tau)^4*rho^3*sin(theta)^2*sin(phi)+cos(phi)^2*sin(tau)^4*rho^3*cos(the...
M, J := Matrix(%id = 149319864), cos(theta)^2*sin(phi)^3*sin(tau)^4*rho^3+sin(theta)^2*sin(phi)^3*sin(tau)^4*rho^3+cos(phi)^2*sin(tau)^4*rho^3*sin(theta)^2*sin(phi)+cos(phi)^2*sin(tau)^4*rho^3*cos(the...
M, J := Matrix(%id = 149319864), cos(theta)^2*sin(phi)^3*sin(tau)^4*rho^3+sin(theta)^2*sin(phi)^3*sin(tau)^4*rho^3+cos(phi)^2*sin(tau)^4*rho^3*sin(theta)^2*sin(phi)+cos(phi)^2*sin(tau)^4*rho^3*cos(the...
M, J := Matrix(%id = 149319864), cos(theta)^2*sin(phi)^3*sin(tau)^4*rho^3+sin(theta)^2*sin(phi)^3*sin(tau)^4*rho^3+cos(phi)^2*sin(tau)^4*rho^3*sin(theta)^2*sin(phi)+cos(phi)^2*sin(tau)^4*rho^3*cos(the...
 

> J := simplify(J); 1
 

(Typesetting:-mprintslash)([J := sin(phi)*sin(tau)^2*rho^3], [sin(phi)*sin(tau)^2*rho^3]) 

3(b). We define a 4D sphere (centered at the origin with radius R) 

       by the equation: x^2+y^2+z^2+t^2 = R^2. 

 

       Rewrite this equation in 4D spherical coordinates.  

> sphere := x(rho, theta, phi, tau)^2+y(rho, theta, phi, tau)^2+z(rho, theta, phi, tau)^2+t(rho, theta, phi, tau)^2 = R^2; 1
 

(Typesetting:-mprintslash)([sphere := rho^2*cos(theta)^2*sin(phi)^2*sin(tau)^2+rho^2*sin(theta)^2*sin(phi)^2*sin(tau)^2+rho^2*cos(phi)^2*sin(tau)^2+rho^2*cos(tau)^2 = R^2], [rho^2*cos(theta)^2*sin(phi...
(Typesetting:-mprintslash)([sphere := rho^2*cos(theta)^2*sin(phi)^2*sin(tau)^2+rho^2*sin(theta)^2*sin(phi)^2*sin(tau)^2+rho^2*cos(phi)^2*sin(tau)^2+rho^2*cos(tau)^2 = R^2], [rho^2*cos(theta)^2*sin(phi...
 

> sphere := simplify(sphere); 1
 

(Typesetting:-mprintslash)([sphere := rho^2 = R^2], [rho^2 = R^2]) 

3(c). We define the "hypervolume" of a 4D region X to be  

       where "dV" stands for the 4D volume element (i.e. after choosing  

       some order of integration we might have: dV = dx*dy*dz*dt). 

 

       Compute the "hypervolume" of the 4D sphere of radius R using 

       4D spherical coordinates. [Remember your Jacobian!] 

> int(int(int(int(J, rho = 0 .. R), theta = 0 .. 2*Pi), phi = 0 .. Pi), tau = 0 .. Pi); 1
 

1/2*R^4*Pi^2 

 

Note: The area of a circle of radius Ris Differentiate the formula for the area  

         with respect to R and you get 2*Pi*R which is the circumference! 

 

         The volume of a sphere of radius Ris Differentiate the formula for the volume  

         with respect to R and you get 4 which is the surface area! 

 

         If you differentiate the "hypervolume" of your sphere, you get the "hypersurface area". 

 

         Check out Wikipedia and Wolfram's Mathworld for more about hyperspheres: 

 

         http://en.wikipedia.org/wiki/Sphere 

         http://mathworld.wolfram.com/Hypersphere.html