Sometimes is is difficult to get answers to fit the solution key. Here is a place to post methods for changing seemingly natural answers into the solution key's answers...
Hw 4 Problem 22.a (b)
$ \frac{3}{(k \pi)^2} \left ( cos \left ( \frac{\pi}{3} k \right ) - cos \left ( \frac {2 \pi}{3} k \right ) \right ) $
$ \begin{align} &= \frac{3}{(k \pi)^2} \left ( \frac{1}{2} e^{jk \frac{\pi}{3}} + \frac{1}{2} e^{-jk \frac{\pi}{3}} - \frac{1}{2} e^{jk \frac{2 \pi}{3}} - \frac{1}{2} e^{-jk \frac{2 \pi}{3}} \right ) \cdot \frac{2}{2} \\ &= \frac{6}{(k \pi)^2} \left ( \frac{1}{4} e^{jk \frac{\pi}{3}} + \frac{1}{4} e^{-jk \frac{\pi}{3}} - \frac{1}{4} e^{jk \frac{2 \pi}{3}} - \frac{1}{4} e^{-jk \frac{2 \pi}{3}} \right ) \\ &= \frac{6}{(k \pi)^2} \left ( -\frac{1}{4} e^{jk \frac {2 \pi}{3}} + \frac{1}{4} e^{jk \frac{\pi}{3}} + \frac{1}{4} e^{-jk \frac{\pi}{3}} - \frac{1}{4} e^{-jk \frac{2 \pi}{3}} \right ) \\ &= \frac{6}{(k \pi)^2} \left ( -\frac{1}{4} e^{jk \frac{\pi}{2}} e^{jk \frac{\pi}{6}} + \frac{1}{4} e^{jk \frac{\pi}{2}} e^{-jk \frac{\pi}{6}} + \frac{1}{4} e^{-jk \frac{\pi}{2}} e^{jk \frac{\pi}{6}} - \frac{1}{4} e^{-jk \frac{\pi}{2}}e^{-jk \frac{\pi}{6}} \right ) \\ &= \frac{6}{(k \pi)^2} \left ( \frac{1}{2j} e^{jk \frac{\pi}{2}} - \frac{1}{2j} e^{-jk \frac{1\pi}{2}} \right ) \left ( \frac{1}{2j} e^{jk \frac{\pi}{6}} - \frac{1}{2j}e^{-jk \frac{\pi}{6}} \right ) \\ &= \frac{6}{(k \pi)^2} sin \left ( \frac{\pi}{2} k \right ) sin \left ( \frac{\pi}{6} k \right ) \end{align} $