2
$\begingroup$

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, and it is failing on this integral for both cases, even the one above. Performing

Assuming[{x < 1, ζ ∈ 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?

$\endgroup$
0
$\begingroup$

The following works in 12.0:

Integrate[1/(Sqrt[x^2 + z^2] (1 + Sqrt[x^2 + z^2])^2), {z, 0, \[Zeta]}, 
 Assumptions -> x < 1 && x >= 0 && \[Zeta] > 0]
(*ConditionalExpression[(\[Zeta] (-1 + Sqrt[x^2 + \[Zeta]^2]))/((-1 + 
 x^2) (-1 + x^2 + \[Zeta]^2)) -  ArcTan[\[Zeta]/Sqrt[-1 + x^2]]/(-1 + x^2)^(3/2) + 
  ArcTan[\[Zeta]/Sqrt[(-1 + x^2) (x^2 + \[Zeta]^2)]]/(-1 + x^2)^(3/2), 
\[Zeta] < 1 && 0 < x < Sqrt[1 - \[Zeta]^2]]*)
| improve this answer | |
$\endgroup$
  • $\begingroup$ Hmm, did this take a while to run, or? Mine runs for a few minutes before spitting the Integrate call back to me. $\endgroup$ – Anonymous Sep 16 at 14:07
  • $\begingroup$ @Anonymous: It takes 36.3935 s on my old comp. $\endgroup$ – user64494 Sep 16 at 14:24
  • $\begingroup$ Hang on, this answer turns out to be identical to the x>1 case... indeed, this returns an imaginary answer for x<1 (the denominator at the end of the final term isn't real) $\endgroup$ – Anonymous Sep 16 at 14:37
  • $\begingroup$ @Anonymous: You are not right, e.g. ConditionalExpression[(\[Zeta] (-1 + Sqrt[x^2 + \[Zeta]^2]))/((-1 + x^2) (-1 + x^2 + \[Zeta]^2)) - ArcTan[\[Zeta]/Sqrt[-1 + x^2]]/(-1 + x^2)^(3/2) + ArcTan[\[Zeta]/ Sqrt[(-1 + x^2) (x^2 + \[Zeta]^2)]]/(-1 + x^2)^(3/2), \[Zeta] < 1 && 0 < x < Sqrt[1 - \[Zeta]^2]] /. {x -> 1/2, \[Zeta] -> 0.1} performs 0.0879209 + 0. I. Don't hesitate to ask for further explanation in need. $\endgroup$ – user64494 Sep 16 at 15:17
  • 1
    $\begingroup$ So-called @Anonymous: the pleasure is all mine. $\endgroup$ – user64494 Sep 17 at 4:09
0
$\begingroup$

Beside @user64494 answer, which is valid for 0<x<1 && 0<\[Zeta] < Sqrt[1 - x^2], there is another solution (Mathematica v12) valid for 0<x<1 && \[Zeta] >= Sqrt[1 - x^2]:

Integrate[1/(Sqrt[x^2 + z^2] (1 + Sqrt[x^2 + z^2])^2), {z, 0, \[Zeta]}, 
Assumptions -> x < 1 && x >= 0 && \[Zeta] >= Sqrt[1 - x^2]]
(*ConditionalExpression[(\[Zeta] (-1 + Sqrt[x^2 + \[Zeta]^2]))/((-1 + x^2) 
(-1 + x^2 + \[Zeta]^2)) + (I ArcTanh[\[Zeta]/Sqrt[1 - x^2]])/(-1 +x^2)^(3/2)-
(I ArcTanh[\[Zeta]/Sqrt[-(-1 + x^2) (x^2 + \[Zeta]^2)]])/(-1 + x^2)^(3/2),x>0]*)
| improve this answer | |
$\endgroup$
  • $\begingroup$ The option Assumptions -> x < 1 && x >= 0 && \[Zeta] >= Sqrt[1 - x^2] exhausts all the possibilities. $\endgroup$ – user64494 Sep 16 at 7:22
  • $\begingroup$ @user64494 No you need both conditions mentioned in my answer to describe the case 0<x<1 $\endgroup$ – Ulrich Neumann Sep 16 at 7:26
  • $\begingroup$ Ulrich Neumann (@ does not work): The condition \[Zeta] >= Sqrt[1 - x^2] is more general than your \[Zeta] > Sqrt[1 - x^2] . Hope I am clear now. $\endgroup$ – user64494 Sep 16 at 7:41
  • $\begingroup$ @user64494 (@ works if you remove the blancs "@UlrichNeumann") You're right, but Mathematica doesn't evaluate the case \[Zeta] = Sqrt[1 - x^2] $\endgroup$ – Ulrich Neumann Sep 16 at 7:52
  • $\begingroup$ Ulrich Neumann: Don't understand you. the command Integrate[ 1/(Sqrt[x^2 + z^2] (1 + Sqrt[x^2 + z^2])^2), {z, 0, \[Zeta]}, Assumptions -> x < 1 && x >= 0 && \[Zeta] >= Sqrt[1 - x^2]] performs ConditionalExpression[(\[Zeta] (-1 + Sqrt[x^2 + \[Zeta]^2]))/((-1 + x^2) (-1 + x^2 + \[Zeta]^2)) + ( I ArcTanh[\[Zeta]/Sqrt[1 - x^2]])/(-1 + x^2)^(3/2) - ( I ArcTanh[\[Zeta]/Sqrt[-(-1 + x^2) (x^2 + \[Zeta]^2)]])/(-1 + x^2)^( 3/2), x > 0].Your words "@ works if you remove the blancs @UlrichNeumann" do not correspond to reality. $\endgroup$ – user64494 Sep 16 at 8:06

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.