'Calculates the next term in the Taylor series expansion.'

@staticmethod
@cacheit
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) / factorial(n))
