(n, x, *previous_terms)
return x**n/C.factorial()(n)
Calculates the next term in the Taylor series expansion.
Calculates the next term in the Taylor series expansion.
Calculates the next term in the Taylor series expansion .
def taylor_term(n, x, *previous_terms):
        """
        Calculates the next term in the Taylor series expansion.
        """
        if n < 0:
            return S.Zero
        if n == 0:
            return S.One
        x = sympify(x)
        if previous_terms:
            p = previous_terms[-1]
            if p is not None:
                return p * x / n
        return x**n/C.factorial()(n)
def taylor_term ( n , x , * previous_terms ) : if n < 0 : return S . Zero if n == 0 : return S . One x = sympify ( x ) if previous_terms : p = previous_terms [ - 1 ] if p is not None : return p * x / n return x ** n / C . factorial ( ) ( n )