<s>[INST] Creating an integral to represent the volume of the intersection of two balls in cartesian coordinates The question states:
Let $A$ be the intersection of the balls
$x^2+y^2+z^2\leq 9$ and $x^2+y^2+(z-8)^2\leq 49$
I am asked to just set up the iterated triple integral that represents the volume of $A$ in cartesian coordinates.
What I am able to determine so far is that for the equation
$x^2+y^2+z^2\leq 9 $:
$-\sqrt{9-x^2-y^2}\leq z \leq \sqrt{9-x^2-y^2}$
$-\sqrt{9-x^2}\leq y \leq \sqrt{9-x^2}$
$-3\leq x \leq 3$
If I were to set up this integral it would be:
$\int_{-3}^{3}\int_{-\sqrt{9-x^2}}^{\sqrt{9-x^2}} \int_{-\sqrt{9-x^2-y^2}}^{\sqrt{9-x^2-y^2}} dzdydx$
But I don't know how I'm supposed to set up the intersection of the two balls?
I was thinking of setting the two equations equal to each other so that
$x^2+y^2\leq 9-z^2$ and
$x^2+y^2\leq 49-(z-8)^2$
so then I have $9-z^2=49-(z-8)^2$
Solving for $z$ I get $z=3/2$ but I don't know what to do with this information.
 [/INST] \begin{align}
V &= \int_{8-7}^{\frac32}\left(\int\int_{x^2+y^2 \le 49-(z-8)^2}\mathrm dx\mathrm dy\right)\mathrm dz + \int_{\frac32}^{3}\left(\int\int_{x^2+y^2 \le 9-z^2}\mathrm dx\mathrm dy\right)\mathrm dz\\
&=\int_{1}^{\frac32}\int_{-\sqrt{49-(z-8)^2}}^{\sqrt{49-(z-8)^2}}\int_{-\sqrt{49-(z-8)^2-y^2}}^{\sqrt{49-(z-8)^2-y^2}}\mathrm dx\mathrm dy\mathrm dz + \int_{\frac32}^{3}\int_{-\sqrt{9-z^2}}^{\sqrt{9-z^2}}\int_{\sqrt{9-z^2-y^2}}^{\sqrt{9-z^2-y^2}}\mathrm dx\mathrm dy\mathrm dz.
\end{align}
The idea is similar to what you mentioned when you wanted to compute each ball separately. The first term is the part of the intersection that is clipped by the second ball and the second term is the part clipped by the first ball.
</s>