def taylor_term(n, x, *previous_terms): if n < 0: return S.Zero else: x = sympify(x) if len(previous_terms) > 1: p = previous_terms[-1] return ( 3**(S(1) / 3) * x * Abs(sin(2 * pi * (n + S.One) / S(3))) * factorial((n - S.One) / S(3)) / ((n + S.One) * Abs(cos(2 * pi * (n + S.Half) / S(3))) * factorial( (n - 2) / S(3))) * p) else: return (S.One / (root(3, 6) * pi) * gamma((n + S.One) / S(3)) * Abs(sin(2 * pi * (n + S.One) / S(3))) / factorial(n) * (root(3, 3) * x)**n)
def taylor_term(n, x, *previous_terms): if n < 0: return S.Zero else: x = sympify(x) if len(previous_terms) > 1: p = previous_terms[-1] return ((3**(S(1) / 3) * x)**(-n) * (3**(S(1) / 3) * x)**(n + 1) * sin(pi * (2 * n / 3 + S(4) / 3)) * factorial(n) * gamma(n / 3 + S(2) / 3) / (sin(pi * (2 * n / 3 + S(2) / 3)) * factorial(n + 1) * gamma(n / 3 + S(1) / 3)) * p) else: return (S.One / (3**(S(2) / 3) * pi) * gamma( (n + S.One) / S(3)) * sin(2 * pi * (n + S.One) / S(3)) / factorial(n) * (root(3, 3) * x)**n)
def _eval_rewrite_as_hyper(self, z, **kwargs): pf1 = z**2 / (2 * root(3, 6) * gamma(S(2) / 3)) pf2 = root(3, 6) / gamma(S(1) / 3) return pf1 * hyper([], [S(5) / 3], z**3 / 9) + pf2 * hyper( [], [S(1) / 3], z**3 / 9)
def _eval_rewrite_as_hyper(self, z, **kwargs): pf1 = z**2 / (2 * 3**(S(2) / 3) * gamma(S(2) / 3)) pf2 = 1 / (root(3, 3) * gamma(S(1) / 3)) return pf1 * hyper([], [S(5) / 3], z**3 / 9) - pf2 * hyper( [], [S(1) / 3], z**3 / 9)
def _eval_rewrite_as_hyper(self, z, **kwargs): pf1 = S.One / (3**(S(2) / 3) * gamma(S(2) / 3)) pf2 = z / (root(3, 3) * gamma(S(1) / 3)) return pf1 * hyper([], [S(2) / 3], z**3 / 9) - pf2 * hyper( [], [S(4) / 3], z**3 / 9)