(n, x, *previous_terms)
return (1 - 2*(n % 2)) * x**(n + 1)/(n + 1)
Returns the next term in the Taylor series expansion of `\log(1+x)`.
Returns the next term in the Taylor series expansion of `\log(1+x)`.
Returns the next term in the Taylor series expansion of \ log ( 1 + x ) .
def taylor_term(n, x, *previous_terms):  # of log(1+x)
        """
        Returns the next term in the Taylor series expansion of `\log(1+x)`.
        """
        from sympy import powsimp
        if n < 0:
            return S.Zero
        x = sympify(x)
        if n == 0:
            return x
        if previous_terms:
            p = previous_terms[-1]
            if p is not None:
                return powsimp((-n) * p * x / (n + 1), deep=True, combine='exp')
        return (1 - 2*(n % 2)) * x**(n + 1)/(n + 1)
def taylor_term ( n , x , * previous_terms ) : # of log(1+x) from sympy import powsimp if n < 0 : return S . Zero x = sympify ( x ) if n == 0 : return x if previous_terms : p = previous_terms [ - 1 ] if p is not None : return powsimp ( ( - n ) * p * x / ( n + 1 ) , deep = True , combine = 'exp' ) return ( 1 - 2 * ( n % 2 ) ) * x ** ( n + 1 ) / ( n + 1 )