Here is some interesting code:

import sympy as smp
from sympy import *  # please pardon my use of import *
from sympy.vector import *
x,y,R = smp.symbols(' x y R', real = True, positive = True)
f = atan(x/xmp.sqrt(x**2 + 2*R**2))
diff(f,x).simplify(
Integral(_, (x,0,R)).doit()
g = atan(x)
diff(g,x).simplify()
Integral(_, x).doit()

It seems that SymPy can easily take the derivative of atan(x) and integrate 
that to get back atan(x), but has problems when the argument to atan() is a 
more complicated function. I wish I understood underlying algorithms so I 
could investigate this further.



On Tuesday, August 17, 2021 at 3:29:10 PM UTC-4 Joe Heafner wrote:

> I need to evaluate an integral of the form
>
> a/(x**2 + y**2 + a**2)**(3/2) where x, y, and a are Real and a is always 
> positive. The integration limits are x = -a to x = a and y = -a to y = a.
>
> This integral should have a value of 2*pi/3 but SymPy can't seem to 
> evaluate it. 
>
> The code integrate(a/(x**2+y**2+a**2)**Rational(3,2),(x,-a,a),(y,-a,a)) 
> gets as far as doing the x integration but can't seem to complete the y 
> integration. Changing Rational(3,2) to just 1.5 helps a tiny bit, but still 
> leave the y integration unresolved.
>
> Is there something I can do to get SymPy to evaluate this integral?
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"sympy" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/sympy/b09c0c26-c662-4715-a5b0-3db275c76099n%40googlegroups.com.

Reply via email to