I can not spit out the equations right now but maybe this can help you find the equations yourself.

The lower figure shows the magnitude of the curve in the upper plot. So everywhere the the curve in the upper plot goes negative the lower plot reverses the sign to positive.

What you see in the upper plot is a solid curve and you see some points.

The solid line shows the Discrete-Time Fourier Transform (DTFT) of the truncated cosine sequence. This is so to speak the 'true' result. To derive the expression for this curve you have to evaluate a sum that looks something like this

So the result is a sum of two convolutions (that is the meaning of *). Each of the two terms 'moves' the spectrum, one term moves it to and the other moves it to . We consider the term that moves spectrum to which is what they do in the figure. We thus have to consider

Because nothing else is stated in the figure or in your post we assume that the window function is the rectangular window function. The DTFT of is a sinc function for which I can't write the exact expression right off my mind. So end of the line is that the solid curve in the upper plots is a sinc function moved to .

Also note the the DTFT transform of the truncated cosine sequency is real (because it is symmetric).

The points in the upper plot represents samples of the sinc function. In other words, the points represent a sinc sequence. Because there is a whole number of cosine periods inside your window the samples of the sinc function happen to be precisely at the maximum and at zero-crossings. If there isn't a whole number of periods inside your window you will see samples of a shifted sinc function.

So solid line is shifted sinc function.

Points represents sinc sequence.

Hope this helps