#NEWLINE# @ staticmethod #NEWLINE# @ cacheit #NEWLINE# def taylor_term( n , x , * previous_terms ) : #NEWLINE# #INDENT# if ( ( n < 0 ) or ( ( n % 2 ) == 0 ) ) : #NEWLINE# #INDENT# return S . Zero #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# x = sympify ( x ) #NEWLINE# return ( ( ( ( - 1 ) ** ( ( n - 1 ) // 2 ) ) * ( x ** n ) ) / n )