# How can I get the result of this triple Integral?

$$F_{z}=\iiint_{\Omega} \frac{z-a}{\left[x^{2}+y^{2}+(z-a)^{2}\right]^{\frac{3}{2}}} d v$$

$$\Omega$$: ImplicitRegion[x^2 + y^2 + z^2 <= r^2, {x, y, z}]

MMA code:

Clear["Global*"];
reg = ImplicitRegion[x^2 + y^2 + z^2 <= r^2, {x, y, z}];
f[x_, y_, z_] :=
\!$$TraditionalForm\\((z\ - \ a)$$/$$(x^2\ + \ y^2\ + \ \((z\ - \ a)$$^2)\)^$$(3/2)$$\);
Integrate[f[x, y, z], Element[{x, y, z}, reg],
Assumptions -> r > 0 && a > 0 ]


($Aborted) Or, Clear["Global*"]; reg = Ball[{0, 0, 0}, r]; f[x_, y_, z_] := (z - a)/(x^2 + y^2 + (z - a)^2)^(3/2); Integrate[f[x, y, z], Element[{x, y, z}, reg], Assumptions -> r > 0 && a > 0]  ($Aborted)

Both of them can't get the result:

$$- \cdot \frac{4 \pi R^{3}}{3} \cdot \frac{1}{a^{2}}$$

• Recommendation: Eliminate useless factors that have nothing to do with the problem, here $G$ and $\rho_0$. Mar 2, 2022 at 6:35
• Thanks, done. @David G. Stork Mar 3, 2022 at 2:37

After switching to the spherical coordinates, Mathematica is able to crack it:

Clear["Global*"];
Integrate[t^2*Sin[\[Theta]]*(z - a)/(x^2 + y^2 + (z - a)^2)^(3/2) /. {x ->
t*Cos[\[Phi]]*Sin[\[Theta]], y -> t*Sin[\[Phi]]*Sin[\[Theta]],
z -> t*Cos[\[Theta]]}, {t, 0, r}, {\[Phi], 0, 2*Pi}, {\[Theta], 0, Pi},
Assumptions -> r > 0 && a >= -r && a <= r]


ConditionalExpression[-((4*a*Pi)/3), a > 0]

Integrate[t^2*Sin[\[Theta]]*(z - a)/(x^2 + y^2 + (z - a)^2)^(3/2) /. {x ->
t*Cos[\[Phi]]*Sin[\[Theta]], y -> t*Sin[\[Phi]]*Sin[\[Theta]],
z -> t*Cos[\[Theta]]}, {t, 0, r}, {\[Phi], 0, 2*Pi}, {\[Theta],0,Pi}, Assumptions->r>0&&a > r]


-((4 \[Pi] r^3)/(3 a^2))

Maple 2021 confirms the former and the latter.

• Thanks a lot!! @user64494 Mar 3, 2022 at 1:22