Topics: Volume integral
Given
A solid body is defined by
\(
0\leq x\leq 2,\qquad
0\leq y\leq 3,\qquad
0\leq z\leq x+y.
\)
Python script ▼
import numpy as np
import plotly.graph_objects as go
fig = go.Figure()
# --------------------------------------------------
# 1. Bottom surface: z = 0
# --------------------------------------------------
x = np.linspace(0, 2, 20)
y = np.linspace(0, 3, 20)
X, Y = np.meshgrid(x, y)
fig.add_trace(go.Surface(
x=X,
y=Y,
z=np.zeros_like(X),
opacity=0.5,
showscale=False,
name="z = 0"
))
# --------------------------------------------------
# 2. Top surface: z = x + y
# --------------------------------------------------
Z = X + Y
fig.add_trace(go.Surface(
x=X,
y=Y,
z=Z,
opacity=0.8,
showscale=False,
name="z = x + y"
))
# --------------------------------------------------
# 3. Side surface: x = 0
# 0 <= y <= 3
# 0 <= z <= y
# --------------------------------------------------
y = np.linspace(0, 3, 20)
z = np.linspace(0, 3, 20)
Y, Z = np.meshgrid(y, z)
# Keep only the region below z = y
Z = np.minimum(Z, Y)
fig.add_trace(go.Surface(
x=np.zeros_like(Y),
y=Y,
z=Z,
opacity=0.6,
showscale=False,
name="x = 0"
))
# --------------------------------------------------
# 4. Side surface: x = 2
# 0 <= y <= 3
# 0 <= z <= 2 + y
# --------------------------------------------------
y = np.linspace(0, 3, 20)
z = np.linspace(0, 5, 20)
Y, Z = np.meshgrid(y, z)
# Keep only the region below z = 2 + y
Z = np.minimum(Z, 2 + Y)
fig.add_trace(go.Surface(
x=2 * np.ones_like(Y),
y=Y,
z=Z,
opacity=0.6,
showscale=False,
name="x = 2"
))
# --------------------------------------------------
# 5. Side surface: y = 0
# 0 <= x <= 2
# 0 <= z <= x
# --------------------------------------------------
x = np.linspace(0, 2, 20)
z = np.linspace(0, 2, 20)
X, Z = np.meshgrid(x, z)
# Keep only the region below z = x
Z = np.minimum(Z, X)
fig.add_trace(go.Surface(
x=X,
y=np.zeros_like(X),
z=Z,
opacity=0.6,
showscale=False,
name="y = 0"
))
# --------------------------------------------------
# 6. Side surface: y = 3
# 0 <= x <= 2
# 0 <= z <= x + 3
# --------------------------------------------------
x = np.linspace(0, 2, 20)
z = np.linspace(0, 5, 20)
X, Z = np.meshgrid(x, z)
# Keep only the region below z = x + 3
Z = np.minimum(Z, X + 3)
fig.add_trace(go.Surface(
x=X,
y=3 * np.ones_like(X),
z=Z,
opacity=0.6,
showscale=False,
name="y = 3"
))
# --------------------------------------------------
# Layout
# --------------------------------------------------
fig.update_layout(
title="Solid: 0 ≤ x ≤ 2, 0 ≤ y ≤ 3, 0 ≤ z ≤ x + y",
scene=dict(
xaxis_title="x",
yaxis_title="y",
zaxis_title="z",
aspectmode="data"
)
)
fig.show()
Find
The volume of the body.
Solution
\(
\begin{array}{l}
\text{The volume gets calculated via:} \\
V=\int\int\int_V 1\;dV=\int_0^2 \int_0^3 \int_0^{x+y} 1\;dz\;dy\;dx. \\
\\
\text{Integration with respect to z:} \\
V=\int_0^2 \int_0^3 [z]_0^{x+y}\;dy\;dx =\int_0^2 \int_0^3 (x+y)\;dy\;dx. \\
\\
\text{Integration with respect to y:} \\
V=\int_0^2 [xy+\frac{y^2}{2}]_0^3\;dx =\int_0^2 (3x+\frac{9}{2})\;dx. \\
\\
\text{Integration with respect to x:} \\
V=[\frac{3x^2}{2}+\frac{9x}{2}]_0^2 = 6+9 = 15. \\
\end{array}
\)
Answer
The volume is \(15\;m^3\).