Closed form for $\sum_{r=0}^{n}(-1)^r {3n+1 \choose 3r+1} \cos ^{3n-3r}(x)\sin^{3r+1} (x)$ I request a closed form for the following sum $$S(n)=\sum_{r=0}^{n}(-1)^r {3n+1 \choose 3r+1} \cos ^{3n-3r}(x)\sin^{3r+1} (x) $$
I tried using De Moivre's theorem  $$\cos(nx)+i\sin(nx)=(\cos (x)+i\sin(x))^n $$
And we get by equating the imaginary parts of above equation $$\sin (nx)=\sum_{r=0}^{n}(-1)^r {n \choose 2r+1}\cos^{n-2r-1}(x)\sin^{2r+1}(x)$$
So we get $$\sin ((3n+1)x)=\sum_{r=0}^{n}(-1)^r {3n+1 \choose 2r+1}\cos^{3n-2r}(x)\sin^{2r+1}(x)$$
I am struggling to find a closed form for $S(n)$. Any help please.

Hint
Start simplifying and write the expression as
$$S_n= \cos ^{3 n+1}(x)\sum_{r=0}^n (-1)^r\,\binom{3 n+1}{3 r+1} \,\tan ^{3 r+1}(x)$$
Let $t=\tan(x)$ and obtain something identical to what @user64494 already answered for.
$$T_n=\sum_{r=0}^n (-1)^r\binom{3 n+1}{3 r+1}\, t^{3r+1}=(-1)^n\,t\,P_n(u)\quad \text{with} \quad u=t^3$$  The first polynomials are
$$\left(
\begin{array}{cc}
n & P_n(u) \\
 0 & 1 \\
 1 & u-4 \\
 2 & u^2-35 u+7 \\
 3 & u^3-120 u^2+210 u-10 \\
 4 & u^4-286 u^3+1716 u^2-715 u+13 \\
 5 & u^5-560 u^4+8008 u^3-11440 u^2+1820 u-16 \\
 6 & u^6-969 u^5+27132 u^4-92378 u^3+50388 u^2-3876 u+19 \\
 7 & u^7-1540 u^6+74613 u^5-497420 u^4+646646 u^3-170544 u^2+7315
   u-22 \\
 \end{array}
\right)$$
