Note that in the equation, \(\displaystyle cos A + cos B = 2cos\frac{A+B}{2}cos\frac{A-B}{2}\) there are two cosine terms added together in the left hand side and two cosine terms multiplied in the RHS side. By adding the two equations;cos(C+D) and cos(C-D) we can get the equation, \(\displaystyle cos(C+D)+cos(C-D)=2cosC~cosD\) which is of the same form.

Hence your second answer is incorrect. Also note that if \(\displaystyle cos\theta=\alpha\Rightarrow{\theta=2n\pi\pm{cos^{-1}\alpha}~\forall{n\in{Z}}}\) Therefore, for the first one,