Why do these identical elementary integrations lead to differing results?
In the 1st version the parameters y,G are kept arbitrary before doing the
integration.
In the 2nd version the parameters are set before the integration.
The integrand is completely harmless, both with respect to the variable and
the parameters.
The results differ. Why?
x,y,G=sp.symbols('x y G')
c = lambda x: G/(x**2+G**2)
u=sp.integrate(c(x)*c(x-y),x)
d = (c(x)*c(x-y)).subs({y:sp.Integer(2),G:sp.Integer(1)})
v=sp.integrate(d,x)
print (u.subs({x:sp.Integer(1),y:sp.Integer(2),G:sp.Integer(1)})).evalf()
print (v.subs({x:sp.Integer(1)})).evalf()
-0.392699081698724 + 0.e-21*I
0
--
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 post to this group, send email to [email protected].
Visit this group at https://groups.google.com/group/sympy.
To view this discussion on the web visit
https://groups.google.com/d/msgid/sympy/ef11d5e4-a7c2-434c-b9c9-8236bec34468%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.