How to use sympy to verify that integrate (cos (mx) * sin (nx), (xmem0pi 2pi)) = 0mjinn is an integer?

import sympy
a,b,m,n,x=sympy.symbols("a,b,m,n,x")
f1=sympy.cos(m*x)
f2=sympy.sin(n*x)
v2=sympy.integrate(f1*f2,(x,a,b))
print(v2.subs({a:0,b:2*sympy.pi,m:100,n:100}))

the result is 0
, but I can only take mforce n as a specific integer for checking calculation. How can I set mforce n to any integer? Thank you

Jun.10,2022

answer your own questions and add integer=True to it
clipboard.png

Menu