Calculating Surface Area and Surface Integrals restart:with(plots):with(LinearAlgebra): Let's calculate the surface area of a cone with a height of 1 and a base radius of 1. u:=<r*cos(theta),r*sin(theta),r>; plot3d([u],r=0..1,theta=0..2*Pi,axes=normal); Here the map command is used to distribute the differentiaion of r and theta over the components. udr:=map(diff,u,r);udtheta:=map(diff,u,theta); cross:=CrossProduct(udr,udtheta); Surface_area:=Int(Int(sqrt(cross[1]^2+cross[2]^2+cross[3]^2),theta=0..2*Pi),r=0..1)=int(int(sqrt(cross[1]^2+cross[2]^2+cross[3]^2),theta=0..2*Pi),r=0..1);; The following can be used to calculate the area of a surface given by a function of two variables. restart: f:=(x,y)->6-3*x-2*y; plot3d(f(x,y),x=0..3,y=0..4,view=[0..3,0..4,0..7],axes=boxed); fx:=diff(f(x,y),x);fy:=diff(f(x,y),y); Surface_area_2:=Int(Int(sqrt(fx^2+fy^2+1^2),y=0..3-3/2*x),x=0..2)=int(int(sqrt(fx^2+fy^2+1^2),y=0..3-3/2*x),x=0..2); The following is a plot of a surface between two cylinders. restart:with(plots): f:=(x,y)->x*y; a:=plot3d(f(x,y),x=-4..4,y=-4..4,color=blue);b:=implicitplot3d(x^2+y^2=1,x=-4..4,y=-4..4,z=-4..4):c:=implicitplot3d(x^2+y^2=4,x=-4..4,y=-4..4,z=-4..4): display(a,b,c,numpoints=10000,axes=normal,view=[-3..3,-3..3,-3..3]); The following example calculates the surface integral over the cone from above. In this case the cone will be given parametrically. restart:with(linalg):with(LinearAlgebra):with(plots): u:=<r*cos(theta),r*sin(theta),r>;f:=(x,y)->x*y;udr:=map(diff,u,r);udtheta:=map(diff,u,theta); param:=subs(x=u[1],y=u[2],z=u[3],f(x,y)); a:=plot3d([u],theta=0..2*Pi,r=0..1);b:=plot3d(f(r*cos(theta),r*sin(theta)),theta=0..2*Pi,r=0..1); display(a,b,axes=normal,scaling=constrained); mag:=simplify(norm(CrossProduct(udr,udtheta),2)); Surf_int:=Int(Int(param*mag,theta=0..Pi/2),r=0..1)=int(int(param*mag,theta=0..Pi/2),r=0..1); The following set of commands calculates the surface integral of a function over a surface defined by a function of two variables. restart: z:=6-3*x-2*y;g:=(x,y,z)->x*y*z;fx:=diff(z,x);fy:=diff(z,y); g:=subs(z=6-3*x-2*y,g(x,y,z)); Surf_int2:=Int(Int(g*sqrt(fx^2+fy^2+1^2),y=0..3-3/2*x),x=0..2)=int(int(g*sqrt(fx^2+fy^2+1^2),y=0..3-3/2*x),x=0..2); MAPLE does have a command for calculating surface integrals. Here it is for the prior example over the cone in the first octant. restart:with(LinearAlgebra):with(VectorCalculus):with(plots): SetCoordinates( cartesian[x,y,z] ): f:=x*y; r:=<u*cos(v),u*sin(v),u>; SurfaceInt(f,[x,y,z]=Surface(r,u=0..1,v=0..Pi/2),inert)=SurfaceInt(f,[x,y,z]=Surface(r,u=0..1,v=0..Pi/2),value); The following example is of calculating a Surface Integral over the vector field LUklbXJvd0c2Iy9JK21vZHVsZW5hbWVHNiJJLFR5cGVzZXR0aW5nR0koX3N5c2xpYkdGJzY0LUkobWZlbmNlZEdGJDYnLUYjNigtSSNtbkdGJDYlUSIwRicvJSVzaXplR1EjMTZGJy8lLG1hdGh2YXJpYW50R1Enbm9ybWFsRictSSNtb0dGJDYuUSIsRidGNEY3LyUmZmVuY2VHUSZmYWxzZUYnLyUqc2VwYXJhdG9yR1EldHJ1ZUYnLyUpc3RyZXRjaHlHRkAvJSpzeW1tZXRyaWNHRkAvJShsYXJnZW9wR0ZALyUubW92YWJsZWxpbWl0c0dGQC8lJ2FjY2VudEdGQC8lJ2xzcGFjZUdRJjAuMGVtRicvJSdyc3BhY2VHUSwwLjMzMzMzMzNlbUYnLUYjNigtSSNtaUdGJDYjUSFGJy1GIzYmLUY7Ni5RKiZ1bWludXMwO0YnRjRGN0Y+L0ZCRkBGREZGRkhGSkZML0ZPUSwwLjIyMjIyMjJlbUYnL0ZSRltvLUZXNiZRInlGJ0Y0LyUnaXRhbGljR0ZDL0Y4USdpdGFsaWNGJ0Y0RjdGOi1GVzYmUSJ6RidGNEZgb0Zib0Y0RjdGVkY0RjdGNEY3LyUlb3BlbkdRMyZMZWZ0QW5nbGVCcmFja2V0O0YnLyUmY2xvc2VHUTQmUmlnaHRBbmdsZUJyYWNrZXQ7RictRjs2L1EifkYnRjQvJTBmb250X3N0eWxlX25hbWVHUSVUZXh0RidGN0Y+RmluRkRGRkZIRkpGTEZOL0ZSRlAtRlc2J1Elb3ZlckYnRjQvRmFvRkBGYHBGN0ZdcC1GVzYnUSR0aGVGJ0Y0RmdwRmBwRjdGXXAtRlc2J1ErcGFyYWJhbG9pZEYnRjRGZ3BGYHBGN0ZdcC1GVzYnRmZvRjRGYG9GYHBGYm9GXXAtRjs2L1EiPUYnRjRGYHBGN0Y+RmluRkRGRkZIRkpGTC9GT1EsMC4yNzc3Nzc4ZW1GJy9GUkZkcUZdcC1JJW1zdXBHRiQ2JS1GVzYnUSJ4RidGNEZgb0ZgcEZiby1GIzYkLUYxNiZRIjJGJ0Y0RmBwRjdGNy8lMXN1cGVyc2NyaXB0c2hpZnRHUSIwRictRjs2L1EiK0YnRjRGYHBGN0Y+RmluRkRGRkZIRkpGTEZqbkZcby1GZ3E2JS1GVzYnRl9vRjRGYG9GYHBGYm9GXHJGYXItRjs2L1EiLkYnRjRGYHBGN0Y+RmluRkRGRkZIRkpGTEZORmNwRjRGNw== restart:with(linalg):with(LinearAlgebra): F:=<0,-y,z>; r:=<u^2*cos(v),u^2*sin(v),u>; rdu:=map(diff,r,u);rdv:=map(diff,r,v); cross:=CrossProduct(rdv,rdu); Fp:=subs(x=r[1],y=r[2],z=r[3],F); Integrand:=DotProduct(Fp,cross); Int(Int(Integrand,v=0..2*Pi),u=0..1)=int(int(Integrand,v=0..2*Pi),u=0..1); We got a positive answer for our surface integral, what does that tell us? Now we will recalculate the integral defining the surface as a function of 3 variables (as opposed to using its parameterization). restart:with(linalg):with(LinearAlgebra):with(VectorCalculus): F:=<0,-y,z>; f:=z-x^2-y^2; G:=Gradient( f, [x,y,z] ); G1:= -ConvertVector(G, 'free'); Dot:=DotProduct(F,G1); Integrand:=subs(z=x^2+y^2,Dot); Int(Int(Integrand,x=-sqrt(1-y^2)..sqrt(1-y^2)),y=-1..1)=int(int(Integrand,x=-sqrt(1-y^2)..sqrt(1-y^2)),y=-1..1); The following example calculates the flux of LUklbXJvd0c2Iy9JK21vZHVsZW5hbWVHNiJJLFR5cGVzZXR0aW5nR0koX3N5c2xpYkdGJzYnLUkjbWlHRiQ2I1EhRictRiM2JS1JKG1mZW5jZWRHRiQ2Jy1GIzYoLUYsNiZRInhGJy8lJXNpemVHUSMxNkYnLyUnaXRhbGljR1EldHJ1ZUYnLyUsbWF0aHZhcmlhbnRHUSdpdGFsaWNGJy1JI21vR0YkNi5RIixGJ0Y5L0ZAUSdub3JtYWxGJy8lJmZlbmNlR1EmZmFsc2VGJy8lKnNlcGFyYXRvckdGPi8lKXN0cmV0Y2h5R0ZKLyUqc3ltbWV0cmljR0ZKLyUobGFyZ2VvcEdGSi8lLm1vdmFibGVsaW1pdHNHRkovJSdhY2NlbnRHRkovJSdsc3BhY2VHUSYwLjBlbUYnLyUncnNwYWNlR1EsMC4zMzMzMzMzZW1GJy1GIzYoLUYsNiZRInlGJ0Y5RjxGP0ZCLUYjNiUtSSVtc3VwR0YkNiUtRiw2JlEiekYnRjlGPEY/LUkjbW5HRiQ2JVEiMkYnRjlGRi8lMXN1cGVyc2NyaXB0c2hpZnRHUSIwRidGOUZGRitGOUZGRitGOUZGRjlGRi8lJW9wZW5HUTMmTGVmdEFuZ2xlQnJhY2tldDtGJy8lJmNsb3NlR1E0JlJpZ2h0QW5nbGVCcmFja2V0O0YnRjlGRkYrRjlGRg== over a closed hemisphere of radius 1. This is the flux for the spherical part of the region restart:with(linalg):with(LinearAlgebra): F:=<x,y,z^2>; r:=<sin(phi)*cos(theta),sin(phi)*sin(theta),cos(phi)>; rdp:=map(diff,r,phi);rdt:=map(diff,r,theta); n:=CrossProduct(rdp,rdt); Since our orientation is away from the hemisphere, we want our normal vector to have a positive k component (point in positive z direction). Thus we will use n (as opposed to -n). Fp:=subs(x=r[1],y=r[2],z=r[3],F); Integrand:=simplify(DotProduct(Fp,n)); Int(Int(Integrand,phi=0..Pi/2),theta=0..2*Pi)=int(int(Integrand,phi=0..Pi/2),theta=0..2*Pi); We will now calculate the flux through the bottom of the surface. Since it is going away from the surface a normal vector would be LUklbXJvd0c2Iy9JK21vZHVsZW5hbWVHNiJJLFR5cGVzZXR0aW5nR0koX3N5c2xpYkdGJzYnLUkjbWlHRiQ2I1EhRictRiM2JS1JKG1mZW5jZWRHRiQ2Jy1GIzYoLUkjbW5HRiQ2JVEiMEYnLyUlc2l6ZUdRIzE2RicvJSxtYXRodmFyaWFudEdRJ25vcm1hbEYnLUkjbW9HRiQ2LlEiLEYnRjpGPS8lJmZlbmNlR1EmZmFsc2VGJy8lKnNlcGFyYXRvckdRJXRydWVGJy8lKXN0cmV0Y2h5R0ZGLyUqc3ltbWV0cmljR0ZGLyUobGFyZ2VvcEdGRi8lLm1vdmFibGVsaW1pdHNHRkYvJSdhY2NlbnRHRkYvJSdsc3BhY2VHUSYwLjBlbUYnLyUncnNwYWNlR1EsMC4zMzMzMzMzZW1GJy1GIzYoRjZGQC1GIzYmLUZBNi5RKiZ1bWludXMwO0YnRjpGPUZEL0ZIRkZGSkZMRk5GUEZSL0ZVUSwwLjIyMjIyMjJlbUYnL0ZYRl1vLUY3NiVRIjFGJ0Y6Rj1GOkY9RitGOkY9RitGOkY9RjpGPS8lJW9wZW5HUTMmTGVmdEFuZ2xlQnJhY2tldDtGJy8lJmNsb3NlR1E0JlJpZ2h0QW5nbGVCcmFja2V0O0YnRjpGPUYrRjpGPQ== since that is perpendicular to the surface and points away from the region. n2:=<0,0,-1>; Dot:=DotProduct(F,n2); Since we are in the plane z = 0, we can substitute that value in to calculate our integrand. The disk LUklbXJvd0c2Iy9JK21vZHVsZW5hbWVHNiJJLFR5cGVzZXR0aW5nR0koX3N5c2xpYkdGJzYnLUkjbWlHRiQ2I1EhRictRiM2J0YrLUYjNihGKy1GIzYpRistRiM2JS1JJW1zdXBHRiQ2JS1GLDYmUSJ4RicvJSVzaXplR1EjMTZGJy8lJ2l0YWxpY0dRJXRydWVGJy8lLG1hdGh2YXJpYW50R1EnaXRhbGljRictSSNtbkdGJDYlUSIyRidGPS9GRFEnbm9ybWFsRicvJTFzdXBlcnNjcmlwdHNoaWZ0R1EiMEYnRj1GSi1JI21vR0YkNi5RIitGJ0Y9RkovJSZmZW5jZUdRJmZhbHNlRicvJSpzZXBhcmF0b3JHRlUvJSlzdHJldGNoeUdGVS8lKnN5bW1ldHJpY0dGVS8lKGxhcmdlb3BHRlUvJS5tb3ZhYmxlbGltaXRzR0ZVLyUnYWNjZW50R0ZVLyUnbHNwYWNlR1EsMC4yMjIyMjIyZW1GJy8lJ3JzcGFjZUdGXm8tRiM2JS1GODYlLUYsNiZRInlGJ0Y9RkBGQ0ZGRkxGPUZKRitGPUZKLUZQNi5RJSZsZTtGJ0Y9RkpGU0ZWRlhGWkZmbkZobkZqbi9GXW9RLDAuMjc3Nzc3OGVtRicvRmBvRlxwLUZHNiVRIjFGJ0Y9RkpGPUZKRitGPUZKRitGPUZK just tells us what part of that plane we are interested in. Integrand2:=subs(z=0,Dot); Int(Int(Integrand2,x=-sqrt(1-x^2)..sqrt(i-x^2)),y=-1..1);evalf(%); LUklbXJvd0c2Iy9JK21vZHVsZW5hbWVHNiJJLFR5cGVzZXR0aW5nR0koX3N5c2xpYkdGJzYjLUkjbWlHRiQ2I1EhRic= Thus there is no flux on the disk, so what we calculated for the sphere is our result. LUklbXJvd0c2Iy9JK21vZHVsZW5hbWVHNiJJLFR5cGVzZXR0aW5nR0koX3N5c2xpYkdGJzYjLUkjbWlHRiQ2I1EhRic=