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

We know that
$$\begin{align}
\cos{\pi\over 4}&=\sin{\pi\over 4}={\sqrt{2}\over 2}\\
\cos{\pi\over 6}&=\sin{\pi\over 3}={\sqrt{3}\over 2}\\
\cos{\pi\over 3}&=\sin{\pi\over 6}={1\over 2}\\
\cos(x+y)&=\cos{x}\cos{y}-\sin{x}\sin{y}\\
\cos(x-y)&=\cos{x}\cos{y}+\sin{x}\sin{y}\\
\sin(x+y)&=\sin{x}\cos{y}+\cos{x}\sin{y}\\
\cos(x-y)&=\sin{x}\cos{y}-\cos{x}\sin{y}\\
\end{align}$$
With the above you should be done.
