Attenuation - Formulating and solving an integral Suppose I have a sphere with radius $R$, and a point $A$ outside it.
For an arbitrary point in the sphere, denote $B$ the line connecting said point and $A$.
I wish to calculate the following integral: $\int dV e^{-\mu d}$, where the integral is done over the sphere, and $d$ is the length of $B$ that's contained inside the sphere.
I have been able to write this down and solve it for a point that's on the sphere itself, but I have been unable to do so for a general point.
On the sphere, I've written: (Assuming WLOG the point is $(0,0,R)$)
$\int dV e^{-\mu (x^2+y^2+(z-R)^2)^{\frac{1}{2}}}$
How would this look for a general point, and how can it be solved? (This particular case I believe I've solved with differentiation under the integral after moving to cylindrical coordinates)
(The physics behind this question concerns calculating attenuation of an isotropically radiating sphere, but since this is essentially a math question, I'll leave that as a note)
 A: We establish a coordinate system so that the point $A$ is on the $z$ axis.  The spherical symmetry allows us to do this without loss of generality.
Let the point $A$ be denoted $\vec r_0=\hat zz_0$ and a point on the sphere denoted by $\vec r=r\hat r$.  Then, 
$$d=|\vec r-\vec r_0|=\sqrt{r^2+z_0^2-2rz_0\cos(\theta)}\tag 1$$
Using $(1)$, we can write
$$\begin{align}
\int_V e^{-\mu d}\,dV&=-\frac{d}{d\mu}\int_V \frac{e^{-\mu d}}{d}\,dV\\\\
&=-2\pi \frac{d}{d\mu}\int_0^\pi\int_0^R \frac{e^{-\mu \sqrt{r^2+z_0^2-2rz_0\cos(\theta)}}}{\sqrt{r^2+z_0^2-2rz_0\cos(\theta)}}\,r^2\,\sin(\theta)\,dr\,d\theta\\\\
&=-2\pi \frac{d}{d\mu}\int_0^R r\left.\left(\frac{e^{-\mu\sqrt{r^2+z_0^2-2rz_0\cos(\theta)}}}{-\mu z_0}\right)\right|_0^\pi\,dr\\\\
&=\frac{2\pi}{z_0} \frac{d}{d\mu}\left(\frac1\mu \int_0^R r \left(e^{-\mu (r+z_0)}-e^{-\mu(z_0-r)}\right)\,dr\right)
\end{align}$$
Can you finish now?
A: $\newcommand{\bbx}[1]{\,\bbox[8px,border:1px groove navy]{\displaystyle{#1}}\,}
 \newcommand{\braces}[1]{\left\lbrace\,{#1}\,\right\rbrace}
 \newcommand{\bracks}[1]{\left\lbrack\,{#1}\,\right\rbrack}
 \newcommand{\dd}{\mathrm{d}}
 \newcommand{\ds}[1]{\displaystyle{#1}}
 \newcommand{\expo}[1]{\,\mathrm{e}^{#1}\,}
 \newcommand{\ic}{\mathrm{i}}
 \newcommand{\mc}[1]{\mathcal{#1}}
 \newcommand{\mrm}[1]{\mathrm{#1}}
 \newcommand{\pars}[1]{\left(\,{#1}\,\right)}
 \newcommand{\partiald}[3][]{\frac{\partial^{#1} #2}{\partial #3^{#1}}}
 \newcommand{\root}[2][]{\,\sqrt[#1]{\,{#2}\,}\,}
 \newcommand{\totald}[3][]{\frac{\mathrm{d}^{#1} #2}{\mathrm{d} #3^{#1}}}
 \newcommand{\verts}[1]{\left\vert\,{#1}\,\right\vert}$

With $\ds{\mu > 0}$ and $\ds{a > R > 0,\quad}$ lets
  $\ds{\quad\vec{\alpha} \equiv \mu\vec{a}\qquad}$ and
  $\ds{\quad\tilde{R} \equiv \mu R}$.

$$
\mbox{Note that}\
\iiint_{\large\mathbb{R}^{3}}\expo{-\mu\verts{\vec{r} - \vec{a}}}\bracks{r < R}
\,\dd^{3}\vec{r} =
{1 \over \mu^{3}}\iiint_{\large\mathbb{R}^{3}}\expo{-\verts{\vec{r} - \vec{\alpha}}}\bracks{r < \tilde{R}}
\,\dd^{3}\vec{r}
$$

\begin{align}
&\iiint_{\large\mathbb{R}^{3}}\expo{-\verts{\vec{r} - \vec{\alpha}}}
\bracks{r < \tilde{R}}\,\dd^{3}\vec{r} =
\int_{0}^{\tilde{R}}
\pars{\int_{\large\Omega_{\vec{r}}}\expo{-\verts{\vec{r} - \vec{\alpha}}}\,{\dd\Omega_{\vec{r}} \over 4\pi}}4\pi r^{2}\,\dd r
\\[5mm] = &\
4\pi\int_{0}^{\tilde{R}}
\bracks{{1 \over 2}\int_{0}^{\pi}
\exp\pars{-\root{r^{2} -2r\alpha\cos\pars{\theta} + \alpha^{2}}}
\sin\pars{\theta}\,\dd\theta}r^{2}\,\dd r
\\[5mm] = &\
2\pi\int_{0}^{\tilde{R}}
\bracks{{1 \over 2r\alpha}\int_{\pars{\alpha - r}^{2}}^{\pars{r + \alpha}^{2}}\exp\pars{-\root{\xi}}\,\dd\xi}r^{2}\,\dd r =
{\pi \over \alpha}\int_{0}^{\tilde{R}}
\bracks{2\int_{\alpha - r}^{\alpha + r}\exp\pars{-\xi}\xi\,\dd\xi}r\,\dd r
\\[5mm] = &\
{2\pi \over \alpha}\int_{0}^{\tilde{R}}
\braces{2\expo{-\alpha}\bracks{-r\cosh\pars{r} + \pars{1 + \alpha}\sinh\pars{r}}}r\,\dd r
\\[5mm] = &\
-4\pi\,{\expo{-\alpha} \over \alpha}\int_{0}^{\tilde{R}}\cosh\pars{r}r^{2}
\,\dd r +
4\pi\,{\pars{1 + \alpha}\expo{-\alpha} \over \alpha}
\int_{0}^{\tilde{R}}\sinh\pars{r}r\,\dd r
\end{align}


The remaining integrals can be straightforward evaluated.

