def _minpoly_sin(ex, x):
    '\n    Returns the minimal polynomial of ``sin(ex)``\n    see https://mathworld.wolfram.com/TrigonometryAngles.html\n\n    '
    (c, a) = ex.args[0].as_coeff_Mul()
    if (a is pi):
        n = c.denominator
        q = sympify(n)
        if q.is_prime:
            a = chebyshevt_poly(n, polys=True).all_coeffs()
            return Add(*[((x ** ((n - i) - 1)) * a[(n - i)]) for i in range(n)])
        if (c.numerator == 1):
            if (q == 9):
                return ((((64 * (x ** 6)) - (96 * (x ** 4))) + (36 * (x ** 2))) - 3)
        if ((n % 2) == 1):
            a = chebyshevt_poly(n, polys=True).all_coeffs()
            a = [((x ** (n - i)) * a[(n - i)]) for i in range((n + 1))]
            r = Add(*a)
            (_, factors) = factor_list(r)
            res = _choose_factor(factors, x, ex)
            return res
        expr = sqrt(((1 - cos(((2 * c) * pi))) / 2))
        return _minpoly_compose(expr, x, QQ)
    raise NotAlgebraic(f"{ex} doesn't seem to be an algebraic element")
Returns the minimal polynomial of ``sin(ex)``
see https://mathworld.wolfram.com/TrigonometryAngles.html
def _minpoly_sin(ex, x):
    '\n    Returns the minimal polynomial of ``sin(ex)``\n    see https://mathworld.wolfram.com/TrigonometryAngles.html\n\n    '
    (c, a) = ex.args[0].as_coeff_Mul()
    if (a is pi):
        n = c.denominator
        q = sympify(n)
        if q.is_prime:
            a = chebyshevt_poly(n, polys=True).all_coeffs()
            return Add(*[((x ** ((n - i) - 1)) * a[(n - i)]) for i in range(n)])
        if (c.numerator == 1):
            if (q == 9):
                return ((((64 * (x ** 6)) - (96 * (x ** 4))) + (36 * (x ** 2))) - 3)
        if ((n % 2) == 1):
            a = chebyshevt_poly(n, polys=True).all_coeffs()
            a = [((x ** (n - i)) * a[(n - i)]) for i in range((n + 1))]
            r = Add(*a)
            (_, factors) = factor_list(r)
            res = _choose_factor(factors, x, ex)
            return res
        expr = sqrt(((1 - cos(((2 * c) * pi))) / 2))
        return _minpoly_compose(expr, x, QQ)
    raise NotAlgebraic(f"{ex} doesn't seem to be an algebraic element")