(n, x, *previous_terms)
Returns the next term in the Taylor series expansion.
Returns the next term in the Taylor series expansion.
Returns the next term in the Taylor series expansion .
def taylor_term(n, x, *previous_terms):
        """
        Returns the next term in the Taylor series expansion.
        """
        if n < 0 or n % 2 == 0:
            return S.Zero
        else:
            x = sympify(x)

            if len(previous_terms) > 2:
                p = previous_terms[-2]
                return p * x**2 / (n*(n - 1))
            else:
                return x**(n) / C.factorial(n)
def taylor_term ( n , x , * previous_terms ) : if n < 0 or n % 2 == 0 : return S . Zero else : x = sympify ( x ) if len ( previous_terms ) > 2 : p = previous_terms [ - 2 ] return p * x ** 2 / ( n * ( n - 1 ) ) else : return x ** ( n ) / C . factorial ( n )