# Changes between Version 1 and Version 2 of Ticket #17892

Ignore:
Timestamp:
03/05/15 00:07:23 (6 years ago)
Comment:

Funnily enough it's not the limit placeholder that seems to be the primary issue. For the most part, the generic stuff just works for that. It's the "plus" or "minus" keyword that confuses things.

```sage: L=I.operands().operands()
limit(1/2*sqrt(2)*sqrt(pi)*s*erf(1/2*(I*sqrt(2)*k*s^2 - sqrt(2)*a + sqrt(2)*t)/s)*e^(-1/2*k^2*s^2 - I*a*k) + 1/2*sqrt(2)*sqrt(pi)*s*erf(1/2*(I*sqrt(2)*k*s^2 - sqrt(2)*b + sqrt(2)*t)/s)*e^(-1/2*k^2*s^2 - I*b*k), t, -Infinity, plus)
sage: Ls=L.operator()(*L.operands()[:-1]); Ls
limit(1/2*sqrt(2)*sqrt(pi)*s*erf(1/2*(I*sqrt(2)*k*s^2 - sqrt(2)*a + sqrt(2)*t)/s)*e^(-1/2*k^2*s^2 - I*a*k) + 1/2*sqrt(2)*sqrt(pi)*s*erf(1/2*(I*sqrt(2)*k*s^2 - sqrt(2)*b + sqrt(2)*t)/s)*e^(-1/2*k^2*s^2 - I*b*k), t, -Infinity)
sage: Ls.simplify_full()
1/2*sqrt(pi)*e^(-1/2*k^2*s^2 - I*a*k - I*b*k)*limit(sqrt(2)*s*erf(1/2*(I*sqrt(2)*k*s^2 - sqrt(2)*b + sqrt(2)*t)/s)*e^(I*a*k) + sqrt(2)*s*erf(1/2*(I*sqrt(2)*k*s^2 - sqrt(2)*a + sqrt(2)*t)/s)*e^(I*b*k), t, -Infinity)
```

i.e., the direct problem is that the keyword "plus" does not get translated appropriately. In fact:

```sage: L.operands()[-1].is_symbol()
True
sage: L.operands()[-1]._maxima_()
_SAGE_VAR_plus
```

as you can see, the maxima symbol "plus" got translated to a symbolic variable, which doesn't round-trip properly. It would have been nice to recognize "plus" on the maxima side not into a variable.

For the rest:

```sage: limit(L.operands(),t=-oo,dir='+')
limit(1/2*sqrt(2)*sqrt(pi)*s*erf(1/2*(I*sqrt(2)*k*s^2 - sqrt(2)*a + sqrt(2)*t)/s)*e^(-1/2*k^2*s^2 - I*a*k) + 1/2*sqrt(2)*sqrt(pi)*s*erf(1/2*(I*sqrt(2)*k*s^2 - sqrt(2)*b + sqrt(2)*t)/s)*e^(-1/2*k^2*s^2 - I*b*k), t, -Infinity, plus)
```

which gives a bit of a pointer to the sage user interface (we shouldn't use that as "placeholder", though: it punts to maxima by default, so it shouldn't be called for interpreting the result that comes back).

Unmodified
Added
Removed
Modified
• ## Ticket #17892 – Description

 v1 Maxima gives back limit expressions in some integral computation but Sage has no idea what that is. Consequently, working with the expression leads to failure: {{{ sage: u(t) = exp(-(t-a)^2/(2*s^2)) + exp(-(t-b)^2/(2*s^2)) ; u(t); sage: integral(u(t)*exp(-I*k*t), t, -infinity, +infinity, hold=False) sage: var('a,b,t,s,k'); sage: u(t) = exp(-(t-a)^2/(2*s^2)) + exp(-(t-b)^2/(2*s^2)) ; sage: I=integral(u(t)*exp(-I*k*t), t, -infinity, +infinity); I -limit(1/2*sqrt(2)*sqrt(pi)*s*erf(1/2*(I*sqrt(2)*k*s^2 - sqrt(2)*a + sqrt(2)*t)/s)*e^(-1/2*k^2*s^2 - I*a*k) + 1/2*sqrt(2)*sqrt(pi)*s*erf(1/2*(I*sqrt(2)*k*s^2 - sqrt(2)*b + sqrt(2)*t)/s)*e^(-1/2*k^2*s^2 - I*b*k), t, -Infinity, plus) + limit(1/2*sqrt(2)*sqrt(pi)*s*erf(1/2*(I*sqrt(2)*k*s^2 - sqrt(2)*a + sqrt(2)*t)/s)*e^(-1/2*k^2*s^2 - I*a*k) + 1/2*sqrt(2)*sqrt(pi)*s*erf(1/2*(I*sqrt(2)*k*s^2 - sqrt(2)*b + sqrt(2)*t)/s)*e^(-1/2*k^2*s^2 - I*b*k), t, +Infinity, minus) sage: _.simplify_full() sage: I.simplify_full() ... TypeError: ECL says: Error executing code in Maxima: