I tried the following integral in SymPy 0.7.3:
import sympy
from sympy import cos, sin, pi
sympy.var('x, L')
sympy.var('i, k', integer=True)
integrand = cos(pi*i*x/L)**2*cos(pi*k*x/L)**2*sin(pi*i*x/L)*sin(pi*k*x/L)
print(sympy.integrate(integrand, (x, 0, L), conds='none'))
I already tried not using the conds
argument and not using integer=True
when declaring i, k
without success.
Is there any other workaround to solve this integral?
The solution for this integral is 0
.
NOTE:
There are other similar integrands for which SymPy hangs if someone is interested.
I've noticed a trend of SymPy to hang when the simplifications along the integrations lead to 0
terms, so maybe the problem is in a simplification algorithms applied along the integration.