# Integrate $\frac{1}{\sqrt{x^2+y^2+z^2}}$ in parallelepiped

The question is how to find this integral:

$$\int\limits_{x_1}^{x_2}dx\int\limits_{y_1}^{y_2}dy\int\limits_{z_1}^{z_2}dz\frac{1}{\sqrt{x^2+y^2+z^2}}$$

where $$x_i,y_i,z_i \in \mathbb{R}$$

I think that idea to solve it in spherical coordinates is bad due to non reduceable inequalities, so I try to find it in Cartesian coordinates. So, here is some additional formulas:

\begin{align} \textbf{I}_1 &= \int\limits_a^b dx \ln \left| \alpha+\sqrt{\beta^2+x^2} \right| \\ &= x \ln\left| \alpha+\sqrt{\beta^2+x^2} \right| \Bigg|_{x=a}^b - \frac{1}{2}\int\limits_a^b \frac{d(\beta^2+x^2)}{\sqrt{\beta^2+x^2}(\alpha+\sqrt{\beta^2+x^2})} \\&= \Big[ \beta^2+x^2=\xi^2 \Big] \\&= x\ln\left| \alpha+\sqrt{\beta^2+x^2} \right| \Bigg|_{x=a}^b - \int\limits_{\sqrt{\beta^2+a^2}}^{\sqrt{\beta^2+b^2}} \frac{d \xi}{\alpha + \xi} \\ &=b \ln\left| \alpha+\sqrt{\beta^2+b^2} \right| - a \ln\left| \alpha+\sqrt{\beta^2+a^2} \right| - \ln\left| \frac{\alpha+\sqrt{\beta^2+a^2}}{\alpha+\sqrt{\beta^2+b^2}} \right| \end{align} So, using $\textbf{I}_1$ we can calculate this: \begin{align} \textbf{I}_2&=\int\limits_a^b dx \ln \left| \frac{\alpha_1+\sqrt{\beta_1^2+x^2}}{\alpha_2+\sqrt{\beta_2^2+x^2}} \right| \\ &= b \ln \left| \frac{\alpha_1+\sqrt{\beta_1^2+b^2}}{\alpha_2+\sqrt{\beta_2^2+b^2}} \right| - a \ln \left| \frac{\alpha_1+\sqrt{\beta_1^2+a^2}}{\alpha_2+\sqrt{\beta_2^2+a^2}} \right| \\&- \ln \left| \frac{\alpha_1+\sqrt{\beta_1^2+a^2}}{\alpha_1+\sqrt{\beta_1^2+b^2}} \right| + \ln \left| \frac{\alpha_2+\sqrt{\beta_2^2+a^2}}{\alpha_2+\sqrt{\beta_2^2+b^2}} \right|\end{align} Now, we are able to calculate the main integral: \begin{align} \int\limits_{x_1}^{x_2}dx\int\limits_{y_1}^{y_2}dy\int\limits_{z_1}^{z_2}dz\frac{1}{\sqrt{x^2+y^2+z^2}} &= \int\limits_{x_1}^{x_2}dx\int\limits_{y_1}^{y_2}dy \ln \left| z + \sqrt{x^2+y^2+z^2} \right| \Bigg|_{z=z_1}^{z_2} \\ &= \int\limits_{x_1}^{x_2}dx\int\limits_{y_1}^{y_2}dy \ln \left| \frac{z_2+\sqrt{x^2+y^2+z_2^2}}{z_1+\sqrt{x^2+y^2+z_1^2}} \right| \\&= \int\limits_{x_1}^{x_2}dx \Bigg[ y_2 \ln \left| \frac{z_2+\sqrt{x^2+z_2^2+y_2^2}}{z_1+\sqrt{x^2+z_1^2+y_2^2}} \right| - y_1 \ln \left| \frac{z_2+\sqrt{x^2+z_2^2+y_1^2}}{z_1+\sqrt{x^2+z_1^2+y_1^2}} \right| \\&- \ln \left| \frac{z_2+\sqrt{x^2+z_2^2+y_1^2}}{z_2+\sqrt{x^2+z_2^2+y_2^2}} \right| + \ln \left| \frac{z_1+\sqrt{x^2+z_1^2+y_1^2}}{z_1+\sqrt{x^2+z_1^2+y_2^2}} \right| \Bigg]\\ &= \ldots\end{align} And each integral here calculate with expression for $\textbf{I}_2$. But it looks very crazy, am I on the right way?

