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}$.

After practicing a lot of problems in trigonometry, I realized that I need to know the values of sine and cosine only at $\{ \pi/6, \pi/4, \pi/3\}$, and the double angle, half angle and sum and difference identities. @marwalix et al. answered the same.
By applying the double angle formula (i.e. $\sin \left( 2\theta \right) =2\sin \theta \cos \theta$), I found the value of $\{\pi/5, 2\pi/5\}$:
$$\dfrac{\pi }{5}=2\cdot \dfrac{\pi }{10}$$
$$\dfrac{2\pi }{5}=2\cdot \dfrac{\pi }{5}$$
By applying the half angle formula (i.e. $\sin \dfrac{\theta }{2}=\sqrt{\dfrac{1-\cos \theta }{2}}$, $\cos \dfrac{\theta }{2}=\sqrt{\dfrac{1+\cos \theta }{2}}$), I found the value of $\{ \pi/12, \pi/8\}$:
$$\dfrac{\pi }{12}=\dfrac{1}{2}\cdot \dfrac{\pi }{6}$$
$$\dfrac{\pi }{8}=\dfrac{1}{2}\cdot \dfrac{\pi }{4}$$
And finally, by applying $\sin(\alpha \pm \beta) = \sin \alpha \cos \beta \pm \cos \alpha \sin \beta$, and $\cos(\alpha \pm \beta) = \cos \alpha \cos \beta \mp \sin \alpha \sin \beta$, I found the value of $\{ \pi/12, 3\pi/10, 3\pi/8, 5\pi/12\}$:
$$\dfrac{\pi }{12}=\dfrac{\pi }{3}-\dfrac{\pi }{4}=\dfrac{\pi }{4}-\dfrac{\pi }{6}$$
$$\dfrac{3\pi }{10}= \dfrac{\pi }{10}+\dfrac{\pi }{5}=\dfrac{2\pi }{5}-\dfrac{\pi }{10}$$
$$\dfrac{3\pi }{8}=\dfrac{\pi }{4}+\dfrac{\pi }{8}, \dfrac{5\pi }{12}=\dfrac{\pi }{4}+\dfrac{\pi }{6}$$
The values that I found at $\{0, \pi/12, \pi/10, \pi/6, \pi/5, \pi/4, 3\pi/10, \pi/3, 3\pi/8, 2\pi/5, 5\pi/12, \pi/10\}$ are as follows:

