Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

Assuming that your integrand is :

a, z, q, r, R, s = var("a, z, q, r, R, s")
Ex = (4/(a^3)*((z*q^2)/r-(z*q^2)/r*exp(-s*(r-R)))*r^2*exp(-2*r/a))

i.e. : $$ \texttt{Ex}=-\frac{4 {\left(\frac{q^{2} z e^{\left({\left(R - r\right)} s\right)}}{r} - \frac{q^{2} z}{r}\right)} r^{2} e^{\left(-\frac{2 \, r}{a}\right)}}{a^{3}} $$

neither giac, fricas nor sympy can give a closed-form expression to this integral ; using maxima leads to a situation where the same asumptions are queried in loop.

However, mathematica (or the gratis (but not free) Wolfram engine) gives an answer :

sage: Im = mathematica.Integrate(Ex, (r, R, oo)) ; Im
ConditionalExpression[(q^2*s*(4*(a + R) + a*(a + 2*R)*s)*z)/
  (a*E^((2*R)/a)*(2 + a*s)^2), Re[a] > 0 && Re[2/a + s] > 0]

which can be manually ang roughly (for now) translated as Im[1].sage() if a.real()>0 and (2/a+s).real()>0 else None.

This situation could be quite enhanced if/when logical symbolic functions are added to Sage (work in progress...).

Note : Th difficulty does not lies in the computation of an antiderivative (all engines can do that), but in the comptation of the limits for r=oo...

HTH,

Assuming that your integrand is :

a, z, q, r, R, s = var("a, z, q, r, R, s")
Ex = (4/(a^3)*((z*q^2)/r-(z*q^2)/r*exp(-s*(r-R)))*r^2*exp(-2*r/a))

i.e. : $$ \texttt{Ex}=-\frac{4 {\left(\frac{q^{2} z e^{\left({\left(R - r\right)} s\right)}}{r} - \frac{q^{2} z}{r}\right)} r^{2} e^{\left(-\frac{2 \, r}{a}\right)}}{a^{3}} $$

neither giac, fricas nor sympy can give a closed-form expression to this integral ; using maxima leads to a situation where the same asumptions are queried in loop.

However, mathematica (or the gratis (but not free) Wolfram engine) gives an answer :

sage: Im = mathematica.Integrate(Ex, (r, R, oo)) ; Im
ConditionalExpression[(q^2*s*(4*(a + R) + a*(a + 2*R)*s)*z)/
  (a*E^((2*R)/a)*(2 + a*s)^2), Re[a] > 0 && Re[2/a + s] > 0]

which can be manually ang roughly (for now) translated as Im[1].sage() if a.real()>0 and (2/a+s).real()>0 else None.

This situation could be quite enhanced if/when logical symbolic functions are added to Sage (work in progress...).

Note : Th The difficulty does not lies in the computation of an antiderivative (all engines can do that), but in the comptation computation of the limits for r=oo...

HTH,