UPD: Here is the answer. Could someone approve it? \begin{align} \int\limits_{x_1}^{x_2}dx\int\limits_{y_1}^{y_2}dy\int\limits_{z_1}^{z_2}dz\frac{1}{\sqrt{x^2+y^2+z^2}} &= -(y_1+1) \ln \left|\frac{\sqrt{x_1^2+y_1^2+z_1^2}+z_1}{\sqrt{x_2^2+y_1^2+z_1^2}+z_1}\right|\\&+ y_1 \ln \left|\frac{\sqrt{x_1^2+y_1^2+z_2^2}+z_2}{\sqrt{x_2^2+y_1^2+z_2^2}+z_2}\right| \\&+ \ln \left|\frac{\sqrt{x_1^2+y_1^2+z_2^2}+z_2}{\sqrt{x_2^2+y_1^2+z_2^2}+z_2}\right|+ y_2 \ln \left|\frac{\sqrt{x_1^2+y_2^2+z_1^2}+z_1}{\sqrt{x_2^2+y_2^2+z_1^2}+z_1}\right|+ \ln \left|\frac{\sqrt{x_1^2+y_2^2+z_1^2}+z_1}{\sqrt{x_2^2+y_2^2+z_1^2}+z_1}\right|\\&- y_2 \ln \left|\frac{\sqrt{x_1^2+y_2^2+z_2^2}+z_2}{\sqrt{x_2^2+y_2^2+z_2^2}+z_2}\right|- \ln \left|\frac{\sqrt{x_1^2+y_2^2+z_2^2}+z_2}{\sqrt{x_2^2+y_2^2+z_2^2}+z_2}\right| -x_1 \ln \left|\frac{\sqrt{x_1^2+y_1^2+z_1^2}+z_1}{\sqrt{x_1^2+y_2^2+z_1^2}+z_1}\right|\\&+ x_1 \ln \left|\frac{\sqrt{x_1^2+y_1^2+z_2^2}+z_2}{\sqrt{x_1^2+y_2^2+z_2^2}+z_2}\right|+ x_1 y_1 \ln \left|\frac{\sqrt{x_1^2+y_1^2+z_2^2}+z_2}{\sqrt{x_1^2+y_1^2+z_1^2}+z_1}\right|\\&- x_1 y_2 \ln \left|\frac{\sqrt{x_1^2+y_2^2+z_2^2}+z_2}{\sqrt{x_1^2+y_2^2+z_1^2}+z_1}\right|\\ &+x_2 \ln \left|\frac{\sqrt{x_2^2+y_1^2+z_1^2}+z_1}{\sqrt{x_2^2+y_2^2+z_1^2}+z_1}\right| -x_2 \ln \left|\frac{\sqrt{x_2^2+y_1^2+z_2^2}+z_2}{\sqrt{x_2^2+y_2^2+z_2^2}+z_2}\right|\\ &-x_2 y_1 \ln \left|\frac{\sqrt{x_2^2+y_1^2+z_2^2}+z_2}{\sqrt{x_2^2+y_1^2+z_1^2}+z_1}\right| +x_2 y_2 \ln \left|\frac{\sqrt{x_2^2+y_2^2+z_2^2}+z_2}{\sqrt{x_2^2+y_2^2+z_1^2}+z_1}\right|\end{align}

• Couldn't you use new lines? This is how your equations render on my screen. – user499203 Nov 26 '17 at 5:55
• It should become correct after few seconds after page is loaded. If not, let me know, please, I will fix – danielleontiev Nov 26 '17 at 5:59
• I suggest you to use \begin{align} ... \end{align} next time. – user499203 Nov 26 '17 at 6:01
• @danielleontiev it won't render correctly no matter how many seconds one wait. The layout depends on the rendering mode. For the browser I use, out of the 5 rendering modes, only the HTML-CSS mode knows how to wrap the very long lines in this question. – achille hui Nov 26 '17 at 6:09
• Sorry for inconvenience, I'll try to wrap it with align environment – danielleontiev Nov 26 '17 at 6:12