Hi, I got this from the "report a problem" feedback form:

Setting algorithm='mathematica_free' in integral() merges lowercase
and uppercase variables

Consider the following Sage code:

sage: clear_vars()
sage: var('D F k r w x X z')
(D, F, k, r, w, x, X, z)
sage: r = sqrt((X-x)^2 + z^2)
sage: F = (exp(-(x-D/2)^2/w^2) - exp(-(x+D/2)^2/w^2)) * exp(i*k*r)/r^2
sage: integral(F, x, -infinity, infinity)
integrate((e^(-1/4*(D - 2*x)^2/w^2) - e^(-1/4*(D + 2*x)^2/w^2))*e^
(I*sqrt((X - x)^2 + z^2)*k)/((X - x)^2 + z^2), x, -Infinity,
+Infinity)
sage: integral(F, x, -infinity, infinity,
algorithm='mathematica_free')
-1/2*(sqrt(pi)*w*erf(1/2*(d - 2*x)/w) + sqrt(pi)*w*erf(1/2*(d + 2*x)/
w))*e^(I*sqrt(z^2)*k)/z^2

The default algorithm can't solve the integral. The 'mathematica_free'
algorithm can't either, because the answer it gives here is what the
integral would be if x = X. It seems that the Wolfram Integrator
doesn't distinguish between lowercase and uppercase variables.
Substituting p for X and calling it again gives the expected result.

----

The code that calls the 'mathematica_free' integrator should give a
warning if there are variables with the same letter in uppercase and
lowercase in the integran

##############

Ok, I've condensed this into a smaller example for the bugtracker. I
think it's better to use some on-the-fly substitution. Is there a
mechanism for that? Attention, it's only possible to use single-letter
variables [we already have an exception for that: "Mathematica online
integrator can only handle single letter variables."]
Or maybe a warning is the best way?

Anyways, these should differ:

sage: var('x X')
sage: integrate(x*X, x, algorithm='mathematica_free')
1/3*x^3

sage: integrate(x*x, x, algorithm='mathematica_free')
1/3*x^3

-- 
To post to this group, send an email to sage-devel@googlegroups.com
To unsubscribe from this group, send an email to 
sage-devel-unsubscr...@googlegroups.com
For more options, visit this group at http://groups.google.com/group/sage-devel
URL: http://www.sagemath.org

Reply via email to