<s>[INST] How to make use of angle sum and difference identities to find the value of sine and cosine? 
Calculate: $\cos\left({5\pi\over12}\right)$ and $\cos\left({\pi\over12}\right)$

What is the easiest way to find $\cos\left({5\pi\over12}\right)$ and $\cos\left({\pi\over12}\right)$ (without a calculator)? If I know that $\frac{5\pi }{12}=\frac{\pi }{4}+\frac{\pi }{6}$ and $\frac{\pi }{12}=\frac{\pi }{3}-\frac{\pi }{4}$, then I can apply angle sum and difference identities. But how do I know $\frac{5\pi }{12}= \frac{\pi }{4}+\frac{\pi }{6}$ and $\frac{\pi }{12}= \frac{\pi }{3}-\frac{\pi }{4}$ in the first place. I know $ \frac{\pi }{4}+\frac{\pi }{6} = \frac{5\pi }{12}$ and $ \frac{\pi }{3}-\frac{\pi }{4}=\frac{\pi }{12}$ but I can't go the other way round.
I gave $\frac{5\pi}{12}$ and $\frac{\pi}{12}$ as an example, I want the general solution for any value in pi rational form $\frac{\pi p}{q}$.
 [/INST] 1 equation and 2 unknows is, generally, an overdetermined system.
In this case, pick any solution for $\dfrac{5\pi}{12} = \dfrac{p_1\pi}{q_1} + \dfrac{p_2\pi}{q_2}$, and sum $\pm \dfrac{p_3\pi}{q_3}$ in a smart way
$$\dfrac{5\pi}{12} = \left( \dfrac{p_1\pi}{q_1} +  \dfrac{p_3\pi}{q_3} \right) + \left( \dfrac{p_2\pi}{q_2} -  \dfrac{p_3\pi}{q_3} \right)$$
$$\dfrac{5\pi}{12} = \dfrac{\pi}{6} + \dfrac{\pi}{4} = \dfrac{\pi}{3} + \dfrac{\pi}{12} = \dfrac{3\pi}{10} + \dfrac{7\pi}{60} = \dots $$
</s>