By quoting De Moivre's theorem, (r(cos(x) + isin(x)))n = rn(cos(nx) + isin(nx)), we can realise that cos(4x) is a result of the real parts of (cos(x) + isin(x))4
We first write each side of the equation using the maclaurin series for each function.
eix = 1 + ix + (ix)2/2! + (ix)3/3! + (ix)4/4! + ......