Dear all,
First of all, many thanks for Sympy, which is a great tools !
I try to integrate a product of two sinus functions such as :
f(x) = sin(pi*n/L*x) * sin(pi*m/L*x)
where n and m are two positive integer (and L>0). I've found the correct expected values (L/2 if m=n, 0 otherwise). But if I make a small change of variable, moving x to x+L/2, then Sympy fails to provide me an answer. Is there a way to "help" Sympy finding the correct solution ?
An example is below :
----
z = symbols('z')
m, n = symbols('m n', positive=True, integer=True)
L = symbols('L', positive=True, real=True)
def e1(z, n, L):
k_n = n*pi/L
return sin(k_n*(z))
def e2(z, n, L):
k_n = n*pi/L
return sin(k_n*(z+L/2))
Imn1 = integrate(fu(e1(z, n, L)*e1(z, m, L)), (z, 0, L))
Imn2 = integrate(fu(e2(z, n, L)*e2(z, m, L)), (z, -L/2, L/2))
---
In [16]: Imn1
Out[16]: Piecewise((L/2, m == n), (0, True))
In [17]: Imn2
Out[17]: Integral(sin(pi*m*(L/2 + z)/L)*sin(pi*n*(L/2 + z)/L), (z, -L/2, L/2))
Best regards,
Julien