I have the following spherical density distribution:

$\rho(x, z) = \frac{1}{\sqrt{x^2 + z^2}\left(1+\sqrt{x^2+z^2}\right)^2}$

which I have broken into a "line of sight" dimension $z$ and a "transverse" dimension $x$. Integrating this profile along the line of sight gives the projected 2d density $\Sigma$:

$\Sigma(x) = 2\int_0^\infty\rho(x,z)dz$

I wish to compute this for any generic upper bound $\zeta$, i.e.

$\Sigma(x; \zeta) = 2\int_0^\zeta\rho(x,z)dz$

(that is, $\zeta=\infty$ corresponds to the case of projecting the entire distribution to the transverse plane, while $\zeta<\infty$ corresponds to a projection which is truncated in the $z$-dimension).

It turns out this has to be solved piecewise; the solution for $x>1$, via Mathematica 11.3, is

$$ \left.\int_0^\zeta\rho(x, z)dz\right\rvert_{x>1} = \frac{\zeta \left(\sqrt{x^2+\zeta^2}-1\right)}{\left(x^2-1\right) \left(x^2+\zeta^2-1\right)}+\frac{\tan ^{-1}\left(\frac{\zeta}{\sqrt{\left(x^2-1\right) \left(x^2+\zeta^2\right)}}\right)-\tan ^{-1}\left(\frac{\zeta}{\sqrt{x^2-1}}\right)}{\left(x^2-1\right)^{3/2}}$$

However, I am unable to obtain the solution for the case $x<1$. I currently only have access to Mathematica 12.0, rather than 11.3 which reproduces the form above, and it is failing on this integral. Performing

Assuming[{x < 1, ζ \[Element] Reals, ζ > 0}, 
         FullSimplify[Integrate[1/(Sqrt[x^2 + z^2] (1 + Sqrt[x^2 + z^2])^2), {z, 0, ζ}]]]

returns a HyperGeometric function, though I suspect that the $x<1$ case should not be much more complicated than $x>1$. Can anyone confirm? Or see any issue?

  • 3
    $\begingroup$ Please make titles informative as to the content of the post, not as to the mental state of the person posting them at the time they are posting them. $\endgroup$ Sep 16 '20 at 1:09
  • 1
    $\begingroup$ A question about Mathematica may better be suited for mathematica.stackexchange.com $\endgroup$ Sep 16 '20 at 1:48
  • $\begingroup$ @ArturoMagidin apologies; fixed $\endgroup$ Sep 16 '20 at 5:02

WolframAlpha is giving me, on the substitution $z = x\tan\theta$ - $$\int\rho(x, z)dz = \frac{x\sin\theta}{\left(x^2-1\right) \left(\cos\theta+x\right)} - \frac{2\tanh^{-1}\left(\frac{x-1}{\sqrt{1-x^2}}\tan\frac{\theta}{2}\right)}{(1- x^2)^{3/2}} + C$$

  • $\begingroup$ why did you make this substitution? Im. not sure what to do with this form $\endgroup$ Sep 16 '20 at 4:48

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.