Reduce sin(2 * pi * n)

I would like to compute an integral and evaluate it. The result has many sin and cos that have a n (integer) multiplying pi. How can I modify my code so that cos(2 * pi * n) = 1? import sympy as sp x = sp.Symbol('x') n = sp.Symbol('n', integers=True) h = sp.Symbol('h') l = sp.Symbol('l') borne_inf = 0 borne_sup = sp.Symbol('l') integrale = sp.integrate(((4*h/l**2)*x*(x-1))* sp.sin(n * sp.pi * x / l), (x, borne_inf, borne_sup))

Mar 29, 2025 - 01:51
 0
Reduce sin(2 * pi * n)

I would like to compute an integral and evaluate it. The result has many sin and cos that have a n (integer) multiplying pi. How can I modify my code so that cos(2 * pi * n) = 1?

import sympy as sp


x = sp.Symbol('x')
n = sp.Symbol('n', integers=True)
h = sp.Symbol('h')
l = sp.Symbol('l')

borne_inf = 0
borne_sup = sp.Symbol('l')

integrale = sp.integrate(((4*h/l**2)*x*(x-1))* sp.sin(n * sp.pi * x / l), (x, borne_inf, borne_sup))