Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
Download
269 views
ubuntu2204
Kernel: SageMath 10.1

Triple integrals

DF(x,y,z)dxdydz\iiint_D F(x,y,z)dxdydz

The volume of a closed bounded region DD in the 3D space is V=DdV=D1dxdydzV=\iiint_D dV=\iiint_D 1dxdydz

Finding limits of integration in the order of dzdz dydy dxdx

  • Sketch the region of integration along with its shadow in the xyxy-plane

  • Find the zz-limits of integration

  • Find the yy-limits of integration

  • Find the xx-limits of integration

Example

Find the volume of the region DD enclosed by the surfaces z=x2+3y2z=x^2+3y^2 and z=8x2y2z=8-x^2-y^2.

reset() var('x, y, z') f1(x,y) = x^2+3*y^2 f2(x,y) = 8-x^2-y^2 surface = plot3d(f1(x,y), (x,-2,2), (y,-2,2), color='red', opacity = 0.5) surface += plot3d(f2(x,y), (x,-2,2), (y,-2,2), color='yellow', opacity = 0.5) region = implicit_plot3d(z, (x,-3,3), (y,-3,3), (z,-1,1), plot_points = 100, region=lambda x,y,z: x^2+3*y^2 <= 8-x^2-y^2) #region2 = implicit_plot3d( x^2+3*y^2 == 8-x^2-y^2, (x,-3,3), (y,-3,3), (z,-1,5), plot_points = 100, # region=lambda x,y,z:z <= x^2+3*y^2) (surface+region).show() f(x,y,z) = 1 print('The volume is', f(x,y,z).integral(z,f1(x,y),f2(x,y)).integral(y,-sqrt((4-x^2)/2),sqrt((4-x^2)/2)).integral(x,-2,2))
Graphics3d Object
The volume is 8*sqrt(2)*pi

Example

Set up the limits of integration for evaluating the triple integral of a function F(x,y,z)F(x, y, z) over the tetrahedron DD with vertices (0,0,0)(0, 0, 0), (1,1,0)(1, 1, 0), (0,1,0)(0, 1, 0), and (0,1,1)(0, 1, 1). Use the order of integration dydzdxdydzdx to find the volume of the tetrahedron.

reset() var('x, y, z') pa = vector([0,0,0]) pb = vector([1,1,0]) pc = vector([0,1,0]) pd = vector([0,1,1]) p =polygon3d([pa,pb,pd]) p +=polygon3d([pa,pb,pc]) p +=polygon3d([pa,pc,pd]) p +=polygon3d([pb,pc,pd]) p.show() f(x,y,z) = 1 print('The volume is', f(x,y,z).integral(z,0,y-x).integral(y,x,1).integral(x,0,1))
Graphics3d Object
The volume is 1/6

Average value of a function in the 3D space

Average value of F over D=1volume of DDFdV.\mbox{Average value of }F\mbox{ over }D={1\over\mbox{volume of }D}\iiint_DFdV.

Triple Integrals in Cylindrical Coordinates

frdzdrdθ\iiint f{\color{red}r}dzdrd\theta
  • Sketch the region of integration along with its "shadow" in the xyxy-plane.

  • Find the zz-limits of integration

  • Find the rr-limits of integration

  • Find the θ\theta-limits of integration

Example

Find the limits of integration in cylindrical coordinates for integrating a function f(r,θ,z)f(r,\theta, z) over the region DD bounded below by the plane z=0z = 0, laterally by the circular cylinder x2+(y1)2=1x^2 + ( y - 1)^2 = 1, and above by the paraboloid z=x2+y2z = x^2 + y^2.

x2+(y1)2=x2+y22y+1=r22rsin(θ)+1=1x^2 + ( y - 1)^2 = x^2+y^2-2y+1 = r^2 -2r\sin(\theta) +1 =1, so we have r=2sin(θ)r= 2\sin(\theta) for 0θπ0\leq\theta\leq\pi (note that the upper limit for θ\theta is only π\pi).

reset() var('x, y, z, r, t') f1(x,y) = x^2+y^2 surface = plot3d(f1(x,y), (x,-1,1), (y,0,2), color='red', opacity = 0.5) region = implicit_plot3d(z, (x,-1,1), (y,0,2), (z,-0.5,4), plot_points = 100, region = lambda x,y,z: x^2+(y-1)^2 <= 1, color="blue") #region2 = implicit_plot3d(x^2+(y-1)^2==1, (x,-1,1), (y,0,2), (z,0,4), plot_points = 100, # region = lambda x,y,z: z <= x^2+y^2) (surface + region).show() #surface.show() f(x,y,z) = 1 print('The volume is', f(x,y,z).integral(z,0,f1(x,y)).integral(y,1-sqrt(1-x^2),1+sqrt(1-x^2)).integral(x,-1,1)) f(r,t,z) = 1 f2(r,t) = r^2 print('The volume is', (f(r,t,z)*r).integral(z,0,f2(r,t)).integral(r,0,2*sin(t)).integral(t,0,pi))
Graphics3d Object
The volume is 3/2*pi The volume is 3/2*pi

