def test_X21():
 p = symbols('p', positive=True)
 n = symbols('n', positive=True, integer=True)
 s = fourier_series(x, (x, (- p), p))
 assert (s.an.formula == 0)
 assert (s.bn.formula.subs(s.bn.variables[0], 0) == 0)
 assert (s.bn.formula.subs(s.bn.variables[0], n) == ((((((-2) * p) / pi) * ((-1) ** n)) / n) * sin((((n * pi) * x) / p))))

def test_X21 ( ) : p = symbols ( 'p' , positive = True ) n = symbols ( 'n' , positive = True , integer = True ) s = fourier_series ( x , ( x , ( - p ) , p ) ) assert ( s . an . formula == 0 ) assert ( s . bn . formula . subs ( s . bn . variables [ 0 ] , 0 ) == 0 ) assert ( s . bn . formula . subs ( s . bn . variables [ 0 ] , n ) == ( ( ( ( ( ( - 2 ) * p ) / pi ) * ( ( - 1 ) ** n ) ) / n ) * sin ( ( ( ( n * pi ) * x ) / p ) ) ) )
test whether fourier_series of x periodical on the [-p .