<s>[INST] Simplfy trigonometric functions by only considering integer inputs? I have the below function which only takes integer input,
$$ 2 \sqrt{3} \sin \left(\frac{\pi  t}{3}\right)+\sqrt{3} \sin \left(\frac{2 \pi  t}{3}\right)-\sqrt{3} \sin \left(\frac{4 \pi  t}{3}\right)+6 \cos \left(\frac{\pi  t}{3}\right)+\cos \left(\frac{2 \pi  t}{3}\right)+\cos \left(\frac{4 \pi  t}{3}\right) $$
The resulting output from $t=0$ to $t=10$ is $\{8, 8, -4, -4, -4, -4, 8, 8, -4, -4, -4\}$, and this pattern repeats indefinitely.
Is there a systematic way of reducing this expression using the fact we only consider integer input?
 [/INST] Since $t$ is an integer,
$$ \sin(\tfrac{4\pi t}{3}) = \sin(2\pi t - \tfrac{2\pi t}{3})
= \sin(2\pi t)\cos(\tfrac{2\pi t}{3}) - \cos(2\pi t)\sin(\tfrac{2\pi t}{3})
= -\sin(\tfrac{2\pi t}{3}) $$
and similarly
$$ \cos(\tfrac{4\pi t}{3}) = \cos(\tfrac{2\pi t}{3}) $$
Thus
\begin{align*}
& 2\sqrt3 \sin(\tfrac{\pi t}{3})
+ \sqrt3\sin(\tfrac{2\pi t}{3})
- \sqrt3\sin(\tfrac{4\pi t}{3})
+ 6\cos(\tfrac{\pi t}{3})
+ \cos(\tfrac{2\pi t}{3})
+ \cos(\tfrac{4\pi t}{3}) \\
&= 2\sqrt3 \sin(\tfrac{\pi t}{3}) + 6\cos(\tfrac{\pi t}{3})
+ 2\sqrt3\sin(\tfrac{2\pi t}{3}) + 2\cos(\tfrac{2\pi t}{3}) \\
&= 4\sqrt3 \left(\tfrac12 \sin(\tfrac{\pi t}{3})
  + \tfrac{\sqrt3}{2}\cos(\tfrac{\pi t}{3})\right)
+ 4 \left(\tfrac{\sqrt3}{2}\sin(\tfrac{2\pi t}{3})
  + \tfrac12\cos(\tfrac{2\pi t}{3}) \right) \\
&= 4\sqrt3 \sin(\tfrac{\pi (t+1)}{3}) + 4 \cos(\tfrac{\pi (2t-1)}{3}) \\
&= 4\sqrt3 \sin(\tfrac{\pi (t+1)}{3}) - 4 \cos(\tfrac{\pi (2t-1)}{3}+\pi) \\
&= 4\sqrt3 \sin(\tfrac{\pi (t+1)}{3}) - 4 \cos(\tfrac{2\pi (t+1)}{3}) \\
&= 4\sqrt3 \sin(\tfrac{\pi (t+1)}{3}) - 4 \cos\big(\pi(t+1)-\tfrac{\pi (t+1)}{3}\big)\\
&= 4\sqrt3 \sin(\tfrac{\pi (t+1)}{3}) - (-1)^{t+1} 4 \cos(\tfrac{\pi (t+1)}{3})\\
&= 8\left(\tfrac{\sqrt3}{2} \sin(\tfrac{\pi (t+1)}{3}) + (-1)^t\tfrac12\cos(\tfrac{\pi (t+1)}{3})\right)\\
&= 8\sin(\tfrac\pi6(2t+2+(-1)^t))
\end{align*}
</s>