The behavior of subs
on Integral
has been changed in the development version of SymPy (see https://github.com/sympy/sympy/wiki/release-notes-for-0.7.4#unification-of-sum-product-and-integral-classes). We plan to do a release within the next few weeks. Your example works in the development version:
>>> # This is in the development version
>>> print(e.subs(Q, x))
Integral(x, (x, -L, L))
As a workaround, you can use replace
instead of subs
:
>>> # This is in 0.7.3
>>> print(e.replace(Q, x))
Integral(x, (x, -L, L))