Example

Find the centroid of the solid enclosed by the cylinder x2+y2=4x^2 + y^2 = 4, bounded above by the paraboloid z=x2+y2z = x^2 + y^2, and bounded below by the xyxy-plane.

reset() var('r, t, z') f(r,t,z) = 1 f1(r,t) = r^2 vol = (f(r,t,z)*r).integral(z,0,f1(r,t)).integral(r,0,2).integral(t,0,2*pi) print('The volume is', vol) print('The z-component of the centroid is ', (f(r,t,z)*z*r).integral(z,0,f1(r,t)).integral(r,0,2).integral(t,0,2*pi)/vol)
The volume is 8*pi The z-component of the centroid is 4/3

Triple Integrals in Spherical Coordinates

Spherical coordinates represent a point PP in space by ordered triples (ρ,ϕ,θ)(\rho,\phi,\theta),

  • ρ\rho is the distance from PP to the origin (ρ0\rho\geq 0).

  • ϕ\phi is the angle OP\vec{OP} makes with the positive zz-axis (0ϕπ0\leq \phi\leq\pi).

  • θ\theta is the angle from the cylindrical coordinate.

Equations relating spherical, cartesian, and cylindrical coordinates

r=ρsinϕ,x=rcosθ=ρsinϕcosθz=ρcosϕ,y=rsinθ=ρsinϕsinθρ=x2+y2+z2=r2+z2\begin{align*} {\color{red}r}=&\rho\sin\phi,\quad {\color{blue}x}={\color{red}r}\cos{\color{red}\theta}=\rho\sin\phi\cos\theta\\ {\color{red}z}=&\rho\cos\phi,\quad {\color{blue}y}={\color{red}r}\sin{\color{red}\theta}=\rho\sin\phi\sin\theta\\ \rho=&\sqrt{{\color{blue}x}^2+{\color{blue}y}^2+{\color{blue}z}^2}=\sqrt{{\color{red}r}^2+{\color{red}z}^2} \end{align*}

Example

Find a spherical coordinate equation for the cone z=x2+y2z = \sqrt{x^2 + y^2}

ρcos(ϕ)=ρsinθ\rho\cos(\phi) = \rho\sin\theta

How to integrate in spherical coordinates

  • Sketch the region of integration along with its "shadow" in the xyxy-plane.

  • Find the ρ\rho-limits of integration

  • Find the ϕ\phi-limits of integration

  • Find the θ\theta-limits of integration

Example

Find the volume of the ``ice cream cone" DD cut from the solid sphere ρ1\rho\leq1 by the cone ϕ=π/3\phi = \pi/3.

reset() var('x, y, z') region1 = implicit_plot3d(x^2+y^2+z^2-1, (x,-1,1), (y,-1,1), (z,0,1), region = lambda x,y,z: z >= 0, color="blue", opacity=0.5) region2 = implicit_plot3d(z-sqrt((x^2+y^2)/3), (x,-1,1), (y,-1,1), (z,0,1), region = lambda x,y,z: z >= 0, color="red", opacity=0.5) (region1+region2).show() f(p,phi,theta) = 1 vol = (f(p,phi,theta)*p^2*sin(phi)).integral(p,0,1).integral(phi,0,pi/3).integral(theta,0,2*pi) print('The volume is', vol)
The volume is 1/3*pi

Summary: coordinate conversion formulas

Cylindrical to Rectangular: x=rcosθ,y=rsinθ,z=zx=r\cos\theta,y=r\sin\theta,z=z Spherical to Rectangular: x=ρsinϕcosθ,y=ρsinϕsinθ,z=ρcosϕx=\rho\sin\phi\cos\theta,y=\rho\sin\phi\sin\theta,z=\rho\cos\phi Spherical to Cylindrical: r=ρsinϕ,z=ρcosϕ,θ=θr=\rho\sin\phi,z=\rho\cos\phi,\theta=\theta Corresponding formulas for dV in triple integrals: dV=dxdydz=dzrdrdθ=ρ2sinϕdρdϕdθdV=dxdydz=dzrdrd\theta={\rho}^2\sin \phi d\rho d\phi d\theta